This commit is contained in:
@@ -26,9 +26,14 @@ final ThemeData _kGalleryDarkTheme = new ThemeData(
|
|||||||
);
|
);
|
||||||
|
|
||||||
class GalleryApp extends StatefulWidget {
|
class GalleryApp extends StatefulWidget {
|
||||||
GalleryApp({this.updateUrlFetcher, Key key}) : super(key: key);
|
GalleryApp({
|
||||||
|
this.updateUrlFetcher,
|
||||||
|
this.enablePerformanceOverlay: true,
|
||||||
|
Key key}
|
||||||
|
) : super(key: key);
|
||||||
|
|
||||||
final UpdateUrlFetcher updateUrlFetcher;
|
final UpdateUrlFetcher updateUrlFetcher;
|
||||||
|
final bool enablePerformanceOverlay;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
GalleryAppState createState() => new GalleryAppState();
|
GalleryAppState createState() => new GalleryAppState();
|
||||||
@@ -56,11 +61,11 @@ class GalleryAppState extends State<GalleryApp> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
showPerformanceOverlay: _showPerformanceOverlay,
|
showPerformanceOverlay: _showPerformanceOverlay,
|
||||||
onShowPerformanceOverlayChanged: (bool value) {
|
onShowPerformanceOverlayChanged: config.enablePerformanceOverlay ? (bool value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_showPerformanceOverlay = value;
|
_showPerformanceOverlay = value;
|
||||||
});
|
});
|
||||||
},
|
} : null,
|
||||||
timeDilation: timeDilation,
|
timeDilation: timeDilation,
|
||||||
onTimeDilationChanged: (double value) {
|
onTimeDilationChanged: (double value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ class GalleryDrawer extends StatelessWidget {
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
new DrawerItem(
|
onShowPerformanceOverlayChanged == null ? new Container(height: 0.0) : new DrawerItem(
|
||||||
icon: new Icon(Icons.assessment),
|
icon: new Icon(Icons.assessment),
|
||||||
onPressed: () { onShowPerformanceOverlayChanged(!showPerformanceOverlay); },
|
onPressed: () { onShowPerformanceOverlayChanged(!showPerformanceOverlay); },
|
||||||
selected: showPerformanceOverlay,
|
selected: showPerformanceOverlay,
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ class GalleryHome extends StatefulWidget {
|
|||||||
}) : super(key: key) {
|
}) : super(key: key) {
|
||||||
assert(onThemeChanged != null);
|
assert(onThemeChanged != null);
|
||||||
assert(onTimeDilationChanged != null);
|
assert(onTimeDilationChanged != null);
|
||||||
assert(onShowPerformanceOverlayChanged != null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final bool useLightTheme;
|
final bool useLightTheme;
|
||||||
|
|||||||
Reference in New Issue
Block a user