Make a variety of private State members actually private.
diff --git a/examples/material_gallery/lib/demo/buttons_demo.dart b/examples/material_gallery/lib/demo/buttons_demo.dart
index e4f103a..b6e77bd 100644
--- a/examples/material_gallery/lib/demo/buttons_demo.dart
+++ b/examples/material_gallery/lib/demo/buttons_demo.dart
@@ -63,12 +63,12 @@
}
class _ButtonsDemoState extends State<ButtonsDemo> {
- List<_ButtonDemo> demos;
+ List<_ButtonDemo> _demos;
@override
void initState() {
super.initState();
- demos = <_ButtonDemo>[
+ _demos = <_ButtonDemo>[
new _ButtonDemo(title: 'FLOATING', text: _floatingText, builder: buildFloatingButton),
new _ButtonDemo(title: 'RAISED', text: _raisedText, builder: buildRaisedButton),
new _ButtonDemo(title: 'FLAT', text: _flatText, builder: buildFlatButton),
@@ -198,17 +198,17 @@
@override
Widget build(BuildContext context) {
return new TabBarSelection<_ButtonDemo>(
- values: demos,
+ values: _demos,
child: new Scaffold(
appBar: new AppBar(
title: new Text("Buttons"),
tabBar: new TabBar<_ButtonDemo>(
isScrollable: true,
- labels: new Map<_ButtonDemo, TabLabel>.fromIterable(demos, value: (_ButtonDemo demo) => demo.tabLabel)
+ labels: new Map<_ButtonDemo, TabLabel>.fromIterable(_demos, value: (_ButtonDemo demo) => demo.tabLabel)
)
),
body: new TabBarView<_ButtonDemo>(
- children: demos.map(buildTabView).toList()
+ children: _demos.map(buildTabView).toList()
)
)
);
diff --git a/examples/material_gallery/lib/demo/dialog_demo.dart b/examples/material_gallery/lib/demo/dialog_demo.dart
index 8c141b1..7ff054a 100644
--- a/examples/material_gallery/lib/demo/dialog_demo.dart
+++ b/examples/material_gallery/lib/demo/dialog_demo.dart
@@ -60,7 +60,7 @@
}
class DialogDemoState extends State<DialogDemo> {
- final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
+ final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
void showDemoDialog/*<T>*/({ BuildContext context, Dialog dialog }) {
showDialog/*<T>*/(
@@ -69,7 +69,7 @@
)
.then((dynamic/*=T*/ value) { // The value passed to Navigator.pop() or null.
if (value != null) {
- scaffoldKey.currentState.showSnackBar(new SnackBar(
+ _scaffoldKey.currentState.showSnackBar(new SnackBar(
content: new Text('You selected: $value')
));
}
@@ -82,7 +82,7 @@
final TextStyle dialogTextStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color);
return new Scaffold(
- key: scaffoldKey,
+ key: _scaffoldKey,
appBar: new AppBar(
title: new Text('Dialogs')
),
@@ -179,7 +179,7 @@
)
.then((TimeOfDay value) { // The value passed to Navigator.pop() or null.
if (value != null) {
- scaffoldKey.currentState.showSnackBar(new SnackBar(
+ _scaffoldKey.currentState.showSnackBar(new SnackBar(
content: new Text('You selected: $value')
));
}
diff --git a/examples/material_gallery/lib/demo/drop_down_demo.dart b/examples/material_gallery/lib/demo/drop_down_demo.dart
index fe5a7c6..02edbdc 100644
--- a/examples/material_gallery/lib/demo/drop_down_demo.dart
+++ b/examples/material_gallery/lib/demo/drop_down_demo.dart
@@ -10,7 +10,7 @@
}
class _DropDownDemoState extends State<DropDownDemo> {
- String value = "Free";
+ String _value = "Free";
List<DropDownMenuItem<String>> buildItems() {
return <String>["One", "Two", "Free", "Four"].map((String value) {
@@ -26,11 +26,11 @@
body: new Center(
child: new DropDownButton<String>(
items: buildItems(),
- value: value,
+ value: _value,
onChanged: (String newValue) {
setState(() {
if (newValue != null)
- value = newValue;
+ _value = newValue;
});
}
)
diff --git a/examples/material_gallery/lib/demo/fitness_demo.dart b/examples/material_gallery/lib/demo/fitness_demo.dart
index 962ad5e..129e259 100644
--- a/examples/material_gallery/lib/demo/fitness_demo.dart
+++ b/examples/material_gallery/lib/demo/fitness_demo.dart
@@ -53,16 +53,16 @@
AssetBundle bundle = DefaultAssetBundle.of(context);
_loadAssets(bundle).then((_) {
setState(() {
- assetsLoaded = true;
+ _assetsLoaded = true;
workoutAnimation = new _WorkoutAnimationNode(
onPerformedJumpingJack: () {
setState(() {
- count += 1;
+ _count += 1;
});
},
onSecondPassed: (int seconds) {
setState(() {
- time = seconds;
+ _time = seconds;
});
}
);
@@ -70,16 +70,16 @@
});
}
- bool assetsLoaded = false;
- int count = 0;
- int time = 0;
- int get kcal => (count * 0.2).toInt();
+ bool _assetsLoaded = false;
+ int _count = 0;
+ int _time = 0;
+ int get kcal => (_count * 0.2).toInt();
_WorkoutAnimationNode workoutAnimation;
@override
Widget build(BuildContext context) {
- if (!assetsLoaded)
+ if (!_assetsLoaded)
return new Container();
Color buttonColor;
@@ -115,8 +115,8 @@
child: new Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- _createInfoPanelCell(Icons.accessibility, '$count', 'COUNT'),
- _createInfoPanelCell(Icons.timer, _formatSeconds(time), 'TIME'),
+ _createInfoPanelCell(Icons.accessibility, '$_count', 'COUNT'),
+ _createInfoPanelCell(Icons.timer, _formatSeconds(_time), 'TIME'),
_createInfoPanelCell(Icons.flash_on, '$kcal', 'KCAL')
]
)
@@ -170,8 +170,8 @@
void startWorkout() {
setState(() {
- count = 0;
- time = 0;
+ _count = 0;
+ _time = 0;
workoutAnimation.start();
});
}
@@ -180,14 +180,14 @@
setState(() {
workoutAnimation.stop();
- if (count >= 3) {
+ if (_count >= 3) {
showDialog(
context: context,
child: new Stack(children: <Widget>[
new _Fireworks(),
new Dialog(
title: new Text("Awesome workout"),
- content: new Text("You have completed $count jumping jacks. Good going!"),
+ content: new Text("You have completed $_count jumping jacks. Good going!"),
actions: <Widget>[
new FlatButton(
child: new Text("SWEET"),
diff --git a/examples/material_gallery/lib/demo/flexible_space_demo.dart b/examples/material_gallery/lib/demo/flexible_space_demo.dart
index 762d639..3fcd018 100644
--- a/examples/material_gallery/lib/demo/flexible_space_demo.dart
+++ b/examples/material_gallery/lib/demo/flexible_space_demo.dart
@@ -75,9 +75,9 @@
}
class FlexibleSpaceDemoState extends State<FlexibleSpaceDemo> {
- final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
- final double appBarHeight = 256.0;
- final Key scrollableKey = new UniqueKey();
+ final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
+ final double _appBarHeight = 256.0;
+ final Key _scrollableKey = new UniqueKey();
AppBarBehavior _appBarBehavior = AppBarBehavior.scroll;
@override
@@ -89,17 +89,17 @@
primarySwatch: Colors.indigo
),
child: new Scaffold(
- key: scaffoldKey,
- scrollableKey: scrollableKey,
+ key: _scaffoldKey,
+ scrollableKey: _scrollableKey,
appBarBehavior: _appBarBehavior,
appBar: new AppBar(
- expandedHeight: appBarHeight,
+ expandedHeight: _appBarHeight,
actions: <Widget>[
new IconButton(
icon: Icons.create,
tooltip: 'Search',
onPressed: () {
- scaffoldKey.currentState.showSnackBar(new SnackBar(
+ _scaffoldKey.currentState.showSnackBar(new SnackBar(
content: new Text('Not supported.')
));
}
@@ -128,14 +128,14 @@
image: new AssetImage(
name: 'packages/flutter_gallery_assets/ali_connors.png',
fit: ImageFit.cover,
- height: appBarHeight
+ height: _appBarHeight
)
);
}
),
body: new Block(
- scrollableKey: scrollableKey,
- padding: new EdgeInsets.only(top: appBarHeight + statusBarHeight),
+ scrollableKey: _scrollableKey,
+ padding: new EdgeInsets.only(top: _appBarHeight + statusBarHeight),
children: <Widget>[
new _ContactCategory(
icon: Icons.call,
diff --git a/examples/material_gallery/lib/demo/full_screen_dialog_demo.dart b/examples/material_gallery/lib/demo/full_screen_dialog_demo.dart
index ba75af7..e83259c 100644
--- a/examples/material_gallery/lib/demo/full_screen_dialog_demo.dart
+++ b/examples/material_gallery/lib/demo/full_screen_dialog_demo.dart
@@ -99,13 +99,13 @@
}
class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
- DateTime fromDateTime = new DateTime.now();
- DateTime toDateTime = new DateTime.now();
- bool allDayValue = false;
- bool saveNeeded = false;
+ DateTime _fromDateTime = new DateTime.now();
+ DateTime _toDateTime = new DateTime.now();
+ bool _allDayValue = false;
+ bool _saveNeeded = false;
void handleDismissButton(BuildContext context) {
- if (!saveNeeded) {
+ if (!_saveNeeded) {
Navigator.pop(context, null);
return;
}
@@ -192,11 +192,11 @@
children: <Widget>[
new Text('From', style: theme.textTheme.caption),
new DateTimeItem(
- dateTime: fromDateTime,
+ dateTime: _fromDateTime,
onChanged: (DateTime value) {
setState(() {
- fromDateTime = value;
- saveNeeded = true;
+ _fromDateTime = value;
+ _saveNeeded = true;
});
}
)
@@ -208,11 +208,11 @@
children: <Widget>[
new Text('To', style: theme.textTheme.caption),
new DateTimeItem(
- dateTime: toDateTime,
+ dateTime: _toDateTime,
onChanged: (DateTime value) {
setState(() {
- toDateTime = value;
- saveNeeded = true;
+ _toDateTime = value;
+ _saveNeeded = true;
});
}
)
@@ -225,11 +225,11 @@
child: new Row(
children: <Widget> [
new Checkbox(
- value: allDayValue,
+ value: _allDayValue,
onChanged: (bool value) {
setState(() {
- allDayValue = value;
- saveNeeded = true;
+ _allDayValue = value;
+ _saveNeeded = true;
});
}
),