Commit 60e7535b authored by Matt Perry's avatar Matt Perry

Pesto demo for the Flutter Gallery app. (#4328)

* Pesto demo for the Flutter Gallery app.

* pesto.special.case
parent 8756a094
......@@ -8,6 +8,30 @@ assets:
- assets/section_components.png
- assets/section_patterns.png
- assets/section_usability.png
- packages/flutter_gallery_assets/pesto/avatar.jpg
- packages/flutter_gallery_assets/pesto/image10.jpg
- packages/flutter_gallery_assets/pesto/image11.jpg
- packages/flutter_gallery_assets/pesto/image12.jpg
- packages/flutter_gallery_assets/pesto/image13.jpg
- packages/flutter_gallery_assets/pesto/image1.jpg
- packages/flutter_gallery_assets/pesto/image2.jpg
- packages/flutter_gallery_assets/pesto/image3.jpg
- packages/flutter_gallery_assets/pesto/image4.jpg
- packages/flutter_gallery_assets/pesto/image5.jpg
- packages/flutter_gallery_assets/pesto/image6.jpg
- packages/flutter_gallery_assets/pesto/image7.jpg
- packages/flutter_gallery_assets/pesto/image8.jpg
- packages/flutter_gallery_assets/pesto/image9.jpg
- packages/flutter_gallery_assets/pesto/logo_small.png
- packages/flutter_gallery_assets/pesto/logo_medium.png
- packages/flutter_gallery_assets/pesto/logo_big.png
- packages/flutter_gallery_assets/pesto/fish.png
- packages/flutter_gallery_assets/pesto/healthy.png
- packages/flutter_gallery_assets/pesto/main.png
- packages/flutter_gallery_assets/pesto/meat.png
- packages/flutter_gallery_assets/pesto/quick.png
- packages/flutter_gallery_assets/pesto/spicy.png
- packages/flutter_gallery_assets/pesto/veggie.png
- packages/flutter_gallery_assets/ali_connors.png
- packages/flutter_gallery_assets/kangaroo_valley_safari.png
- packages/flutter_gallery_assets/top_10_australian_beaches.png
......@@ -32,6 +56,11 @@ assets:
- packages/flutter_gallery_assets/shrine/vendors/sandra-adams.jpg
- packages/flutter_gallery_assets/shrine/vendors/zach.jpg
fonts:
- family: Raleway
fonts:
- asset: packages/flutter_gallery_assets/pesto/fonts/Raleway-Regular.ttf
- asset: packages/flutter_gallery_assets/pesto/fonts/Raleway-Medium.ttf
- asset: packages/flutter_gallery_assets/pesto/fonts/Raleway-SemiBold.ttf
- family: AbrilFatface
fonts:
- asset: packages/flutter_gallery_assets/shrine/fonts/abrilfatface/AbrilFatface-Regular.ttf
......@@ -20,6 +20,7 @@ export 'menu_demo.dart';
export 'modal_bottom_sheet_demo.dart';
export 'overscroll_demo.dart';
export 'page_selector_demo.dart';
export 'pesto_demo.dart';
export 'persistent_bottom_sheet_demo.dart';
export 'progress_indicator_demo.dart';
export 'scrollable_tabs_demo.dart';
......
This diff is collapsed.
......@@ -10,6 +10,7 @@ import 'home.dart';
// Warning: this list must be in the same order that the demos appear in GalleryHome.
final Map<String, WidgetBuilder> kRoutes = <String, WidgetBuilder>{
PestoDemo.routeName: (BuildContext context) => new PestoDemo(),
ShrineDemo.routeName: (BuildContext context) => new ShrineDemo(),
Calculator.routeName: (BuildContext context) => new Calculator(),
ContactsDemo.routeName: (BuildContext context) => new ContactsDemo(),
......
......@@ -71,6 +71,7 @@ class GalleryHomeState extends State<GalleryHome> {
leading: new Icon(icon: Icons.star),
title: new Text('Demos'),
children: <Widget>[
new GalleryItem(title: 'Pesto', routeName: PestoDemo.routeName),
new GalleryItem(title: 'Shrine', routeName: ShrineDemo.routeName),
new GalleryItem(title: 'Calculator', routeName: Calculator.routeName),
new GalleryItem(title: 'Contacts', routeName: ContactsDemo.routeName)
......
......@@ -47,10 +47,18 @@ Future<Null> smokeDemo(WidgetTester tester, String routeName) async {
.pump(const Duration(seconds: 1)); // Wait until the demo has opened.
// Go back
Finder backButton = findBackButton(tester);
expect(backButton, findsOneWidget);
await tester.tap(backButton);
await tester.pump(); // Start the navigator pop "back" operation.
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.
}
await tester.pump(const Duration(seconds: 1)); // Wait until it has finished.
return null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment