Skip to content

Commit

Permalink
Merge pull request flutter#1889 from vlidholt/master
Browse files Browse the repository at this point in the history
Fixes navigation back to main menu in demo game
  • Loading branch information
vlidholt committed Nov 4, 2015
2 parents 10bfac4 + d61e39c commit c225a6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/game/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ class GameDemoState extends State<GameDemo> {
}

Widget _buildMainScene(RouteArguments args) {
NavigatorState navigatorState = Navigator.of(args.context);

return new Stack(<Widget>[
new SpriteWidget(new MainScreenBackground(), SpriteBoxTransformMode.fixedWidth),
new Column(<Widget>[
Expand All @@ -108,10 +110,10 @@ class GameDemoState extends State<GameDemo> {
_sounds,
(int lastScore) {
setState(() { _lastScore = lastScore; });
Navigator.of(args.context).pop();
navigatorState.pop();
}
);
Navigator.of(args.context).pushNamed('/game');
navigatorState.pushNamed('/game');
},
texture: _spriteSheetUI['btn_play_up.png'],
textureDown: _spriteSheetUI['btn_play_down.png'],
Expand Down

0 comments on commit c225a6a

Please sign in to comment.