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 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
export 'backdrop_demo.dart';
export 'bottom_navigation_demo.dart';
export 'buttons_demo.dart';
export 'cards_demo.dart';
......
......@@ -81,6 +81,13 @@ List<GalleryItem> _buildGalleryItems() {
buildRoute: (BuildContext context) => const VideoDemo(),
),
// 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(
title: 'Bottom navigation',
subtitle: 'Bottom navigation with cross-fading views',
......
......@@ -11,16 +11,16 @@ class GalleryTheme {
final ThemeData theme;
}
const int _kPurplePrimaryValue = 0xFF6200EE;
const MaterialColor _kPurpleSwatch = const MaterialColor(
500,
_kPurplePrimaryValue,
const <int, Color> {
50: const Color(0xFFF2E7FE),
100: const Color(0xFFD7B7FD),
200: const Color(0xFFBB86FC),
300: const Color(0xFF9E55FC),
400: const Color(0xFF7F22FD),
500: const Color(0xFF6200EE),
600: const Color(0xFF4B00D1),
500: const Color(_kPurplePrimaryValue),
700: const Color(0xFF3700B3),
800: const Color(0xFF270096),
900: const Color(0xFF190078),
......
......@@ -23,9 +23,8 @@ void main() {
final Offset allDemosOrigin = tester.getTopRight(find.text('Demos'));
final Finder button = find.text('Buttons');
while (button.evaluate().isEmpty) {
await tester.dragFrom(allDemosOrigin, const Offset(0.0, -100.0));
await tester.pump(); // start the scroll
await tester.pump(const Duration(seconds: 1));
await tester.dragFrom(allDemosOrigin, const Offset(0.0, -200.0));
await tester.pumpAndSettle();
}
// Launch the buttons demo and then prove that showing the example
......
......@@ -128,6 +128,8 @@ Future<Null> runSmokeTest(WidgetTester tester) async {
final Finder finder = findGalleryItemByRouteName(tester, routeName);
Scrollable.ensureVisible(tester.element(finder), alignment: 0.5);
await tester.pumpAndSettle();
if (routeName == '/material/backdrop')
continue;
await smokeDemo(tester, 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