Commit 1bf6841f authored by Devon Carew's avatar Devon Carew

move the material_gallery/demos.dart script (#3582)

* move the material_gallery/demos.dart script

* rename all_demos.dart to all.dart
parent f373617a
// 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';
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/rendering.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Desert { class Desert {
Desert(this.name, this.calories, this.fat, this.carbs, this.protein, this.sodium, this.calcium, this.iron); Desert(this.name, this.calories, this.fat, this.carbs, this.protein, this.sodium, this.calcium, this.iron);
......
// 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';
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation; import 'package:flutter/scheduler.dart' show timeDilation;
import '../demos.dart'; import '../demo/all.dart';
import 'home.dart'; import 'home.dart';
final Map<String, WidgetBuilder> kRoutes = <String, WidgetBuilder>{ final Map<String, WidgetBuilder> kRoutes = <String, WidgetBuilder>{
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart'; import 'package:flutter_markdown/flutter_markdown.dart';
import 'syntax_highlighter.dart';
import 'example_code_parser.dart'; import 'example_code_parser.dart';
import 'syntax_highlighter.dart';
class SingleComponentDemoData { class SingleComponentDemoData {
SingleComponentDemoData({ SingleComponentDemoData({
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async'; import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
const String _kStartTag = '// START '; const String _kStartTag = '// START ';
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import '../demos.dart'; import '../demo/all.dart';
import 'drawer.dart'; import 'drawer.dart';
import 'header.dart'; import 'header.dart';
import 'item.dart'; import 'item.dart';
......
...@@ -5,11 +5,10 @@ ...@@ -5,11 +5,10 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:material_gallery/gallery/example_code_parser.dart';
import 'package:mojo/core.dart' as core; import 'package:mojo/core.dart' as core;
import 'package:test/test.dart'; import 'package:test/test.dart';
import '../lib/gallery/example_code_parser.dart';
void main() { void main() {
test('Material Gallery example code parser test', () async { test('Material Gallery example code parser test', () async {
TestAssetBundle bundle = new TestAssetBundle(); TestAssetBundle bundle = new TestAssetBundle();
......
...@@ -4,18 +4,17 @@ ...@@ -4,18 +4,17 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.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 '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. // Warning: the following strings must be kept in sync with GalleryHome.
const List<String> demoCategories = const <String>['Demos', 'Components', 'Style']; const List<String> demoCategories = const <String>['Demos', 'Components', 'Style'];
Finder findGalleryItemByRouteName(WidgetTester tester, String routeName) { Finder findGalleryItemByRouteName(WidgetTester tester, String routeName) {
return find.byWidgetPredicate((Widget widget) { return find.byWidgetPredicate((Widget widget) {
return widget is material_gallery.GalleryItem return widget is material_gallery_item.GalleryItem
&& widget.routeName == routeName; && widget.routeName == routeName;
}); });
} }
...@@ -53,7 +52,7 @@ void smokeDemo(WidgetTester tester, String routeName) { ...@@ -53,7 +52,7 @@ void smokeDemo(WidgetTester tester, String routeName) {
void main() { void main() {
test('Material Gallery app smoke test', () { test('Material Gallery app smoke test', () {
testWidgets((WidgetTester tester) { 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(); // see https://github.com/flutter/flutter/issues/1865
tester.pump(); // triggers a frame tester.pump(); // triggers a frame
...@@ -66,7 +65,7 @@ void main() { ...@@ -66,7 +65,7 @@ void main() {
final List<double> scrollDeltas = new List<double>(); final List<double> scrollDeltas = new List<double>();
double previousY = tester.getTopRight(find.text(demoCategories[0])).y; double previousY = tester.getTopRight(find.text(demoCategories[0])).y;
final List<String> routeNames = material_gallery.kRoutes.keys.toList(); final List<String> routeNames = material_gallery_app.kRoutes.keys.toList();
for (String routeName in routeNames) { for (String routeName in routeNames) {
final double y = tester.getTopRight(findGalleryItemByRouteName(tester, routeName)).y; final double y = tester.getTopRight(findGalleryItemByRouteName(tester, routeName)).y;
scrollDeltas.add(previousY - y); scrollDeltas.add(previousY - y);
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async'; import 'dart:async';
import 'package:flutter_driver/flutter_driver.dart'; import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
......
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