Added rounting mechanism

This commit is contained in:
Alex 2024-09-06 14:47:09 -05:00
parent 9d6a177547
commit 746354b779
No known key found for this signature in database
GPG Key ID: 53CD082B3A5E1082
6 changed files with 139 additions and 95 deletions

View File

@ -7,6 +7,13 @@ class AlbumsCollectionPage extends HookConsumerWidget {
const AlbumsCollectionPage({super.key}); const AlbumsCollectionPage({super.key});
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
return Container(); return Scaffold(
appBar: AppBar(
title: const Text('albums_collection_page_title'),
),
body: const Center(
child: Text('albums_collection_page_content'),
),
);
} }
} }

View File

@ -7,6 +7,13 @@ class LocalAlbumsCollectionPage extends HookConsumerWidget {
const LocalAlbumsCollectionPage({super.key}); const LocalAlbumsCollectionPage({super.key});
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
return Container(); return Scaffold(
appBar: AppBar(
title: const Text('on_this_device'),
),
body: const Center(
child: Text('on_this_device_content'),
),
);
} }
} }

View File

@ -7,6 +7,13 @@ class PeopleCollectionPage extends HookConsumerWidget {
const PeopleCollectionPage({super.key}); const PeopleCollectionPage({super.key});
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
return Container(); return Scaffold(
appBar: AppBar(
title: const Text('people'),
),
body: const Center(
child: Text('people'),
),
);
} }
} }

View File

@ -7,6 +7,13 @@ class PlacesCollectionPage extends HookConsumerWidget {
const PlacesCollectionPage({super.key}); const PlacesCollectionPage({super.key});
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
return Container(); return Scaffold(
appBar: AppBar(
title: const Text('places'),
),
body: const Center(
child: Text('places'),
),
);
} }
} }

View File

@ -87,7 +87,9 @@ class PeopleCollectionCard extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final people = ref.watch(getAllPeopleProvider); final people = ref.watch(getAllPeopleProvider);
final size = MediaQuery.of(context).size.width * 0.5 - 20; final size = MediaQuery.of(context).size.width * 0.5 - 20;
return Column( return GestureDetector(
onTap: () => context.pushRoute(const PeopleCollectionRoute()),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
@ -122,6 +124,7 @@ class PeopleCollectionCard extends ConsumerWidget {
child: Text('People', style: context.textTheme.labelLarge), child: Text('People', style: context.textTheme.labelLarge),
), ),
], ],
),
); );
} }
} }
@ -137,7 +140,11 @@ class AlbumsCollectionCard extends ConsumerWidget {
? ref.watch(albumProvider).where((album) => album.isLocal) ? ref.watch(albumProvider).where((album) => album.isLocal)
: ref.watch(albumProvider).where((album) => album.isRemote); : ref.watch(albumProvider).where((album) => album.isRemote);
final size = MediaQuery.of(context).size.width * 0.5 - 20; final size = MediaQuery.of(context).size.width * 0.5 - 20;
return Column( return GestureDetector(
onTap: () => context.pushRoute(isLocal
? const LocalAlbumsCollectionRoute()
: const AlbumsCollectionRoute()),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
@ -169,6 +176,7 @@ class AlbumsCollectionCard extends ConsumerWidget {
), ),
), ),
], ],
),
); );
} }
} }
@ -178,7 +186,9 @@ class PlacesCollectionCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final size = MediaQuery.of(context).size.width * 0.5 - 20; final size = MediaQuery.of(context).size.width * 0.5 - 20;
return Column( return GestureDetector(
onTap: () => context.pushRoute(const PlacesCollectionRoute()),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
@ -196,7 +206,8 @@ class PlacesCollectionCard extends StatelessWidget {
-157.91959, -157.91959,
), ),
showAttribution: false, showAttribution: false,
themeMode: context.isDarkTheme ? ThemeMode.dark : ThemeMode.light, themeMode:
context.isDarkTheme ? ThemeMode.dark : ThemeMode.light,
), ),
), ),
), ),
@ -205,6 +216,7 @@ class PlacesCollectionCard extends StatelessWidget {
child: Text('Places', style: context.textTheme.labelLarge), child: Text('Places', style: context.textTheme.labelLarge),
), ),
], ],
),
); );
} }
} }

View File

@ -240,21 +240,25 @@ class AppRouter extends RootStackRouter {
page: HeaderSettingsRoute.page, page: HeaderSettingsRoute.page,
guards: [_duplicateGuard], guards: [_duplicateGuard],
), ),
AutoRoute( CustomRoute(
page: PeopleCollectionRoute.page, page: PeopleCollectionRoute.page,
guards: [_authGuard, _duplicateGuard], guards: [_authGuard, _duplicateGuard],
transitionsBuilder: TransitionsBuilders.slideLeft,
), ),
AutoRoute( CustomRoute(
page: AlbumsCollectionRoute.page, page: AlbumsCollectionRoute.page,
guards: [_authGuard, _duplicateGuard], guards: [_authGuard, _duplicateGuard],
transitionsBuilder: TransitionsBuilders.slideLeft,
), ),
AutoRoute( CustomRoute(
page: LocalAlbumsCollectionRoute.page, page: LocalAlbumsCollectionRoute.page,
guards: [_authGuard, _duplicateGuard], guards: [_authGuard, _duplicateGuard],
transitionsBuilder: TransitionsBuilders.slideLeft,
), ),
AutoRoute( CustomRoute(
page: PlacesCollectionRoute.page, page: PlacesCollectionRoute.page,
guards: [_authGuard, _duplicateGuard], guards: [_authGuard, _duplicateGuard],
transitionsBuilder: TransitionsBuilders.slideLeft,
), ),
]; ];
} }