Skip to content

Commit

Permalink
Merge pull request #8 from Nimblesite/remove_drawer
Browse files Browse the repository at this point in the history
Remove Performance Overlay Drawer in Example
  • Loading branch information
MelbourneDeveloper authored Sep 10, 2024
2 parents 3fbd48d + a722527 commit fcba6cc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 77 deletions.
3 changes: 0 additions & 3 deletions charts_flutter/example/lib/app_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ class AppConfig {
final String appName;
final String appLink;
final ThemeData theme;
final bool showPerformanceOverlay;

AppConfig({
required this.appName,
required this.appLink,
required this.theme,
required this.showPerformanceOverlay,
});
}

Expand All @@ -39,6 +37,5 @@ AppConfig get defaultConfig {
brightness: Brightness.light,
primarySwatch: Colors.lightBlue,
),
showPerformanceOverlay: false,
);
}
51 changes: 0 additions & 51 deletions charts_flutter/example/lib/drawer.dart

This file was deleted.

14 changes: 3 additions & 11 deletions charts_flutter/example/lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import 'package:nimble_charts/flutter.dart' as charts;
import 'package:flutter/material.dart';
import 'dart:developer';
import 'app_config.dart';
import 'drawer.dart';
import 'a11y/a11y_gallery.dart' as a11y show buildGallery;
import 'bar_chart/bar_gallery.dart' as bar show buildGallery;
import 'time_series_chart/time_series_gallery.dart' as time_series
Expand All @@ -36,8 +35,6 @@ import 'legends/legends_gallery.dart' as legends show buildGallery;
///
/// This renders a list of all available demos.
class Home extends StatelessWidget {
final bool showPerformanceOverlay;
final ValueChanged<bool> onShowPerformanceOverlayChanged;
final a11yGalleries = a11y.buildGallery();
final barGalleries = bar.buildGallery();
final timeSeriesGalleries = time_series.buildGallery();
Expand All @@ -50,11 +47,9 @@ class Home extends StatelessWidget {
final i18nGalleries = i18n.buildGallery();
final legendsGalleries = legends.buildGallery();

Home(
{Key? key,
this.showPerformanceOverlay = false,
required this.onShowPerformanceOverlayChanged})
: super(key: key) {}
Home({
Key? key,
}) : super(key: key) {}

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -105,9 +100,6 @@ class Home extends StatelessWidget {
_setupPerformance();

return new Scaffold(
drawer: new GalleryDrawer(
showPerformanceOverlay: showPerformanceOverlay,
onShowPerformanceOverlayChanged: onShowPerformanceOverlayChanged),
appBar: new AppBar(title: new Text(defaultConfig.appName)),
body: new ListView(padding: kMaterialListPadding, children: galleries),
);
Expand Down
13 changes: 1 addition & 12 deletions charts_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,13 @@ class GalleryApp extends StatefulWidget {
///
/// Controls performance overlay, and instantiates a [Home] widget.
class GalleryAppState extends State<GalleryApp> {
// Initialize app settings from the default configuration.
bool _showPerformanceOverlay = defaultConfig.showPerformanceOverlay;

@override
Widget build(BuildContext context) {
return new MaterialApp(
debugShowCheckedModeBanner: false,
title: defaultConfig.appName,
theme: defaultConfig.theme,
showPerformanceOverlay: _showPerformanceOverlay,
home: new Home(
showPerformanceOverlay: _showPerformanceOverlay,
onShowPerformanceOverlayChanged: (bool value) {
setState(() {
_showPerformanceOverlay = value;
});
},
));
home: new Home());
}
}

Expand Down

0 comments on commit fcba6cc

Please sign in to comment.