From 1bf6841f564205d01be87c52d5e5bd264241fc38 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 27 Apr 2016 12:23:02 -0700 Subject: [PATCH] move the material_gallery/demos.dart script (#3582) * move the material_gallery/demos.dart script * rename all_demos.dart to all.dart --- examples/material_gallery/lib/demo/all.dart | 37 +++++++++++++++++++ .../lib/demo/data_table_demo.dart | 2 +- examples/material_gallery/lib/demos.dart | 37 ------------------- .../material_gallery/lib/gallery/app.dart | 2 +- .../material_gallery/lib/gallery/demo.dart | 2 +- .../lib/gallery/example_code_parser.dart | 1 + .../material_gallery/lib/gallery/home.dart | 2 +- .../test/example_code_parser_test.dart | 3 +- .../material_gallery/test/smoke_test.dart | 13 +++---- .../test_driver/scroll_perf_test.dart | 1 + 10 files changed, 50 insertions(+), 50 deletions(-) create mode 100644 examples/material_gallery/lib/demo/all.dart delete mode 100644 examples/material_gallery/lib/demos.dart diff --git a/examples/material_gallery/lib/demo/all.dart b/examples/material_gallery/lib/demo/all.dart new file mode 100644 index 0000000000..a2c41f923f --- /dev/null +++ b/examples/material_gallery/lib/demo/all.dart @@ -0,0 +1,37 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +export 'buttons_demo.dart'; +export 'cards_demo.dart'; +export 'chip_demo.dart'; +export 'colors_demo.dart'; +export 'data_table_demo.dart'; +export 'date_picker_demo.dart'; +export 'dialog_demo.dart'; +export 'drawing_demo.dart'; +export 'drop_down_demo.dart'; +export 'fitness_demo.dart'; +export 'flexible_space_demo.dart'; +export 'grid_list_demo.dart'; +export 'icons_demo.dart'; +export 'leave_behind_demo.dart'; +export 'list_demo.dart'; +export 'menu_demo.dart'; +export 'modal_bottom_sheet_demo.dart'; +export 'overscroll_demo.dart'; +export 'page_selector_demo.dart'; +export 'persistent_bottom_sheet_demo.dart'; +export 'progress_indicator_demo.dart'; +export 'scrollable_tabs_demo.dart'; +export 'selection_controls_demo.dart'; +export 'slider_demo.dart'; +export 'snack_bar_demo.dart'; +export 'tabs_demo.dart'; +export 'tabs_fab_demo.dart'; +export 'text_field_demo.dart'; +export 'time_picker_demo.dart'; +export 'tooltip_demo.dart'; +export 'two_level_list_demo.dart'; +export 'typography_demo.dart'; +export 'weather_demo.dart'; diff --git a/examples/material_gallery/lib/demo/data_table_demo.dart b/examples/material_gallery/lib/demo/data_table_demo.dart index 62a481fc43..14bb144430 100644 --- a/examples/material_gallery/lib/demo/data_table_demo.dart +++ b/examples/material_gallery/lib/demo/data_table_demo.dart @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:flutter/rendering.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; class Desert { Desert(this.name, this.calories, this.fat, this.carbs, this.protein, this.sodium, this.calcium, this.iron); diff --git a/examples/material_gallery/lib/demos.dart b/examples/material_gallery/lib/demos.dart deleted file mode 100644 index 5d48384a68..0000000000 --- a/examples/material_gallery/lib/demos.dart +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -export 'demo/buttons_demo.dart'; -export 'demo/cards_demo.dart'; -export 'demo/colors_demo.dart'; -export 'demo/chip_demo.dart'; -export 'demo/data_table_demo.dart'; -export 'demo/date_picker_demo.dart'; -export 'demo/dialog_demo.dart'; -export 'demo/drop_down_demo.dart'; -export 'demo/drawing_demo.dart'; -export 'demo/fitness_demo.dart'; -export 'demo/flexible_space_demo.dart'; -export 'demo/grid_list_demo.dart'; -export 'demo/icons_demo.dart'; -export 'demo/leave_behind_demo.dart'; -export 'demo/list_demo.dart'; -export 'demo/modal_bottom_sheet_demo.dart'; -export 'demo/menu_demo.dart'; -export 'demo/overscroll_demo.dart'; -export 'demo/page_selector_demo.dart'; -export 'demo/persistent_bottom_sheet_demo.dart'; -export 'demo/progress_indicator_demo.dart'; -export 'demo/selection_controls_demo.dart'; -export 'demo/slider_demo.dart'; -export 'demo/snack_bar_demo.dart'; -export 'demo/scrollable_tabs_demo.dart'; -export 'demo/tabs_demo.dart'; -export 'demo/tabs_fab_demo.dart'; -export 'demo/text_field_demo.dart'; -export 'demo/time_picker_demo.dart'; -export 'demo/tooltip_demo.dart'; -export 'demo/two_level_list_demo.dart'; -export 'demo/typography_demo.dart'; -export 'demo/weather_demo.dart'; diff --git a/examples/material_gallery/lib/gallery/app.dart b/examples/material_gallery/lib/gallery/app.dart index 4fd6ab455b..bbe31f7227 100644 --- a/examples/material_gallery/lib/gallery/app.dart +++ b/examples/material_gallery/lib/gallery/app.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart' show timeDilation; -import '../demos.dart'; +import '../demo/all.dart'; import 'home.dart'; final Map kRoutes = { diff --git a/examples/material_gallery/lib/gallery/demo.dart b/examples/material_gallery/lib/gallery/demo.dart index 9e8ec0ab46..b619910705 100644 --- a/examples/material_gallery/lib/gallery/demo.dart +++ b/examples/material_gallery/lib/gallery/demo.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; -import 'syntax_highlighter.dart'; import 'example_code_parser.dart'; +import 'syntax_highlighter.dart'; class SingleComponentDemoData { SingleComponentDemoData({ diff --git a/examples/material_gallery/lib/gallery/example_code_parser.dart b/examples/material_gallery/lib/gallery/example_code_parser.dart index 855ff5c3c1..2cf0bff1c8 100644 --- a/examples/material_gallery/lib/gallery/example_code_parser.dart +++ b/examples/material_gallery/lib/gallery/example_code_parser.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'dart:async'; + import 'package:flutter/services.dart'; const String _kStartTag = '// START '; diff --git a/examples/material_gallery/lib/gallery/home.dart b/examples/material_gallery/lib/gallery/home.dart index a8125ead7a..d825a193b6 100644 --- a/examples/material_gallery/lib/gallery/home.dart +++ b/examples/material_gallery/lib/gallery/home.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; -import '../demos.dart'; +import '../demo/all.dart'; import 'drawer.dart'; import 'header.dart'; import 'item.dart'; diff --git a/examples/material_gallery/test/example_code_parser_test.dart b/examples/material_gallery/test/example_code_parser_test.dart index 84961ab2b4..ffe5d25f5e 100644 --- a/examples/material_gallery/test/example_code_parser_test.dart +++ b/examples/material_gallery/test/example_code_parser_test.dart @@ -5,11 +5,10 @@ import 'dart:async'; import 'package:flutter/services.dart'; +import 'package:material_gallery/gallery/example_code_parser.dart'; import 'package:mojo/core.dart' as core; import 'package:test/test.dart'; -import '../lib/gallery/example_code_parser.dart'; - void main() { test('Material Gallery example code parser test', () async { TestAssetBundle bundle = new TestAssetBundle(); diff --git a/examples/material_gallery/test/smoke_test.dart b/examples/material_gallery/test/smoke_test.dart index 20224d1caf..ea73ac42b0 100644 --- a/examples/material_gallery/test/smoke_test.dart +++ b/examples/material_gallery/test/smoke_test.dart @@ -4,18 +4,17 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:material_gallery/gallery/app.dart' as material_gallery_app; +import 'package:material_gallery/gallery/item.dart' as material_gallery_item; +import 'package:material_gallery/main.dart' as material_gallery_main; import 'package:test/test.dart'; -import '../lib/main.dart' as material_gallery; -import '../lib/gallery/app.dart' as material_gallery; -import '../lib/gallery/item.dart' as material_gallery; - // Warning: the following strings must be kept in sync with GalleryHome. const List demoCategories = const ['Demos', 'Components', 'Style']; Finder findGalleryItemByRouteName(WidgetTester tester, String routeName) { return find.byWidgetPredicate((Widget widget) { - return widget is material_gallery.GalleryItem + return widget is material_gallery_item.GalleryItem && widget.routeName == routeName; }); } @@ -53,7 +52,7 @@ void smokeDemo(WidgetTester tester, String routeName) { void main() { test('Material Gallery app smoke test', () { testWidgets((WidgetTester tester) { - material_gallery.main(); // builds the app and schedules a frame but doesn't trigger one + material_gallery_main.main(); // builds the app and schedules a frame but doesn't trigger one tester.pump(); // see https://github.com/flutter/flutter/issues/1865 tester.pump(); // triggers a frame @@ -66,7 +65,7 @@ void main() { final List scrollDeltas = new List(); double previousY = tester.getTopRight(find.text(demoCategories[0])).y; - final List routeNames = material_gallery.kRoutes.keys.toList(); + final List routeNames = material_gallery_app.kRoutes.keys.toList(); for (String routeName in routeNames) { final double y = tester.getTopRight(findGalleryItemByRouteName(tester, routeName)).y; scrollDeltas.add(previousY - y); diff --git a/examples/material_gallery/test_driver/scroll_perf_test.dart b/examples/material_gallery/test_driver/scroll_perf_test.dart index c4795b5abc..3e57813387 100644 --- a/examples/material_gallery/test_driver/scroll_perf_test.dart +++ b/examples/material_gallery/test_driver/scroll_perf_test.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'dart:async'; + import 'package:flutter_driver/flutter_driver.dart'; import 'package:test/test.dart';