mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-08 18:28:53 +01:00
Move map browser to tab instead of being a standalone page
This commit is contained in:
parent
8c8dcb3e8e
commit
942d36d4a6
5 changed files with 93 additions and 73 deletions
|
@ -1495,6 +1495,7 @@
|
||||||
"mapBrowserDateRangePrevMonth": "Previous month",
|
"mapBrowserDateRangePrevMonth": "Previous month",
|
||||||
"mapBrowserDateRangeThisYear": "This year",
|
"mapBrowserDateRangeThisYear": "This year",
|
||||||
"mapBrowserDateRangeCustom": "Custom",
|
"mapBrowserDateRangeCustom": "Custom",
|
||||||
|
"homeTabMapBrowser": "Map",
|
||||||
|
|
||||||
"errorUnauthenticated": "Unauthenticated access. Please sign-in again if the problem continues",
|
"errorUnauthenticated": "Unauthenticated access. Please sign-in again if the problem continues",
|
||||||
"@errorUnauthenticated": {
|
"@errorUnauthenticated": {
|
||||||
|
|
|
@ -254,6 +254,7 @@
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom",
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser",
|
||||||
"errorUnauthenticated",
|
"errorUnauthenticated",
|
||||||
"errorDisconnected",
|
"errorDisconnected",
|
||||||
"errorLocked",
|
"errorLocked",
|
||||||
|
@ -294,7 +295,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"de": [
|
"de": [
|
||||||
|
@ -333,7 +335,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"el": [
|
"el": [
|
||||||
|
@ -475,7 +478,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"es": [
|
"es": [
|
||||||
|
@ -508,7 +512,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"fi": [
|
"fi": [
|
||||||
|
@ -541,7 +546,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"fr": [
|
"fr": [
|
||||||
|
@ -574,7 +580,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"it": [
|
"it": [
|
||||||
|
@ -612,7 +619,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"nl": [
|
"nl": [
|
||||||
|
@ -987,6 +995,7 @@
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom",
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser",
|
||||||
"errorUnauthenticated",
|
"errorUnauthenticated",
|
||||||
"errorDisconnected",
|
"errorDisconnected",
|
||||||
"errorLocked",
|
"errorLocked",
|
||||||
|
@ -1031,7 +1040,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"pt": [
|
"pt": [
|
||||||
|
@ -1084,7 +1094,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"ru": [
|
"ru": [
|
||||||
|
@ -1117,7 +1128,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"tr": [
|
"tr": [
|
||||||
|
@ -1125,7 +1137,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"zh": [
|
"zh": [
|
||||||
|
@ -1189,7 +1202,8 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
],
|
],
|
||||||
|
|
||||||
"zh_Hant": [
|
"zh_Hant": [
|
||||||
|
@ -1347,6 +1361,7 @@
|
||||||
"mapBrowserDateRangeThisMonth",
|
"mapBrowserDateRangeThisMonth",
|
||||||
"mapBrowserDateRangePrevMonth",
|
"mapBrowserDateRangePrevMonth",
|
||||||
"mapBrowserDateRangeThisYear",
|
"mapBrowserDateRangeThisYear",
|
||||||
"mapBrowserDateRangeCustom"
|
"mapBrowserDateRangeCustom",
|
||||||
|
"homeTabMapBrowser"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import 'package:nc_photos/use_case/import_potential_shared_album.dart';
|
||||||
import 'package:nc_photos/widget/home_collections.dart';
|
import 'package:nc_photos/widget/home_collections.dart';
|
||||||
import 'package:nc_photos/widget/home_photos2.dart';
|
import 'package:nc_photos/widget/home_photos2.dart';
|
||||||
import 'package:nc_photos/widget/home_search.dart';
|
import 'package:nc_photos/widget/home_search.dart';
|
||||||
|
import 'package:nc_photos/widget/map_browser.dart';
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
import 'package:np_common/or_null.dart';
|
import 'package:np_common/or_null.dart';
|
||||||
|
|
||||||
|
@ -87,7 +88,7 @@ class _HomeState extends State<Home> with TickerProviderStateMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
bottomNavigationBar: _buildBottomNavigationBar(context),
|
bottomNavigationBar: _buildBottomNavigationBar(context),
|
||||||
body: Builder(builder: (context) => _buildContent(context)),
|
body: Builder(builder: (context) => _buildContent(context)),
|
||||||
|
@ -114,6 +115,11 @@ class _HomeState extends State<Home> with TickerProviderStateMixin {
|
||||||
selectedIcon: const Icon(Icons.grid_view_sharp),
|
selectedIcon: const Icon(Icons.grid_view_sharp),
|
||||||
label: L10n.global().collectionsTooltip,
|
label: L10n.global().collectionsTooltip,
|
||||||
),
|
),
|
||||||
|
NavigationDestination(
|
||||||
|
icon: const Icon(Icons.map_outlined),
|
||||||
|
selectedIcon: const Icon(Icons.map),
|
||||||
|
label: L10n.global().homeTabMapBrowser,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
selectedIndex: _nextPage,
|
selectedIndex: _nextPage,
|
||||||
onDestinationSelected: _onTapNavItem,
|
onDestinationSelected: _onTapNavItem,
|
||||||
|
@ -125,7 +131,7 @@ class _HomeState extends State<Home> with TickerProviderStateMixin {
|
||||||
return PageView.builder(
|
return PageView.builder(
|
||||||
controller: _pageController,
|
controller: _pageController,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemCount: 3,
|
itemCount: 4,
|
||||||
itemBuilder: (context, index) => SlideTransition(
|
itemBuilder: (context, index) => SlideTransition(
|
||||||
position: Tween(
|
position: Tween(
|
||||||
begin: const Offset(0, .05),
|
begin: const Offset(0, .05),
|
||||||
|
@ -152,6 +158,9 @@ class _HomeState extends State<Home> with TickerProviderStateMixin {
|
||||||
case 2:
|
case 2:
|
||||||
return const HomeCollections();
|
return const HomeCollections();
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
return const MapBrowser();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw ArgumentError("Invalid page index: $index");
|
throw ArgumentError("Invalid page index: $index");
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,10 @@ import 'package:nc_photos/k.dart' as k;
|
||||||
import 'package:nc_photos/snack_bar_manager.dart';
|
import 'package:nc_photos/snack_bar_manager.dart';
|
||||||
import 'package:nc_photos/stream_extension.dart';
|
import 'package:nc_photos/stream_extension.dart';
|
||||||
import 'package:nc_photos/theme.dart';
|
import 'package:nc_photos/theme.dart';
|
||||||
|
import 'package:nc_photos/theme/dimension.dart';
|
||||||
import 'package:nc_photos/widget/collection_browser.dart';
|
import 'package:nc_photos/widget/collection_browser.dart';
|
||||||
import 'package:nc_photos/widget/measure.dart';
|
import 'package:nc_photos/widget/measure.dart';
|
||||||
|
import 'package:nc_photos/widget/navigation_bar_blur_filter.dart';
|
||||||
import 'package:np_codegen/np_codegen.dart';
|
import 'package:np_codegen/np_codegen.dart';
|
||||||
import 'package:np_common/object_util.dart';
|
import 'package:np_common/object_util.dart';
|
||||||
import 'package:np_datetime/np_datetime.dart';
|
import 'package:np_datetime/np_datetime.dart';
|
||||||
|
@ -40,12 +42,6 @@ part 'map_browser/type.dart';
|
||||||
part 'map_browser/view.dart';
|
part 'map_browser/view.dart';
|
||||||
|
|
||||||
class MapBrowser extends StatelessWidget {
|
class MapBrowser extends StatelessWidget {
|
||||||
static const routeName = "/map-browser";
|
|
||||||
|
|
||||||
static Route buildRoute() => MaterialPageRoute(
|
|
||||||
builder: (_) => const MapBrowser(),
|
|
||||||
);
|
|
||||||
|
|
||||||
const MapBrowser({super.key});
|
const MapBrowser({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -66,10 +62,7 @@ class _WrappedMapBrowser extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
return MultiBlocListener(
|
||||||
value: SystemUiOverlayStyle.dark,
|
|
||||||
child: Scaffold(
|
|
||||||
body: MultiBlocListener(
|
|
||||||
listeners: [
|
listeners: [
|
||||||
_BlocListenerT<ExceptionEvent?>(
|
_BlocListenerT<ExceptionEvent?>(
|
||||||
selector: (state) => state.error,
|
selector: (state) => state.error,
|
||||||
|
@ -114,10 +107,14 @@ class _WrappedMapBrowser extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: NavigationBarBlurFilter(
|
||||||
|
height: AppDimension.of(context).homeBottomAppBarHeight,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ import 'package:nc_photos/widget/home.dart';
|
||||||
import 'package:nc_photos/widget/image_editor.dart';
|
import 'package:nc_photos/widget/image_editor.dart';
|
||||||
import 'package:nc_photos/widget/image_enhancer.dart';
|
import 'package:nc_photos/widget/image_enhancer.dart';
|
||||||
import 'package:nc_photos/widget/local_file_viewer.dart';
|
import 'package:nc_photos/widget/local_file_viewer.dart';
|
||||||
import 'package:nc_photos/widget/map_browser.dart';
|
|
||||||
import 'package:nc_photos/widget/people_browser.dart';
|
import 'package:nc_photos/widget/people_browser.dart';
|
||||||
import 'package:nc_photos/widget/places_browser.dart';
|
import 'package:nc_photos/widget/places_browser.dart';
|
||||||
import 'package:nc_photos/widget/result_viewer.dart';
|
import 'package:nc_photos/widget/result_viewer.dart';
|
||||||
|
@ -220,7 +219,6 @@ class _WrappedAppState extends State<_WrappedApp>
|
||||||
PlacesBrowser.routeName: PlacesBrowser.buildRoute,
|
PlacesBrowser.routeName: PlacesBrowser.buildRoute,
|
||||||
ArchiveBrowser.routeName: ArchiveBrowser.buildRoute,
|
ArchiveBrowser.routeName: ArchiveBrowser.buildRoute,
|
||||||
TrustedCertManager.routeName: TrustedCertManager.buildRoute,
|
TrustedCertManager.routeName: TrustedCertManager.buildRoute,
|
||||||
MapBrowser.routeName: MapBrowser.buildRoute,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Route<dynamic>? _onGenerateRoute(RouteSettings settings) {
|
Route<dynamic>? _onGenerateRoute(RouteSettings settings) {
|
||||||
|
|
Loading…
Reference in a new issue