mirror of
https://github.com/flutter/samples.git
synced 2025-11-09 06:18:49 +00:00
Fix go_router navigation (#1515)
This commit is contained in:
@@ -61,7 +61,7 @@ class LevelSelectionScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
rectangularMenuArea: ElevatedButton(
|
rectangularMenuArea: ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
GoRouter.of(context).pop();
|
GoRouter.of(context).go('/');
|
||||||
},
|
},
|
||||||
child: const Text('Back'),
|
child: const Text('Back'),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class MainMenuScreen extends StatelessWidget {
|
|||||||
_gap,
|
_gap,
|
||||||
],
|
],
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () => GoRouter.of(context).go('/settings'),
|
onPressed: () => GoRouter.of(context).push('/settings'),
|
||||||
child: const Text('Settings'),
|
child: const Text('Settings'),
|
||||||
),
|
),
|
||||||
_gap,
|
_gap,
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class _PlaySessionScreenState extends State<PlaySessionScreen> {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () => GoRouter.of(context).pop(),
|
onPressed: () => GoRouter.of(context).go('/play'),
|
||||||
child: const Text('Back'),
|
child: const Text('Back'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class WinGameScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
rectangularMenuArea: ElevatedButton(
|
rectangularMenuArea: ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
GoRouter.of(context).pop();
|
GoRouter.of(context).go('/play');
|
||||||
},
|
},
|
||||||
child: const Text('Continue'),
|
child: const Text('Continue'),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ dependencies:
|
|||||||
|
|
||||||
audioplayers: ^1.1.0
|
audioplayers: ^1.1.0
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
go_router: ^5.0.5
|
go_router: ^5.2.1
|
||||||
logging: ^1.1.0
|
logging: ^1.1.0
|
||||||
provider: ^6.0.2
|
provider: ^6.0.2
|
||||||
shared_preferences: ^2.0.13
|
shared_preferences: ^2.0.13
|
||||||
|
|||||||
Reference in New Issue
Block a user