Add Navigator.of

Now you don't need to pass the navigator around everywhere.
This commit is contained in:
Adam Barth
2015-10-22 11:17:20 -07:00
parent 35bd448bdd
commit de395582d5
21 changed files with 139 additions and 146 deletions

View File

@@ -21,7 +21,7 @@ void main() {
);
tester.pump(); // no effect
expect(tester.findText('drawer'), isNull);
showDrawer(navigator: navigator, child: new Text('drawer'));
showDrawer(context: navigator.context, child: new Text('drawer'));
tester.pump(); // drawer should be starting to animate in
expect(tester.findText('drawer'), isNotNull);
tester.pump(new Duration(seconds: 1)); // animation done
@@ -50,7 +50,7 @@ void main() {
);
tester.pump(); // no effect
expect(tester.findText('drawer'), isNull);
showDrawer(navigator: navigator, child: new Text('drawer'));
showDrawer(context: navigator.context, child: new Text('drawer'));
tester.pump(); // drawer should be starting to animate in
expect(tester.findText('drawer'), isNotNull);
tester.pump(new Duration(seconds: 1)); // animation done

View File

@@ -16,7 +16,7 @@ void main() {
return new GestureDetector(
onTap: () {
showSnackBar(
navigator: args.navigator,
context: args.navigator.context,
placeholderKey: placeholderKey,
content: new Text(helloSnackBar)
);