Removed Pesto's drawer. (#5722)

The drawer was confusing without adding much value. It was
especially confusing when wanting to go back to the Gallery on iOS.
Fixes #5713.
This commit is contained in:
Dragoș Tiselice
2016-09-09 13:19:03 -07:00
committed by GitHub
parent 7cf47ca41f
commit cc3df14268
4 changed files with 5 additions and 118 deletions

View File

@@ -21,37 +21,6 @@ void main() {
if (binding is LiveTestWidgetsFlutterBinding)
binding.allowAllFrames = true;
// Regression test for https://github.com/flutter/flutter/pull/5168
testWidgets('Pesto route management', (WidgetTester tester) async {
await tester.pumpWidget(new GalleryApp());
await tester.pump(); // see https://github.com/flutter/flutter/issues/1865
await tester.pump(); // triggers a frame
expect(find.text('Pesto'), findsOneWidget);
await tester.tap(find.text('Pesto'));
await tester.pump(); // Launch pesto
await tester.pump(const Duration(seconds: 1)); // transition is complete
Future<Null> tapDrawerItem(String title) async {
await tester.tap(findNavigationMenuButton(tester));
await tester.pump();
await tester.pump(const Duration(seconds: 1)); // drawer opening animation
await tester.tap(find.text(title));
await tester.pump();
await tester.pump(const Duration(seconds: 1)); // drawer closing animation
await tester.pump(); // maybe open a new page
return tester.pump(const Duration(seconds: 1)); // new page transition
}
await tapDrawerItem('Home');
await tapDrawerItem('Favorites');
await tapDrawerItem('Home');
await tapDrawerItem('Favorites');
await tapDrawerItem('Home');
await tapDrawerItem('Return to Gallery');
expect(find.text('Flutter Gallery'), findsOneWidget);
});
// Regression test for https://github.com/flutter/flutter/pull/5168
testWidgets('Pesto appbar heroics', (WidgetTester tester) async {
await tester.pumpWidget(

View File

@@ -50,18 +50,10 @@ Future<Null> smokeDemo(WidgetTester tester, String routeName) async {
expect(find.text(kCaption), findsNothing);
// Go back
if (routeName == '/pesto') {
// TODO(mpcomplete): workaround for Pesto, which has a drawer instead of a
// back button. Figure out how to have both.
Finder drawer = find.byType(Scaffold); // get a Widget for the BuildContext
expect(drawer, findsOneWidget);
Navigator.pop(drawer.evaluate().first);
} else {
Finder backButton = findBackButton(tester);
expect(backButton, findsOneWidget);
await tester.tap(backButton);
await tester.pump(); // Start the pop "back" operation.
}
Finder backButton = findBackButton(tester);
expect(backButton, findsOneWidget);
await tester.tap(backButton);
await tester.pump(); // Start the pop "back" operation.
await tester.pump(const Duration(seconds: 1)); // Wait until it has finished.
return null;
}