Skip to content

Commit

Permalink
Fix pop error
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-pratik-k committed Jan 8, 2025
1 parent dc8b12e commit eb46e17
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 63 deletions.
1 change: 1 addition & 0 deletions app/lib/ui/flow/albums/albums_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class _AlbumsScreenState extends ConsumerState<AlbumsScreen> {
media: state.medias[album.id],
onTap: () async {
await AlbumMediaListRoute(
albumId: album.id,
$extra: album,
).push(context);
_notifier.loadAlbums();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class _MediaSelectionScreenState extends ConsumerState<MediaSelectionScreen> {
),
itemCount: gridEntry.value.length,
itemBuilder: (context, index) => AppMediaThumbnail(
heroTag: "selection",
heroTag: "selection${gridEntry.value.elementAt(index)}",
onTap: () {
_notifier.toggleMediaSelection(
gridEntry.value.elementAt(index),
Expand Down
21 changes: 7 additions & 14 deletions app/lib/ui/navigation/app_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class AppRoutePath {
static const onBoard = '/on-board';
static const home = '/';
static const albums = '/albums';
static const add = 'add';
static const mediaList = 'media-list';
static const addAlbum = '/add-album';
static const albumMediaList = '/albums/:albumId';
static const transfer = '/transfer';
static const accounts = '/accounts';
static const preview = '/preview';
Expand Down Expand Up @@ -49,13 +49,7 @@ class OnBoardRoute extends GoRouteData {
),
TypedStatefulShellBranch<AlbumsShellBranch>(
routes: [
TypedGoRoute<AlbumsRoute>(
path: AppRoutePath.albums,
routes: [
TypedGoRoute<AddAlbumRoute>(path: AppRoutePath.add),
TypedGoRoute<AlbumMediaListRoute>(path: AppRoutePath.mediaList),
],
),
TypedGoRoute<AlbumsRoute>(path: AppRoutePath.albums),
],
),
TypedStatefulShellBranch<TransferShellBranch>(
Expand Down Expand Up @@ -105,9 +99,8 @@ class AlbumsRoute extends GoRouteData {
const AlbumsScreen();
}

@TypedGoRoute<AddAlbumRoute>(path: AppRoutePath.addAlbum)
class AddAlbumRoute extends GoRouteData {
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;

final Album? $extra;

const AddAlbumRoute({this.$extra});
Expand All @@ -117,12 +110,12 @@ class AddAlbumRoute extends GoRouteData {
AddAlbumScreen(editAlbum: $extra);
}

@TypedGoRoute<AlbumMediaListRoute>(path: AppRoutePath.albumMediaList)
class AlbumMediaListRoute extends GoRouteData {
static final GlobalKey<NavigatorState> $parentNavigatorKey = rootNavigatorKey;

final Album $extra;
final String albumId;

const AlbumMediaListRoute({required this.$extra});
const AlbumMediaListRoute({required this.$extra, required this.albumId});

@override
Widget build(BuildContext context, GoRouterState state) =>
Expand Down
97 changes: 49 additions & 48 deletions app/lib/ui/navigation/app_route.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eb46e17

Please sign in to comment.