Commit 91b6319a authored by Collin Jackson's avatar Collin Jackson Committed by GitHub

Allow disabling the performance overlay in main.dart, fixes #5580 (#5583)

parent 09e68c33
......@@ -26,9 +26,14 @@ final ThemeData _kGalleryDarkTheme = new ThemeData(
);
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 bool enablePerformanceOverlay;
@override
GalleryAppState createState() => new GalleryAppState();
......@@ -56,11 +61,11 @@ class GalleryAppState extends State<GalleryApp> {
});
},
showPerformanceOverlay: _showPerformanceOverlay,
onShowPerformanceOverlayChanged: (bool value) {
onShowPerformanceOverlayChanged: config.enablePerformanceOverlay ? (bool value) {
setState(() {
_showPerformanceOverlay = value;
});
},
} : null,
timeDilation: timeDilation,
onTimeDilationChanged: (double value) {
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),
onPressed: () { onShowPerformanceOverlayChanged(!showPerformanceOverlay); },
selected: showPerformanceOverlay,
......
......@@ -80,7 +80,6 @@ class GalleryHome extends StatefulWidget {
}) : super(key: key) {
assert(onThemeChanged != null);
assert(onTimeDilationChanged != null);
assert(onShowPerformanceOverlayChanged != null);
}
final bool useLightTheme;
......
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