File tree 3 files changed +13
-11
lines changed
3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import 'cart_tile.dart';
10
10
class CartPage extends ConsumerWidget {
11
11
const CartPage ({Key ? key}) : super (key: key);
12
12
13
- static const routeName = '/ cart' ;
13
+ static const routeName = 'cart' ;
14
14
15
15
@override
16
16
Widget build (BuildContext context, WidgetRef ref) {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ class _CartButton extends ConsumerWidget {
49
49
),
50
50
onPressed: ref.watch (cartEmptyProvider)
51
51
? null
52
- : () => ref.watch (routerProvider).push ( CartPage .routeName),
52
+ : () => ref.watch (routerProvider).go ( '/${ CartPage .routeName }' ),
53
53
);
54
54
}
55
55
}
Original file line number Diff line number Diff line change @@ -8,15 +8,17 @@ final routerProvider = Provider(
8
8
(ref) => GoRouter (
9
9
routes: [
10
10
GoRoute (
11
- path: '/' ,
12
- builder: (context, state) => const ItemsPage (),
13
- routes: []),
14
- GoRoute (
15
- path: CartPage .routeName,
16
- pageBuilder: (context, state) => const CupertinoPage (
17
- fullscreenDialog: true ,
18
- child: CartPage (),
19
- ),
11
+ path: '/' ,
12
+ builder: (context, state) => const ItemsPage (),
13
+ routes: [
14
+ GoRoute (
15
+ path: CartPage .routeName,
16
+ pageBuilder: (context, state) => const CupertinoPage (
17
+ fullscreenDialog: true ,
18
+ child: CartPage (),
19
+ ),
20
+ ),
21
+ ],
20
22
),
21
23
],
22
24
),
You can’t perform that action at this time.
0 commit comments