Introduce a quick way to test across platforms (#8262)

This commit is contained in:
Ian Hickson
2017-02-17 17:47:49 -08:00
committed by GitHub
parent c233f38291
commit f9c2d7d9aa
7 changed files with 163 additions and 34 deletions

View File

@@ -54,7 +54,7 @@ class GalleryAppState extends State<GalleryApp> {
bool _showPerformanceOverlay = false;
bool _checkerboardRasterCacheImages = false;
double _timeDilation = 1.0;
TargetPlatform _platform = defaultTargetPlatform;
TargetPlatform _platform;
Timer _timeDilationTimer;
@@ -94,7 +94,7 @@ class GalleryAppState extends State<GalleryApp> {
} : null,
onPlatformChanged: (TargetPlatform value) {
setState(() {
_platform = value;
_platform = value == defaultTargetPlatform ? null : value;
});
},
timeDilation: _timeDilation,
@@ -128,7 +128,7 @@ class GalleryAppState extends State<GalleryApp> {
return new MaterialApp(
title: 'Flutter Gallery',
color: Colors.grey[500],
theme: (_useLightTheme ? _kGalleryLightTheme : _kGalleryDarkTheme).copyWith(platform: _platform),
theme: (_useLightTheme ? _kGalleryLightTheme : _kGalleryDarkTheme).copyWith(platform: _platform ?? defaultTargetPlatform),
showPerformanceOverlay: _showPerformanceOverlay,
checkerboardRasterCacheImages: _checkerboardRasterCacheImages,
routes: _kRoutes,