Move Material page animations to Material layer.
PageRoute is now MaterialPageRoute. This also changes the following: - Now the HeroController is a Navigator observer, rather than a feature of HeroPageRoutes, which are gone. This means heroes can work between any kind of ModalRoute now. - ModalPageRoute is moved from modal_barrier.dart to routes.dart. - It allows routes to opt-out of their modal barrier being a shortcut to popping the route. - Features of PageRoute that aren't Material-specific get promoted to ModalRoute features: storage, the subtree key, offstageness... The AnimatedModalBarrier is still a ModalRoute feature.
This commit is contained in:
@@ -37,8 +37,8 @@ void main() {
|
||||
// Tap on the the bottom sheet itself to dismiss it
|
||||
tester.tap(tester.findText('BottomSheet'));
|
||||
tester.pump(); // bottom sheet dismiss animation starts
|
||||
tester.pump(new Duration(seconds: 1)); // animation done
|
||||
tester.pump(new Duration(seconds: 1)); // rebuild frame
|
||||
tester.pump(new Duration(seconds: 1)); // last frame of animation (sheet is entirely off-screen, but still present)
|
||||
tester.pump(new Duration(seconds: 1)); // frame after the animation (sheet has been removed)
|
||||
expect(showBottomSheetThenCalled, isTrue);
|
||||
expect(tester.findText('BottomSheet'), isNull);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'widget_tester.dart';
|
||||
@@ -36,9 +36,9 @@ void main() {
|
||||
key: navigatorKey,
|
||||
onGenerateRoute: (NamedRouteSettings settings) {
|
||||
if (settings.name == '/')
|
||||
return new PageRoute(builder: (_) => new Container(child: new ThePositiveNumbers()));
|
||||
return new MaterialPageRoute(builder: (_) => new Container(child: new ThePositiveNumbers()));
|
||||
else if (settings.name == '/second')
|
||||
return new PageRoute(builder: (_) => new Container(child: new ThePositiveNumbers()));
|
||||
return new MaterialPageRoute(builder: (_) => new Container(child: new ThePositiveNumbers()));
|
||||
return null;
|
||||
}
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user