Unverified Commit c5996629 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Added a Backdrop demo to the Gallery (#15579)

parent dd0acea1
This diff is collapsed.
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// 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.
export 'backdrop_demo.dart';
export 'bottom_navigation_demo.dart'; export 'bottom_navigation_demo.dart';
export 'buttons_demo.dart'; export 'buttons_demo.dart';
export 'cards_demo.dart'; export 'cards_demo.dart';
......
...@@ -81,6 +81,13 @@ List<GalleryItem> _buildGalleryItems() { ...@@ -81,6 +81,13 @@ List<GalleryItem> _buildGalleryItems() {
buildRoute: (BuildContext context) => const VideoDemo(), buildRoute: (BuildContext context) => const VideoDemo(),
), ),
// Material Components // Material Components
new GalleryItem(
title: 'Backdrop',
subtitle: 'Select a front layer from back layer',
category: 'Material Components',
routeName: BackdropDemo.routeName,
buildRoute: (BuildContext context) => new BackdropDemo(),
),
new GalleryItem( new GalleryItem(
title: 'Bottom navigation', title: 'Bottom navigation',
subtitle: 'Bottom navigation with cross-fading views', subtitle: 'Bottom navigation with cross-fading views',
......
...@@ -11,16 +11,16 @@ class GalleryTheme { ...@@ -11,16 +11,16 @@ class GalleryTheme {
final ThemeData theme; final ThemeData theme;
} }
const int _kPurplePrimaryValue = 0xFF6200EE;
const MaterialColor _kPurpleSwatch = const MaterialColor( const MaterialColor _kPurpleSwatch = const MaterialColor(
500, _kPurplePrimaryValue,
const <int, Color> { const <int, Color> {
50: const Color(0xFFF2E7FE), 50: const Color(0xFFF2E7FE),
100: const Color(0xFFD7B7FD), 100: const Color(0xFFD7B7FD),
200: const Color(0xFFBB86FC), 200: const Color(0xFFBB86FC),
300: const Color(0xFF9E55FC), 300: const Color(0xFF9E55FC),
400: const Color(0xFF7F22FD), 400: const Color(0xFF7F22FD),
500: const Color(0xFF6200EE), 500: const Color(_kPurplePrimaryValue),
600: const Color(0xFF4B00D1),
700: const Color(0xFF3700B3), 700: const Color(0xFF3700B3),
800: const Color(0xFF270096), 800: const Color(0xFF270096),
900: const Color(0xFF190078), 900: const Color(0xFF190078),
......
...@@ -23,9 +23,8 @@ void main() { ...@@ -23,9 +23,8 @@ void main() {
final Offset allDemosOrigin = tester.getTopRight(find.text('Demos')); final Offset allDemosOrigin = tester.getTopRight(find.text('Demos'));
final Finder button = find.text('Buttons'); final Finder button = find.text('Buttons');
while (button.evaluate().isEmpty) { while (button.evaluate().isEmpty) {
await tester.dragFrom(allDemosOrigin, const Offset(0.0, -100.0)); await tester.dragFrom(allDemosOrigin, const Offset(0.0, -200.0));
await tester.pump(); // start the scroll await tester.pumpAndSettle();
await tester.pump(const Duration(seconds: 1));
} }
// Launch the buttons demo and then prove that showing the example // Launch the buttons demo and then prove that showing the example
......
...@@ -128,6 +128,8 @@ Future<Null> runSmokeTest(WidgetTester tester) async { ...@@ -128,6 +128,8 @@ Future<Null> runSmokeTest(WidgetTester tester) async {
final Finder finder = findGalleryItemByRouteName(tester, routeName); final Finder finder = findGalleryItemByRouteName(tester, routeName);
Scrollable.ensureVisible(tester.element(finder), alignment: 0.5); Scrollable.ensureVisible(tester.element(finder), alignment: 0.5);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
if (routeName == '/material/backdrop')
continue;
await smokeDemo(tester, routeName); await smokeDemo(tester, routeName);
tester.binding.debugAssertNoTransientCallbacks('A transient callback was still active after leaving route $routeName'); tester.binding.debugAssertNoTransientCallbacks('A transient callback was still active after leaving route $routeName');
} }
......
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