Constants! Constants everywhere! (#9286)
Aggressively apply the const lint.
diff --git a/examples/flutter_gallery/lib/demo/colors_demo.dart b/examples/flutter_gallery/lib/demo/colors_demo.dart
index 0aa49ee..0709296 100644
--- a/examples/flutter_gallery/lib/demo/colors_demo.dart
+++ b/examples/flutter_gallery/lib/demo/colors_demo.dart
@@ -125,7 +125,7 @@
child: new Scaffold(
appBar: new AppBar(
elevation: 0,
- title: new Text('Colors'),
+ title: const Text('Colors'),
bottom: new TabBar(
isScrollable: true,
tabs: allPalettes.map((Palette swatch) => new Tab(text: swatch.name)).toList(),
diff --git a/examples/flutter_gallery/lib/demo/contacts_demo.dart b/examples/flutter_gallery/lib/demo/contacts_demo.dart
index b6d9c9e..0e9a9b1 100644
--- a/examples/flutter_gallery/lib/demo/contacts_demo.dart
+++ b/examples/flutter_gallery/lib/demo/contacts_demo.dart
@@ -113,11 +113,11 @@
floating: _appBarBehavior == AppBarBehavior.floating,
actions: <Widget>[
new IconButton(
- icon: new Icon(Icons.create),
+ icon: const Icon(Icons.create),
tooltip: 'Edit',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('This is actually just a demo. Editing isn\'t supported.')
+ content: const Text('This is actually just a demo. Editing isn\'t supported.')
));
},
),
@@ -130,21 +130,21 @@
itemBuilder: (BuildContext context) => <PopupMenuItem<AppBarBehavior>>[
new PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.normal,
- child: new Text('App bar scrolls away')
+ child: const Text('App bar scrolls away')
),
new PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.pinned,
- child: new Text('App bar stays put')
+ child: const Text('App bar stays put')
),
new PopupMenuItem<AppBarBehavior>(
value: AppBarBehavior.floating,
- child: new Text('App bar floats')
+ child: const Text('App bar floats')
),
],
),
],
flexibleSpace: new FlexibleSpaceBar(
- title: new Text('Ali Connors'),
+ title: const Text('Ali Connors'),
background: new Stack(
children: <Widget>[
new Image.asset(
@@ -154,7 +154,7 @@
),
// This gradient ensures that the toolbar icons are distinct
// against the background image.
- new DecoratedBox(
+ const DecoratedBox(
decoration: const BoxDecoration(
gradient: const LinearGradient(
begin: const FractionalOffset(0.5, 0.0),
@@ -177,7 +177,7 @@
tooltip: 'Send message',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('Pretend that this opened your SMS application.')
+ content: const Text('Pretend that this opened your SMS application.')
));
},
lines: <String>[
@@ -190,7 +190,7 @@
tooltip: 'Send message',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('In this demo, this button doesn\'t do anything.')
+ content: const Text('In this demo, this button doesn\'t do anything.')
));
},
lines: <String>[
@@ -203,7 +203,7 @@
tooltip: 'Send message',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('Imagine if you will, a messaging application.')
+ content: const Text('Imagine if you will, a messaging application.')
));
},
lines: <String>[
@@ -221,7 +221,7 @@
tooltip: 'Send personal e-mail',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('Here, your e-mail application would open.')
+ content: const Text('Here, your e-mail application would open.')
));
},
lines: <String>[
@@ -234,7 +234,7 @@
tooltip: 'Send work e-mail',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('This is a demo, so this button does not actually work.')
+ content: const Text('This is a demo, so this button does not actually work.')
));
},
lines: <String>[
@@ -252,7 +252,7 @@
tooltip: 'Open map',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('This would show a map of San Francisco.')
+ content: const Text('This would show a map of San Francisco.')
));
},
lines: <String>[
@@ -266,7 +266,7 @@
tooltip: 'Open map',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('This would show a map of Mountain View.')
+ content: const Text('This would show a map of Mountain View.')
));
},
lines: <String>[
@@ -280,7 +280,7 @@
tooltip: 'Open map',
onPressed: () {
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('This would also show a map, if this was not a demo.')
+ content: const Text('This would also show a map, if this was not a demo.')
));
},
lines: <String>[
diff --git a/examples/flutter_gallery/lib/demo/cupertino/cupertino_activity_indicator_demo.dart b/examples/flutter_gallery/lib/demo/cupertino/cupertino_activity_indicator_demo.dart
index 28d0b93..bcd717f 100644
--- a/examples/flutter_gallery/lib/demo/cupertino/cupertino_activity_indicator_demo.dart
+++ b/examples/flutter_gallery/lib/demo/cupertino/cupertino_activity_indicator_demo.dart
@@ -12,7 +12,7 @@
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
- title: new Text('Cupertino Activity Indicator'),
+ title: const Text('Cupertino Activity Indicator'),
),
body: new Center(
child: new CupertinoActivityIndicator(),
diff --git a/examples/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart b/examples/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart
index aeee815..b45a203 100644
--- a/examples/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart
+++ b/examples/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart
@@ -21,13 +21,13 @@
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
- title: new Text('Cupertino Buttons'),
+ title: const Text('Cupertino Buttons'),
),
body: new Column(
children: <Widget> [
- new Padding(
+ const Padding(
padding: const EdgeInsets.all(16.0),
- child: new Text('iOS themed buttons are flat. They can have borders or backgrounds but '
+ child: const Text('iOS themed buttons are flat. They can have borders or backgrounds but '
'only when necessary.'),
),
new Expanded(
@@ -35,36 +35,36 @@
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget> [
new Text(_pressedCount > 0 ? "Button pressed $_pressedCount times" : " "),
- new Padding(padding: const EdgeInsets.all(12.0)),
+ const Padding(padding: const EdgeInsets.all(12.0)),
new Align(
alignment: const FractionalOffset(0.5, 0.4),
child: new Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new CupertinoButton(
- child: new Text('Cupertino Button'),
+ child: const Text('Cupertino Button'),
onPressed: () {
setState(() {_pressedCount++;});
}
),
new CupertinoButton(
- child: new Text('Disabled'),
+ child: const Text('Disabled'),
onPressed: null,
),
],
),
),
- new Padding(padding: const EdgeInsets.all(12.0)),
+ const Padding(padding: const EdgeInsets.all(12.0)),
new CupertinoButton(
- child: new Text('With Background'),
+ child: const Text('With Background'),
color: _kBlue,
onPressed: () {
setState(() {_pressedCount++;});
}
),
- new Padding(padding: const EdgeInsets.all(12.0)),
+ const Padding(padding: const EdgeInsets.all(12.0)),
new CupertinoButton(
- child: new Text('Disabled'),
+ child: const Text('Disabled'),
color: _kBlue,
onPressed: null,
),
diff --git a/examples/flutter_gallery/lib/demo/cupertino/cupertino_dialog_demo.dart b/examples/flutter_gallery/lib/demo/cupertino/cupertino_dialog_demo.dart
index e808557..5013032 100644
--- a/examples/flutter_gallery/lib/demo/cupertino/cupertino_dialog_demo.dart
+++ b/examples/flutter_gallery/lib/demo/cupertino/cupertino_dialog_demo.dart
@@ -37,27 +37,27 @@
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
- title: new Text('Cupertino Dialogs'),
+ title: const Text('Cupertino Dialogs'),
),
body: new ListView(
padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 72.0),
children: <Widget> [
new CupertinoButton(
- child: new Text('Alert'),
+ child: const Text('Alert'),
color: _kBlue,
onPressed: () {
showDemoDialog<String>(
context: context,
child: new CupertinoAlertDialog(
- content: new Text('Discard draft?'),
+ content: const Text('Discard draft?'),
actions: <Widget>[
new CupertinoDialogAction(
- child: new Text('Discard'),
+ child: const Text('Discard'),
isDestructive: true,
onPressed: () { Navigator.pop(context, 'OK'); }
),
new CupertinoDialogAction(
- child: new Text('Cancel', style: const TextStyle(fontWeight: FontWeight.w600)),
+ child: const Text('Cancel', style: const TextStyle(fontWeight: FontWeight.w600)),
onPressed: () { Navigator.pop(context, 'Cancel'); }
),
]
@@ -65,27 +65,27 @@
);
},
),
- new Padding(padding: const EdgeInsets.all(8.0)),
+ const Padding(padding: const EdgeInsets.all(8.0)),
new CupertinoButton(
- child: new Text('Alert with Title'),
+ child: const Text('Alert with Title'),
color: _kBlue,
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
onPressed: () {
showDemoDialog<String>(
context: context,
child: new CupertinoAlertDialog(
- title: new Text('Allow "Maps" to access your location while you use the app?'),
- content: new Text(
+ title: const Text('Allow "Maps" to access your location while you use the app?'),
+ content: const Text(
'Your current location will be displayed on the map and used for directions, '
'nearby search results, and estimated travel times.'
),
actions: <Widget>[
new CupertinoDialogAction(
- child: new Text('Don\'t Allow'),
+ child: const Text('Don\'t Allow'),
onPressed: () { Navigator.pop(context, 'Disallow'); }
),
new CupertinoDialogAction(
- child: new Text('Allow'),
+ child: const Text('Allow'),
onPressed: () { Navigator.pop(context, 'Allow'); }
),
]
diff --git a/examples/flutter_gallery/lib/demo/cupertino/cupertino_slider_demo.dart b/examples/flutter_gallery/lib/demo/cupertino/cupertino_slider_demo.dart
index 13971cd..79cb7d0 100644
--- a/examples/flutter_gallery/lib/demo/cupertino/cupertino_slider_demo.dart
+++ b/examples/flutter_gallery/lib/demo/cupertino/cupertino_slider_demo.dart
@@ -20,7 +20,7 @@
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
- title: new Text('Cupertino Sliders'),
+ title: const Text('Cupertino Sliders'),
),
body: new Center(
child: new Column(
@@ -39,7 +39,7 @@
});
}
),
- new Text('Cupertino Continuous'),
+ const Text('Cupertino Continuous'),
]
),
new Column(
@@ -56,7 +56,7 @@
});
}
),
- new Text('Cupertino Discrete'),
+ const Text('Cupertino Discrete'),
]
),
],
diff --git a/examples/flutter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart b/examples/flutter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart
index dd2df03..c666156 100644
--- a/examples/flutter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart
+++ b/examples/flutter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart
@@ -20,7 +20,7 @@
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
- title: new Text('Cupertino Switch'),
+ title: const Text('Cupertino Switch'),
),
body: new Center(
child: new CupertinoSwitch(
diff --git a/examples/flutter_gallery/lib/demo/material/bottom_navigation_demo.dart b/examples/flutter_gallery/lib/demo/material/bottom_navigation_demo.dart
index 4cbe54f..7acc30e 100644
--- a/examples/flutter_gallery/lib/demo/material/bottom_navigation_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/bottom_navigation_demo.dart
@@ -23,7 +23,7 @@
) {
_animation = new CurvedAnimation(
parent: controller,
- curve: new Interval(0.5, 1.0, curve: Curves.fastOutSlowIn),
+ curve: const Interval(0.5, 1.0, curve: Curves.fastOutSlowIn),
);
}
@@ -96,32 +96,32 @@
super.initState();
_navigationViews = <NavigationIconView>[
new NavigationIconView(
- icon: new Icon(Icons.access_alarm),
- title: new Text('Alarm'),
+ icon: const Icon(Icons.access_alarm),
+ title: const Text('Alarm'),
color: Colors.deepPurple,
vsync: this,
),
new NavigationIconView(
icon: new CustomIcon(),
- title: new Text('Box'),
+ title: const Text('Box'),
color: Colors.deepOrange,
vsync: this,
),
new NavigationIconView(
- icon: new Icon(Icons.cloud),
- title: new Text('Cloud'),
+ icon: const Icon(Icons.cloud),
+ title: const Text('Cloud'),
color: Colors.teal,
vsync: this,
),
new NavigationIconView(
- icon: new Icon(Icons.favorite),
- title: new Text('Favorites'),
+ icon: const Icon(Icons.favorite),
+ title: const Text('Favorites'),
color: Colors.indigo,
vsync: this,
),
new NavigationIconView(
- icon: new Icon(Icons.event_available),
- title: new Text('Event'),
+ icon: const Icon(Icons.event_available),
+ title: const Text('Event'),
color: Colors.pink,
vsync: this,
)
@@ -183,7 +183,7 @@
return new Scaffold(
appBar: new AppBar(
- title: new Text('Bottom navigation'),
+ title: const Text('Bottom navigation'),
actions: <Widget>[
new PopupMenuButton<BottomNavigationBarType>(
onSelected: (BottomNavigationBarType value) {
@@ -194,11 +194,11 @@
itemBuilder: (BuildContext context) => <PopupMenuItem<BottomNavigationBarType>>[
new PopupMenuItem<BottomNavigationBarType>(
value: BottomNavigationBarType.fixed,
- child: new Text('Fixed'),
+ child: const Text('Fixed'),
),
new PopupMenuItem<BottomNavigationBarType>(
value: BottomNavigationBarType.shifting,
- child: new Text('Shifting'),
+ child: const Text('Shifting'),
)
],
)
diff --git a/examples/flutter_gallery/lib/demo/material/buttons_demo.dart b/examples/flutter_gallery/lib/demo/material/buttons_demo.dart
index f191300..c3aafd6 100644
--- a/examples/flutter_gallery/lib/demo/material/buttons_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/buttons_demo.dart
@@ -95,13 +95,13 @@
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new RaisedButton(
- child: new Text('RAISED BUTTON'),
+ child: const Text('RAISED BUTTON'),
onPressed: () {
// Perform some action
},
),
new RaisedButton(
- child: new Text('DISABLED'),
+ child: const Text('DISABLED'),
onPressed: null,
)
],
@@ -116,13 +116,13 @@
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new FlatButton(
- child: new Text('FLAT BUTTON'),
+ child: const Text('FLAT BUTTON'),
onPressed: () {
// Perform some action
},
),
new FlatButton(
- child: new Text('DISABLED'),
+ child: const Text('DISABLED'),
onPressed: null,
)
],
@@ -142,7 +142,7 @@
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
new ListTile(
- title: new Text('Simple dropdown:'),
+ title: const Text('Simple dropdown:'),
trailing: new DropdownButton<String>(
value: dropdown1Value,
onChanged: (String newValue) {
@@ -162,10 +162,10 @@
height: 24.0,
),
new ListTile(
- title: new Text('Dropdown with a hint:'),
+ title: const Text('Dropdown with a hint:'),
trailing: new DropdownButton<String>(
value: dropdown2Value,
- hint: new Text('Choose'),
+ hint: const Text('Choose'),
onChanged: (String newValue) {
setState(() {
dropdown2Value = newValue;
@@ -183,7 +183,7 @@
height: 24.0,
),
new ListTile(
- title: new Text('Scrollable dropdown:'),
+ title: const Text('Scrollable dropdown:'),
trailing: new DropdownButton<String>(
value: dropdown3Value,
onChanged: (String newValue) {
@@ -218,14 +218,14 @@
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new IconButton(
- icon: new Icon(Icons.thumb_up),
+ icon: const Icon(Icons.thumb_up),
onPressed: () {
setState(() => iconButtonToggle = !iconButtonToggle);
},
color: iconButtonToggle ? Theme.of(context).primaryColor : null,
),
- new IconButton(
- icon: new Icon(Icons.thumb_up),
+ const IconButton(
+ icon: const Icon(Icons.thumb_up),
onPressed: null,
)
]
@@ -239,7 +239,7 @@
return new Align(
alignment: const FractionalOffset(0.5, 0.4),
child: new FloatingActionButton(
- child: new Icon(Icons.add),
+ child: const Icon(Icons.add),
onPressed: () {
// Perform some action
},
diff --git a/examples/flutter_gallery/lib/demo/material/cards_demo.dart b/examples/flutter_gallery/lib/demo/material/cards_demo.dart
index fdc637f..a34d337 100644
--- a/examples/flutter_gallery/lib/demo/material/cards_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/cards_demo.dart
@@ -116,12 +116,12 @@
alignment: MainAxisAlignment.start,
children: <Widget>[
new FlatButton(
- child: new Text('SHARE'),
+ child: const Text('SHARE'),
textColor: Colors.amber.shade500,
onPressed: () { /* do nothing */ },
),
new FlatButton(
- child: new Text('EXPLORE'),
+ child: const Text('EXPLORE'),
textColor: Colors.amber.shade500,
onPressed: () { /* do nothing */ },
),
@@ -142,7 +142,7 @@
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
- title: new Text('Travel stream')
+ title: const Text('Travel stream')
),
body: new ListView(
itemExtent: TravelDestinationItem.height,
diff --git a/examples/flutter_gallery/lib/demo/material/chip_demo.dart b/examples/flutter_gallery/lib/demo/material/chip_demo.dart
index 838d30b..86be8a3 100644
--- a/examples/flutter_gallery/lib/demo/material/chip_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/chip_demo.dart
@@ -23,24 +23,24 @@
@override
Widget build(BuildContext context) {
final List<Widget> chips = <Widget>[
- new Chip(
- label: new Text('Apple')
+ const Chip(
+ label: const Text('Apple')
),
new Chip(
- avatar: new CircleAvatar(child: new Text('B')),
- label: new Text('Blueberry')
+ avatar: new CircleAvatar(child: const Text('B')),
+ label: const Text('Blueberry')
),
];
if (_showBananas) {
chips.add(new Chip(
- label: new Text('Bananas'),
+ label: const Text('Bananas'),
onDeleted: _deleteBananas
));
}
return new Scaffold(
- appBar: new AppBar(title: new Text('Chips')),
+ appBar: new AppBar(title: const Text('Chips')),
body: new ListView(
children: chips.map((Widget widget) {
return new Container(
diff --git a/examples/flutter_gallery/lib/demo/material/data_table_demo.dart b/examples/flutter_gallery/lib/demo/material/data_table_demo.dart
index c2eacdf..7bfd0f7 100644
--- a/examples/flutter_gallery/lib/demo/material/data_table_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/data_table_demo.dart
@@ -164,12 +164,12 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Data tables')),
+ appBar: new AppBar(title: const Text('Data tables')),
body: new ListView(
padding: const EdgeInsets.all(20.0),
children: <Widget>[
new PaginatedDataTable(
- header: new Text('Nutrition'),
+ header: const Text('Nutrition'),
rowsPerPage: _rowsPerPage,
onRowsPerPageChanged: (int value) { setState(() { _rowsPerPage = value; }); },
sortColumnIndex: _sortColumnIndex,
@@ -177,43 +177,43 @@
onSelectAll: _dessertsDataSource._selectAll,
columns: <DataColumn>[
new DataColumn(
- label: new Text('Dessert (100g serving)'),
+ label: const Text('Dessert (100g serving)'),
onSort: (int columnIndex, bool ascending) => _sort<String>((Dessert d) => d.name, columnIndex, ascending)
),
new DataColumn(
- label: new Text('Calories'),
+ label: const Text('Calories'),
tooltip: 'The total amount of food energy in the given serving size.',
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calories, columnIndex, ascending)
),
new DataColumn(
- label: new Text('Fat (g)'),
+ label: const Text('Fat (g)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.fat, columnIndex, ascending)
),
new DataColumn(
- label: new Text('Carbs (g)'),
+ label: const Text('Carbs (g)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.carbs, columnIndex, ascending)
),
new DataColumn(
- label: new Text('Protein (g)'),
+ label: const Text('Protein (g)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.protein, columnIndex, ascending)
),
new DataColumn(
- label: new Text('Sodium (mg)'),
+ label: const Text('Sodium (mg)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.sodium, columnIndex, ascending)
),
new DataColumn(
- label: new Text('Calcium (%)'),
+ label: const Text('Calcium (%)'),
tooltip: 'The amount of calcium as a percentage of the recommended daily amount.',
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.calcium, columnIndex, ascending)
),
new DataColumn(
- label: new Text('Iron (%)'),
+ label: const Text('Iron (%)'),
numeric: true,
onSort: (int columnIndex, bool ascending) => _sort<num>((Dessert d) => d.iron, columnIndex, ascending)
),
diff --git a/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart b/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart
index 02590f8..de847c8 100644
--- a/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart
@@ -129,7 +129,7 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Date and time pickers')),
+ appBar: new AppBar(title: const Text('Date and time pickers')),
body: new DropdownButtonHideUnderline(
child: new ListView(
padding: const EdgeInsets.all(16.0),
diff --git a/examples/flutter_gallery/lib/demo/material/dialog_demo.dart b/examples/flutter_gallery/lib/demo/material/dialog_demo.dart
index 7210568..a2b17e5 100644
--- a/examples/flutter_gallery/lib/demo/material/dialog_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/dialog_demo.dart
@@ -87,13 +87,13 @@
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
- title: new Text('Dialogs')
+ title: const Text('Dialogs')
),
body: new ListView(
padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 72.0),
children: <Widget>[
new RaisedButton(
- child: new Text('ALERT'),
+ child: const Text('ALERT'),
onPressed: () {
showDemoDialog<DialogDemoAction>(
context: context,
@@ -104,11 +104,11 @@
),
actions: <Widget>[
new FlatButton(
- child: new Text('CANCEL'),
+ child: const Text('CANCEL'),
onPressed: () { Navigator.pop(context, DialogDemoAction.cancel); }
),
new FlatButton(
- child: new Text('DISCARD'),
+ child: const Text('DISCARD'),
onPressed: () { Navigator.pop(context, DialogDemoAction.discard); }
)
]
@@ -117,23 +117,23 @@
}
),
new RaisedButton(
- child: new Text('ALERT WITH TITLE'),
+ child: const Text('ALERT WITH TITLE'),
onPressed: () {
showDemoDialog<DialogDemoAction>(
context: context,
child: new AlertDialog(
- title: new Text('Use Google\'s location service?'),
+ title: const Text('Use Google\'s location service?'),
content: new Text(
_alertWithTitleText,
style: dialogTextStyle
),
actions: <Widget>[
new FlatButton(
- child: new Text('DISAGREE'),
+ child: const Text('DISAGREE'),
onPressed: () { Navigator.pop(context, DialogDemoAction.disagree); }
),
new FlatButton(
- child: new Text('AGREE'),
+ child: const Text('AGREE'),
onPressed: () { Navigator.pop(context, DialogDemoAction.agree); }
)
]
@@ -142,12 +142,12 @@
}
),
new RaisedButton(
- child: new Text('SIMPLE'),
+ child: const Text('SIMPLE'),
onPressed: () {
showDemoDialog<String>(
context: context,
child: new SimpleDialog(
- title: new Text('Set backup account'),
+ title: const Text('Set backup account'),
children: <Widget>[
new DialogDemoItem(
icon: Icons.account_circle,
@@ -172,7 +172,7 @@
}
),
new RaisedButton(
- child: new Text('CONFIRMATION'),
+ child: const Text('CONFIRMATION'),
onPressed: () {
showTimePicker(
context: context,
@@ -189,7 +189,7 @@
}
),
new RaisedButton(
- child: new Text('FULLSCREEN'),
+ child: const Text('FULLSCREEN'),
onPressed: () {
Navigator.push(context, new MaterialPageRoute<DismissDialogAction>(
builder: (BuildContext context) => new FullScreenDialogDemo(),
diff --git a/examples/flutter_gallery/lib/demo/material/drawer_demo.dart b/examples/flutter_gallery/lib/demo/material/drawer_demo.dart
index 0ed5761..b922355 100644
--- a/examples/flutter_gallery/lib/demo/material/drawer_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/drawer_demo.dart
@@ -68,7 +68,7 @@
void _showNotImplementedMessage() {
Navigator.of(context).pop(); // Dismiss the drawer.
_scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text("The drawer's items don't do anything")
+ content: const Text("The drawer's items don't do anything")
));
}
@@ -85,14 +85,14 @@
Navigator.pop(context);
},
),
- title: new Text('Navigation drawer'),
+ title: const Text('Navigation drawer'),
),
drawer: new Drawer(
child: new ListView(
children: <Widget>[
new UserAccountsDrawerHeader(
- accountName: new Text('Zach Widget'),
- accountEmail: new Text('zach.widget@example.com'),
+ accountName: const Text('Zach Widget'),
+ accountEmail: const Text('zach.widget@example.com'),
currentAccountPicture: new CircleAvatar(backgroundImage: new AssetImage(_kAsset0)),
otherAccountsPictures: <Widget>[
new CircleAvatar(backgroundImage: new AssetImage(_kAsset1)),
@@ -134,13 +134,13 @@
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
new ListTile(
- leading: new Icon(Icons.add),
- title: new Text('Add account'),
+ leading: const Icon(Icons.add),
+ title: const Text('Add account'),
onTap: _showNotImplementedMessage,
),
new ListTile(
- leading: new Icon(Icons.settings),
- title: new Text('Manage accounts'),
+ leading: const Icon(Icons.settings),
+ title: const Text('Manage accounts'),
onTap: _showNotImplementedMessage,
),
],
diff --git a/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart b/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart
index c2b21f7..197c319 100644
--- a/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart
@@ -30,8 +30,8 @@
return new AnimatedCrossFade(
firstChild: first,
secondChild: second,
- firstCurve: new Interval(0.0, 0.6, curve: Curves.fastOutSlowIn),
- secondCurve: new Interval(0.4, 1.0, curve: Curves.fastOutSlowIn),
+ firstCurve: const Interval(0.0, 0.6, curve: Curves.fastOutSlowIn),
+ secondCurve: const Interval(0.4, 1.0, curve: Curves.fastOutSlowIn),
sizeCurve: Curves.fastOutSlowIn,
crossFadeState: isExpanded ? CrossFadeState.showSecond : CrossFadeState.showFirst,
duration: const Duration(milliseconds: 200),
@@ -118,7 +118,7 @@
margin: const EdgeInsets.only(right: 8.0),
child: new FlatButton(
onPressed: onCancel,
- child: new Text('CANCEL', style: new TextStyle(
+ child: const Text('CANCEL', style: const TextStyle(
color: Colors.black54,
fontSize: 15.0,
fontWeight: FontWeight.w500
@@ -130,7 +130,7 @@
child: new FlatButton(
onPressed: onSave,
textTheme: ButtonTextTheme.accent,
- child: new Text('SAVE')
+ child: const Text('SAVE')
)
)
]
@@ -254,7 +254,7 @@
groupValue: field.value,
onChanged: field.onChanged,
),
- new Text('Bahamas')
+ const Text('Bahamas')
]
),
new Row(
@@ -265,7 +265,7 @@
groupValue: field.value,
onChanged: field.onChanged,
),
- new Text('Barbados')
+ const Text('Barbados')
]
),
new Row(
@@ -276,7 +276,7 @@
groupValue: field.value,
onChanged: field.onChanged,
),
- new Text('Bermuda')
+ const Text('Bermuda')
]
)
]
@@ -334,7 +334,7 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Expansion panels')),
+ appBar: new AppBar(title: const Text('Expansion panels')),
body: new SingleChildScrollView(
child: new Container(
margin: const EdgeInsets.all(24.0),
diff --git a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart
index a1d0f88..d4061eb 100644
--- a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart
@@ -57,7 +57,7 @@
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Text(new DateFormat('EEE, MMM d yyyy').format(date)),
- new Icon(Icons.arrow_drop_down, color: Colors.black54),
+ const Icon(Icons.arrow_drop_down, color: Colors.black54),
]
)
)
@@ -82,7 +82,7 @@
child: new Row(
children: <Widget>[
new Text('$time'),
- new Icon(Icons.arrow_drop_down, color: Colors.black54),
+ const Icon(Icons.arrow_drop_down, color: Colors.black54),
]
)
)
@@ -122,11 +122,11 @@
),
actions: <Widget>[
new FlatButton(
- child: new Text('CANCEL'),
+ child: const Text('CANCEL'),
onPressed: () { Navigator.pop(context, DismissDialogAction.cancel); }
),
new FlatButton(
- child: new Text('DISCARD'),
+ child: const Text('DISCARD'),
onPressed: () {
Navigator.of(context)
..pop(DismissDialogAction.discard) // pop the cancel/discard dialog
@@ -145,10 +145,10 @@
return new Scaffold(
appBar: new AppBar(
leading: new IconButton(
- icon: new Icon(Icons.clear),
+ icon: const Icon(Icons.clear),
onPressed: () { handleDismissButton(context); }
),
- title: new Text('New event'),
+ title: const Text('New event'),
actions: <Widget> [
new FlatButton(
child: new Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)),
@@ -222,7 +222,7 @@
});
}
),
- new Text('All-day')
+ const Text('All-day')
]
)
)
diff --git a/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart b/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart
index fd09596..a6a37ba 100644
--- a/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart
@@ -316,22 +316,22 @@
final Orientation orientation = MediaQuery.of(context).orientation;
return new Scaffold(
appBar: new AppBar(
- title: new Text('Grid list'),
+ title: const Text('Grid list'),
actions: <Widget>[
new PopupMenuButton<GridDemoTileStyle>(
onSelected: changeTileStyle,
itemBuilder: (BuildContext context) => <PopupMenuItem<GridDemoTileStyle>>[
new PopupMenuItem<GridDemoTileStyle>(
value: GridDemoTileStyle.imageOnly,
- child: new Text('Image only'),
+ child: const Text('Image only'),
),
new PopupMenuItem<GridDemoTileStyle>(
value: GridDemoTileStyle.oneLine,
- child: new Text('One line'),
+ child: const Text('One line'),
),
new PopupMenuItem<GridDemoTileStyle>(
value: GridDemoTileStyle.twoLine,
- child: new Text('Two line'),
+ child: const Text('Two line'),
),
],
),
diff --git a/examples/flutter_gallery/lib/demo/material/icons_demo.dart b/examples/flutter_gallery/lib/demo/material/icons_demo.dart
index 57f2cab..4ec2d9c 100644
--- a/examples/flutter_gallery/lib/demo/material/icons_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/icons_demo.dart
@@ -71,7 +71,7 @@
return new Scaffold(
appBar: new AppBar(
- title: new Text('Icons')
+ title: const Text('Icons')
),
body: new IconTheme(
data: new IconThemeData(opacity: iconOpacity),
diff --git a/examples/flutter_gallery/lib/demo/material/leave_behind_demo.dart b/examples/flutter_gallery/lib/demo/material/leave_behind_demo.dart
index 26d3973..72ccbc1 100644
--- a/examples/flutter_gallery/lib/demo/material/leave_behind_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/leave_behind_demo.dart
@@ -104,13 +104,13 @@
background: new Container(
color: theme.primaryColor,
child: new ListTile(
- leading: new Icon(Icons.delete, color: Colors.white, size: 36.0)
+ leading: const Icon(Icons.delete, color: Colors.white, size: 36.0)
)
),
secondaryBackground: new Container(
color: theme.primaryColor,
child: new ListTile(
- trailing: new Icon(Icons.archive, color: Colors.white, size: 36.0)
+ trailing: const Icon(Icons.archive, color: Colors.white, size: 36.0)
)
),
child: new Container(
@@ -132,30 +132,30 @@
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
- title: new Text('Swipe to dismiss'),
+ title: const Text('Swipe to dismiss'),
actions: <Widget>[
new PopupMenuButton<LeaveBehindDemoAction>(
onSelected: handleDemoAction,
itemBuilder: (BuildContext context) => <PopupMenuEntry<LeaveBehindDemoAction>>[
new PopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.reset,
- child: new Text('Reset the list')
+ child: const Text('Reset the list')
),
new PopupMenuDivider(), // ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771
new CheckedPopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.horizontalSwipe,
checked: _dismissDirection == DismissDirection.horizontal,
- child: new Text('Hoizontal swipe')
+ child: const Text('Hoizontal swipe')
),
new CheckedPopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.leftSwipe,
checked: _dismissDirection == DismissDirection.endToStart,
- child: new Text('Only swipe left')
+ child: const Text('Only swipe left')
),
new CheckedPopupMenuItem<LeaveBehindDemoAction>(
value: LeaveBehindDemoAction.rightSwipe,
checked: _dismissDirection == DismissDirection.startToEnd,
- child: new Text('Only swipe right')
+ child: const Text('Only swipe right')
)
]
)
diff --git a/examples/flutter_gallery/lib/demo/material/list_demo.dart b/examples/flutter_gallery/lib/demo/material/list_demo.dart
index 1fa98fc..17ed02f 100644
--- a/examples/flutter_gallery/lib/demo/material/list_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/list_demo.dart
@@ -37,15 +37,15 @@
void _showConfigurationSheet() {
final PersistentBottomSheetController<Null> bottomSheet = scaffoldKey.currentState.showBottomSheet((BuildContext bottomSheetContext) {
return new Container(
- decoration: new BoxDecoration(
- border: new Border(top: new BorderSide(color: Colors.black26)),
+ decoration: const BoxDecoration(
+ border: const Border(top: const BorderSide(color: Colors.black26)),
),
child: new ListView(
shrinkWrap: true,
children: <Widget>[
new ListTile(
dense: true,
- title: new Text('One-line'),
+ title: const Text('One-line'),
trailing: new Radio<MaterialListType>(
value: _showAvatars ? MaterialListType.oneLineWithAvatar : MaterialListType.oneLine,
groupValue: _itemType,
@@ -54,7 +54,7 @@
),
new ListTile(
dense: true,
- title: new Text('Two-line'),
+ title: const Text('Two-line'),
trailing: new Radio<MaterialListType>(
value: MaterialListType.twoLine,
groupValue: _itemType,
@@ -63,7 +63,7 @@
),
new ListTile(
dense: true,
- title: new Text('Three-line'),
+ title: const Text('Three-line'),
trailing: new Radio<MaterialListType>(
value: MaterialListType.threeLine,
groupValue: _itemType,
@@ -72,7 +72,7 @@
),
new ListTile(
dense: true,
- title: new Text('Show avatar'),
+ title: const Text('Show avatar'),
trailing: new Checkbox(
value: _showAvatars,
onChanged: (bool value) {
@@ -85,7 +85,7 @@
),
new ListTile(
dense: true,
- title: new Text('Show icon'),
+ title: const Text('Show icon'),
trailing: new Checkbox(
value: _showIcons,
onChanged: (bool value) {
@@ -98,7 +98,7 @@
),
new ListTile(
dense: true,
- title: new Text('Show dividers'),
+ title: const Text('Show dividers'),
trailing: new Checkbox(
value: _showDividers,
onChanged: (bool value) {
@@ -111,7 +111,7 @@
),
new ListTile(
dense: true,
- title: new Text('Dense layout'),
+ title: const Text('Dense layout'),
trailing: new Checkbox(
value: _dense,
onChanged: (bool value) {
@@ -143,9 +143,9 @@
Widget buildListTile(BuildContext context, String item) {
Widget secondary;
if (_itemType == MaterialListType.twoLine) {
- secondary = new Text("Additional item information.");
+ secondary = const Text("Additional item information.");
} else if (_itemType == MaterialListType.threeLine) {
- secondary = new Text(
+ secondary = const Text(
"Even more additional list item information appears on line three.",
);
}
@@ -186,7 +186,7 @@
title: new Text('Scrolling list\n$itemTypeText$layoutText'),
actions: <Widget>[
new IconButton(
- icon: new Icon(Icons.sort_by_alpha),
+ icon: const Icon(Icons.sort_by_alpha),
tooltip: 'Sort',
onPressed: () {
setState(() {
@@ -196,7 +196,7 @@
},
),
new IconButton(
- icon: new Icon(Icons.more_vert),
+ icon: const Icon(Icons.more_vert),
tooltip: 'Show menu',
onPressed: _bottomSheet == null ? _showConfigurationSheet : null,
),
diff --git a/examples/flutter_gallery/lib/demo/material/menu_demo.dart b/examples/flutter_gallery/lib/demo/material/menu_demo.dart
index edc04da..9a5ffad 100644
--- a/examples/flutter_gallery/lib/demo/material/menu_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/menu_demo.dart
@@ -62,22 +62,22 @@
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
- title: new Text('Menus'),
+ title: const Text('Menus'),
actions: <Widget>[
new PopupMenuButton<String>(
onSelected: showMenuSelection,
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
new PopupMenuItem<String>(
value: 'Toolbar menu',
- child: new Text('Toolbar menu')
+ child: const Text('Toolbar menu')
),
new PopupMenuItem<String>(
value: 'Right here',
- child: new Text('Right here')
+ child: const Text('Right here')
),
new PopupMenuItem<String>(
value: 'Hooray!',
- child: new Text('Hooray!')
+ child: const Text('Hooray!')
),
]
)
@@ -90,22 +90,22 @@
// a simple menu with one disabled item. Typically the contents
// of this "contextual menu" would reflect the app's state.
new ListTile(
- title: new Text('An item with a context menu button'),
+ title: const Text('An item with a context menu button'),
trailing: new PopupMenuButton<String>(
padding: EdgeInsets.zero,
onSelected: showMenuSelection,
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
new PopupMenuItem<String>(
value: _simpleValue1,
- child: new Text('Context menu item one')
+ child: const Text('Context menu item one')
),
new PopupMenuItem<String>(
enabled: false,
- child: new Text('A disabled menu item')
+ child: const Text('A disabled menu item')
),
new PopupMenuItem<String>(
value: _simpleValue3,
- child: new Text('Context menu item three')
+ child: const Text('Context menu item three')
),
]
)
@@ -114,7 +114,7 @@
// a menu whose items have text labels and icons and a divider
// That separates the first three items from the last one.
new ListTile(
- title: new Text('An item with a sectioned menu'),
+ title: const Text('An item with a sectioned menu'),
trailing: new PopupMenuButton<String>(
padding: EdgeInsets.zero,
onSelected: showMenuSelection,
@@ -122,30 +122,30 @@
new PopupMenuItem<String>(
value: 'Preview',
child: new ListTile(
- leading: new Icon(Icons.visibility),
- title: new Text('Preview')
+ leading: const Icon(Icons.visibility),
+ title: const Text('Preview')
)
),
new PopupMenuItem<String>(
value: 'Share',
child: new ListTile(
- leading: new Icon(Icons.person_add),
- title: new Text('Share')
+ leading: const Icon(Icons.person_add),
+ title: const Text('Share')
)
),
new PopupMenuItem<String>(
value: 'Get Link',
child: new ListTile(
- leading: new Icon(Icons.link),
- title: new Text('Get link')
+ leading: const Icon(Icons.link),
+ title: const Text('Get link')
)
),
new PopupMenuDivider(), // ignore: list_element_type_not_assignable, https://github.com/flutter/flutter/issues/5771
new PopupMenuItem<String>(
value: 'Remove',
child: new ListTile(
- leading: new Icon(Icons.delete),
- title: new Text('Remove')
+ leading: const Icon(Icons.delete),
+ title: const Text('Remove')
)
)
]
@@ -159,7 +159,7 @@
initialValue: _simpleValue,
onSelected: showMenuSelection,
child: new ListTile(
- title: new Text('An item with a simple menu'),
+ title: const Text('An item with a simple menu'),
subtitle: new Text(_simpleValue)
),
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
@@ -180,7 +180,7 @@
// Pressing the PopupMenuButton on the right of this item shows a menu
// whose items have checked icons that reflect this app's state.
new ListTile(
- title: new Text('An item with a checklist menu'),
+ title: const Text('An item with a checklist menu'),
trailing: new PopupMenuButton<String>(
padding: EdgeInsets.zero,
onSelected: showCheckedMenuSelections,
diff --git a/examples/flutter_gallery/lib/demo/material/modal_bottom_sheet_demo.dart b/examples/flutter_gallery/lib/demo/material/modal_bottom_sheet_demo.dart
index c0eee71..ec1540a 100644
--- a/examples/flutter_gallery/lib/demo/material/modal_bottom_sheet_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/modal_bottom_sheet_demo.dart
@@ -10,10 +10,10 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Modal bottom sheet')),
+ appBar: new AppBar(title: const Text('Modal bottom sheet')),
body: new Center(
child: new RaisedButton(
- child: new Text('SHOW BOTTOM SHEET'),
+ child: const Text('SHOW BOTTOM SHEET'),
onPressed: () {
showModalBottomSheet<Null>(context: context, builder: (BuildContext context) {
return new Container(
diff --git a/examples/flutter_gallery/lib/demo/material/overscroll_demo.dart b/examples/flutter_gallery/lib/demo/material/overscroll_demo.dart
index 21ff0a7..d1cde79 100644
--- a/examples/flutter_gallery/lib/demo/material/overscroll_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/overscroll_demo.dart
@@ -29,7 +29,7 @@
new Timer(const Duration(seconds: 3), () { completer.complete(null); });
return completer.future.then((_) {
_scaffoldKey.currentState?.showSnackBar(new SnackBar(
- content: new Text("Refresh complete"),
+ content: const Text("Refresh complete"),
action: new SnackBarAction(
label: 'RETRY',
onPressed: () {
@@ -45,10 +45,10 @@
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
- title: new Text('Pull to refresh'),
+ title: const Text('Pull to refresh'),
actions: <Widget>[
new IconButton(
- icon: new Icon(Icons.refresh),
+ icon: const Icon(Icons.refresh),
tooltip: 'Refresh',
onPressed: () {
_refreshIndicatorKey.currentState.show();
@@ -68,7 +68,7 @@
isThreeLine: true,
leading: new CircleAvatar(child: new Text(item)),
title: new Text('This item represents $item.'),
- subtitle: new Text('Even more additional list item information appears on line three.'),
+ subtitle: const Text('Even more additional list item information appears on line three.'),
);
},
),
diff --git a/examples/flutter_gallery/lib/demo/material/page_selector_demo.dart b/examples/flutter_gallery/lib/demo/material/page_selector_demo.dart
index daf23ec..a6fd74c 100644
--- a/examples/flutter_gallery/lib/demo/material/page_selector_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/page_selector_demo.dart
@@ -26,14 +26,14 @@
child: new Row(
children: <Widget>[
new IconButton(
- icon: new Icon(Icons.chevron_left),
+ icon: const Icon(Icons.chevron_left),
color: color,
onPressed: () { _handleArrowButtonPress(context, -1); },
tooltip: 'Page back'
),
new TabPageSelector(controller: controller),
new IconButton(
- icon: new Icon(Icons.chevron_right),
+ icon: const Icon(Icons.chevron_right),
color: color,
onPressed: () { _handleArrowButtonPress(context, 1); },
tooltip: 'Page forward'
@@ -76,7 +76,7 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Page selector')),
+ appBar: new AppBar(title: const Text('Page selector')),
body: new DefaultTabController(
length: icons.length,
child: new _PageSelector(icons: icons),
diff --git a/examples/flutter_gallery/lib/demo/material/persistent_bottom_sheet_demo.dart b/examples/flutter_gallery/lib/demo/material/persistent_bottom_sheet_demo.dart
index 53bca99..1f2d553 100644
--- a/examples/flutter_gallery/lib/demo/material/persistent_bottom_sheet_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/persistent_bottom_sheet_demo.dart
@@ -57,11 +57,11 @@
showDialog<Null>(
context: context,
child: new AlertDialog(
- content: new Text('You tapped the floating action button.'),
+ content: const Text('You tapped the floating action button.'),
actions: <Widget>[
new FlatButton(
onPressed: () { Navigator.pop(context); },
- child: new Text('OK')
+ child: const Text('OK')
)
]
)
@@ -72,16 +72,16 @@
Widget build(BuildContext context) {
return new Scaffold(
key: _scaffoldKey,
- appBar: new AppBar(title: new Text('Persistent bottom sheet')),
+ appBar: new AppBar(title: const Text('Persistent bottom sheet')),
floatingActionButton: new FloatingActionButton(
onPressed: _showMessage,
backgroundColor: Colors.redAccent,
- child: new Icon(Icons.add)
+ child: const Icon(Icons.add)
),
body: new Center(
child: new RaisedButton(
onPressed: _showBottomSheetCallback,
- child: new Text('SHOW BOTTOM SHEET')
+ child: const Text('SHOW BOTTOM SHEET')
)
)
);
diff --git a/examples/flutter_gallery/lib/demo/material/progress_indicator_demo.dart b/examples/flutter_gallery/lib/demo/material/progress_indicator_demo.dart
index d514d6d..4b55eed 100644
--- a/examples/flutter_gallery/lib/demo/material/progress_indicator_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/progress_indicator_demo.dart
@@ -25,7 +25,7 @@
_animation = new CurvedAnimation(
parent: _controller,
- curve: new Interval(0.0, 0.9, curve: Curves.fastOutSlowIn),
+ curve: const Interval(0.0, 0.9, curve: Curves.fastOutSlowIn),
reverseCurve: Curves.fastOutSlowIn
)..addStatusListener((AnimationStatus status) {
if (status == AnimationStatus.dismissed)
@@ -99,7 +99,7 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Progress indicators')),
+ appBar: new AppBar(title: const Text('Progress indicators')),
body: new Center(
child: new SingleChildScrollView(
child: new DefaultTextStyle(
diff --git a/examples/flutter_gallery/lib/demo/material/scrollable_tabs_demo.dart b/examples/flutter_gallery/lib/demo/material/scrollable_tabs_demo.dart
index 2e4901c..54213d6 100644
--- a/examples/flutter_gallery/lib/demo/material/scrollable_tabs_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/scrollable_tabs_demo.dart
@@ -59,22 +59,22 @@
final Color iconColor = Theme.of(context).accentColor;
return new Scaffold(
appBar: new AppBar(
- title: new Text('Scrollable tabs'),
+ title: const Text('Scrollable tabs'),
actions: <Widget>[
new PopupMenuButton<TabsDemoStyle>(
onSelected: changeDemoStyle,
itemBuilder: (BuildContext context) => <PopupMenuItem<TabsDemoStyle>>[
new PopupMenuItem<TabsDemoStyle>(
value: TabsDemoStyle.iconsAndText,
- child: new Text('Icons and text')
+ child: const Text('Icons and text')
),
new PopupMenuItem<TabsDemoStyle>(
value: TabsDemoStyle.iconsOnly,
- child: new Text('Icons only')
+ child: const Text('Icons only')
),
new PopupMenuItem<TabsDemoStyle>(
value: TabsDemoStyle.textOnly,
- child: new Text('Text only')
+ child: const Text('Text only')
),
],
),
diff --git a/examples/flutter_gallery/lib/demo/material/slider_demo.dart b/examples/flutter_gallery/lib/demo/material/slider_demo.dart
index 41d142a..acd8d00 100644
--- a/examples/flutter_gallery/lib/demo/material/slider_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/slider_demo.dart
@@ -18,7 +18,7 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Sliders')),
+ appBar: new AppBar(title: const Text('Sliders')),
body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@@ -37,14 +37,14 @@
});
}
),
- new Text('Continuous'),
+ const Text('Continuous'),
]
),
new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget> [
new Slider(value: 0.25, thumbOpenAtMin: true, onChanged: null),
- new Text('Disabled'),
+ const Text('Disabled'),
]
),
new Column(
@@ -63,7 +63,7 @@
});
}
),
- new Text('Discrete'),
+ const Text('Discrete'),
],
),
],
diff --git a/examples/flutter_gallery/lib/demo/material/snack_bar_demo.dart b/examples/flutter_gallery/lib/demo/material/snack_bar_demo.dart
index e78d255..b843b80 100644
--- a/examples/flutter_gallery/lib/demo/material/snack_bar_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/snack_bar_demo.dart
@@ -32,11 +32,11 @@
return new ListView(
padding: const EdgeInsets.all(24.0),
children: <Widget>[
- new Text(_text1),
- new Text(_text2),
+ const Text(_text1),
+ const Text(_text2),
new Center(
child: new RaisedButton(
- child: new Text('SHOW A SNACKBAR'),
+ child: const Text('SHOW A SNACKBAR'),
onPressed: () {
final int thisSnackBarIndex = _snackBarIndex++;
Scaffold.of(context).showSnackBar(new SnackBar(
@@ -53,7 +53,7 @@
}
)
),
- new Text(_text3),
+ const Text(_text3),
]
.map((Widget child) {
return new Container(
@@ -69,7 +69,7 @@
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
- title: new Text('Snackbar')
+ title: const Text('Snackbar')
),
body: new Builder(
// Create an inner BuildContext so that the snackBar onPressed methods
diff --git a/examples/flutter_gallery/lib/demo/material/tabs_demo.dart b/examples/flutter_gallery/lib/demo/material/tabs_demo.dart
index f229953..d93c7ca 100644
--- a/examples/flutter_gallery/lib/demo/material/tabs_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/tabs_demo.dart
@@ -120,7 +120,7 @@
length: _allPages.length,
child: new Scaffold(
appBar: new AppBar(
- title: new Text('Tabs and scrolling'),
+ title: const Text('Tabs and scrolling'),
bottom: new TabBar(
tabs: _allPages.keys.map((_Page page) => new Tab(text: page.label)).toList(),
),
diff --git a/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart b/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart
index e9575e9..018be79 100644
--- a/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart
@@ -106,7 +106,7 @@
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
- title: new Text('FAB per tab'),
+ title: const Text('FAB per tab'),
bottom: new TabBar(
controller: _controller,
tabs: _allPages.map((_Page page) => new Tab(text: page.label.toUpperCase())).toList(),
diff --git a/examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart b/examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart
index 2b0e5cd..bac851a 100644
--- a/examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart
@@ -83,15 +83,15 @@
return await showDialog<bool>(
context: context,
child: new AlertDialog(
- title: new Text('This form has errors'),
- content: new Text('Really leave this form?'),
+ title: const Text('This form has errors'),
+ content: const Text('Really leave this form?'),
actions: <Widget> [
new FlatButton(
- child: new Text('YES'),
+ child: const Text('YES'),
onPressed: () { Navigator.of(context).pop(true); },
),
new FlatButton(
- child: new Text('NO'),
+ child: const Text('NO'),
onPressed: () { Navigator.of(context).pop(false); },
),
],
@@ -104,7 +104,7 @@
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
- title: new Text('Text fields'),
+ title: const Text('Text fields'),
),
body: new Form(
key: _formKey,
@@ -170,7 +170,7 @@
padding: const EdgeInsets.all(20.0),
alignment: const FractionalOffset(0.5, 0.5),
child: new RaisedButton(
- child: new Text('SUBMIT'),
+ child: const Text('SUBMIT'),
onPressed: _handleSubmitted,
),
),
diff --git a/examples/flutter_gallery/lib/demo/material/tooltip_demo.dart b/examples/flutter_gallery/lib/demo/material/tooltip_demo.dart
index 84c3c0d..a6d025d 100644
--- a/examples/flutter_gallery/lib/demo/material/tooltip_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/tooltip_demo.dart
@@ -18,7 +18,7 @@
final ThemeData theme = Theme.of(context);
return new Scaffold(
appBar: new AppBar(
- title: new Text('Tooltips')
+ title: const Text('Tooltips')
),
body: new Builder(
builder: (BuildContext context) {
@@ -42,12 +42,12 @@
new Center(
child: new IconButton(
iconSize: 48.0,
- icon: new Icon(Icons.call),
+ icon: const Icon(Icons.call),
color: theme.iconTheme.color,
tooltip: 'Place a phone call',
onPressed: () {
Scaffold.of(context).showSnackBar(new SnackBar(
- content: new Text('That was an ordinary tap.')
+ content: const Text('That was an ordinary tap.')
));
}
)
diff --git a/examples/flutter_gallery/lib/demo/material/two_level_list_demo.dart b/examples/flutter_gallery/lib/demo/material/two_level_list_demo.dart
index 2307926..d152173 100644
--- a/examples/flutter_gallery/lib/demo/material/two_level_list_demo.dart
+++ b/examples/flutter_gallery/lib/demo/material/two_level_list_demo.dart
@@ -10,23 +10,23 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Expand/collapse list control')),
+ appBar: new AppBar(title: const Text('Expand/collapse list control')),
body: new TwoLevelList(
type: MaterialListType.oneLine,
children: <Widget>[
- new TwoLevelListItem(title: new Text('Top')),
+ new TwoLevelListItem(title: const Text('Top')),
new TwoLevelSublist(
- title: new Text('Sublist'),
+ title: const Text('Sublist'),
backgroundColor: Theme.of(context).accentColor.withOpacity(0.025),
children: <Widget>[
- new TwoLevelListItem(title: new Text('One')),
- new TwoLevelListItem(title: new Text('Two')),
+ new TwoLevelListItem(title: const Text('One')),
+ new TwoLevelListItem(title: const Text('Two')),
// https://en.wikipedia.org/wiki/Free_Four
- new TwoLevelListItem(title: new Text('Free')),
- new TwoLevelListItem(title: new Text('Four'))
+ new TwoLevelListItem(title: const Text('Free')),
+ new TwoLevelListItem(title: const Text('Four'))
]
),
- new TwoLevelListItem(title: new Text('Bottom'))
+ new TwoLevelListItem(title: const Text('Bottom'))
]
)
);
diff --git a/examples/flutter_gallery/lib/demo/pesto_demo.dart b/examples/flutter_gallery/lib/demo/pesto_demo.dart
index b0cb6f4..f6ce4db 100644
--- a/examples/flutter_gallery/lib/demo/pesto_demo.dart
+++ b/examples/flutter_gallery/lib/demo/pesto_demo.dart
@@ -82,10 +82,10 @@
child: new Scaffold(
key: scaffoldKey,
floatingActionButton: new FloatingActionButton(
- child: new Icon(Icons.edit),
+ child: const Icon(Icons.edit),
onPressed: () {
scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('Not supported.'),
+ content: const Text('Not supported.'),
));
},
),
@@ -105,11 +105,11 @@
expandedHeight: _kAppBarHeight,
actions: <Widget>[
new IconButton(
- icon: new Icon(Icons.search),
+ icon: const Icon(Icons.search),
tooltip: 'Search',
onPressed: () {
scaffoldKey.currentState.showSnackBar(new SnackBar(
- content: new Text('Not supported.'),
+ content: const Text('Not supported.'),
));
},
),
diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_order.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
index c7f5a1f..a53d702 100644
--- a/examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
+++ b/examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
@@ -181,7 +181,7 @@
),
new LayoutId(
id: _HeadingLayout.icon,
- child: new Icon(
+ child: const Icon(
Icons.info_outline,
size: 24.0,
color: const Color(0xFFFFE0E0),
@@ -275,7 +275,7 @@
);
},
backgroundColor: const Color(0xFF16F0F0),
- child: new Icon(
+ child: const Icon(
Icons.add_shopping_cart,
color: Colors.black,
),
diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_page.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
index be90c77..467bf1f 100644
--- a/examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
+++ b/examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
@@ -54,9 +54,9 @@
void _showShoppingCart() {
showModalBottomSheet<Null>(context: context, builder: (BuildContext context) {
if (config.shoppingCart.isEmpty) {
- return new Padding(
+ return const Padding(
padding: const EdgeInsets.all(24.0),
- child: new Text('The shopping cart is empty')
+ child: const Text('The shopping cart is empty')
);
}
return new ListView(
@@ -82,7 +82,7 @@
void _emptyCart() {
config.shoppingCart.clear();
- config.scaffoldKey.currentState.showSnackBar(new SnackBar(content: new Text('Shopping cart is empty')));
+ config.scaffoldKey.currentState.showSnackBar(new SnackBar(content: const Text('Shopping cart is empty')));
}
@override
@@ -107,7 +107,7 @@
),
actions: <Widget>[
new IconButton(
- icon: new Icon(Icons.shopping_cart),
+ icon: const Icon(Icons.shopping_cart),
tooltip: 'Shopping cart',
onPressed: _showShoppingCart
),
@@ -115,15 +115,15 @@
itemBuilder: (BuildContext context) => <PopupMenuItem<ShrineAction>>[
new PopupMenuItem<ShrineAction>(
value: ShrineAction.sortByPrice,
- child: new Text('Sort by price')
+ child: const Text('Sort by price')
),
new PopupMenuItem<ShrineAction>(
value: ShrineAction.sortByProduct,
- child: new Text('Sort by product')
+ child: const Text('Sort by product')
),
new PopupMenuItem<ShrineAction>(
value: ShrineAction.emptyCart,
- child: new Text('Empty shopping cart')
+ child: const Text('Empty shopping cart')
)
],
onSelected: (ShrineAction action) {
diff --git a/examples/flutter_gallery/lib/demo/typography_demo.dart b/examples/flutter_gallery/lib/demo/typography_demo.dart
index 33b947c..da6e34f 100644
--- a/examples/flutter_gallery/lib/demo/typography_demo.dart
+++ b/examples/flutter_gallery/lib/demo/typography_demo.dart
@@ -71,7 +71,7 @@
}
return new Scaffold(
- appBar: new AppBar(title: new Text('Typography')),
+ appBar: new AppBar(title: const Text('Typography')),
body: new ListView(children: styleItems)
);
}
diff --git a/examples/flutter_gallery/lib/gallery/demo.dart b/examples/flutter_gallery/lib/gallery/demo.dart
index 047b4c7..9099c14 100644
--- a/examples/flutter_gallery/lib/gallery/demo.dart
+++ b/examples/flutter_gallery/lib/gallery/demo.dart
@@ -61,7 +61,7 @@
new Builder(
builder: (BuildContext context) {
return new IconButton(
- icon: new Icon(Icons.description),
+ icon: const Icon(Icons.description),
tooltip: 'Show example code',
onPressed: () {
_showExampleCode(context);
@@ -150,10 +150,10 @@
return new Scaffold(
appBar: new AppBar(
leading: new IconButton(
- icon: new Icon(Icons.clear),
+ icon: const Icon(Icons.clear),
onPressed: () { Navigator.pop(context); }
),
- title: new Text('Example code')
+ title: const Text('Example code')
),
body: body
);
diff --git a/examples/flutter_gallery/lib/gallery/drawer.dart b/examples/flutter_gallery/lib/gallery/drawer.dart
index 098b840..0e2d138 100644
--- a/examples/flutter_gallery/lib/gallery/drawer.dart
+++ b/examples/flutter_gallery/lib/gallery/drawer.dart
@@ -127,8 +127,8 @@
final TextStyle linkStyle = themeData.textTheme.body2.copyWith(color: themeData.accentColor);
final Widget lightThemeItem = new ListTile(
- leading: new Icon(Icons.brightness_5),
- title: new Text('Light'),
+ leading: const Icon(Icons.brightness_5),
+ title: const Text('Light'),
trailing: new Radio<bool>(
value: true,
groupValue: useLightTheme,
@@ -141,8 +141,8 @@
);
final Widget darkThemeItem = new ListTile(
- leading: new Icon(Icons.brightness_7),
- title: new Text('Dark'),
+ leading: const Icon(Icons.brightness_7),
+ title: const Text('Dark'),
trailing: new Radio<bool>(
value: false,
groupValue: useLightTheme,
@@ -157,7 +157,7 @@
final Widget mountainViewItem = new ListTile(
// on iOS, we don't want to show an Android phone icon
leading: new Icon(defaultTargetPlatform == TargetPlatform.iOS ? Icons.star : Icons.phone_android),
- title: new Text('Android'),
+ title: const Text('Android'),
trailing: new Radio<TargetPlatform>(
value: TargetPlatform.android,
groupValue: Theme.of(context).platform,
@@ -172,7 +172,7 @@
final Widget cupertinoItem = new ListTile(
// on iOS, we don't want to show the iPhone icon
leading: new Icon(defaultTargetPlatform == TargetPlatform.iOS ? Icons.star_border : Icons.phone_iphone),
- title: new Text('iOS'),
+ title: const Text('iOS'),
trailing: new Radio<TargetPlatform>(
value: TargetPlatform.iOS,
groupValue: Theme.of(context).platform,
@@ -185,8 +185,8 @@
);
final Widget animateSlowlyItem = new ListTile(
- leading: new Icon(Icons.hourglass_empty),
- title: new Text('Animate Slowly'),
+ leading: const Icon(Icons.hourglass_empty),
+ title: const Text('Animate Slowly'),
trailing: new Checkbox(
value: timeDilation != 1.0,
onChanged: (bool value) {
@@ -200,8 +200,8 @@
);
final Widget sendFeedbackItem = new ListTile(
- leading: new Icon(Icons.report),
- title: new Text('Send feedback'),
+ leading: const Icon(Icons.report),
+ title: const Text('Send feedback'),
onTap: onSendFeedback ?? () {
UrlLauncher.launch('https://github.com/flutter/flutter/issues/new');
},
@@ -266,8 +266,8 @@
if (onShowPerformanceOverlayChanged != null) {
allDrawerItems.insert(8, new ListTile(
- leading: new Icon(Icons.assessment),
- title: new Text('Performance Overlay'),
+ leading: const Icon(Icons.assessment),
+ title: const Text('Performance Overlay'),
trailing: new Checkbox(
value: showPerformanceOverlay,
onChanged: (bool value) {
@@ -283,8 +283,8 @@
if (onCheckerboardRasterCacheImagesChanged != null) {
allDrawerItems.insert(8, new ListTile(
- leading: new Icon(Icons.assessment),
- title: new Text('Checkerboard Raster Cache Images'),
+ leading: const Icon(Icons.assessment),
+ title: const Text('Checkerboard Raster Cache Images'),
trailing: new Checkbox(
value: checkerboardRasterCacheImages,
onChanged: (bool value) {
diff --git a/examples/flutter_gallery/lib/gallery/example_code.dart b/examples/flutter_gallery/lib/gallery/example_code.dart
index 42ec4f3..f594f61 100644
--- a/examples/flutter_gallery/lib/gallery/example_code.dart
+++ b/examples/flutter_gallery/lib/gallery/example_code.dart
@@ -16,7 +16,7 @@
// START buttons_raised
// Create a raised button.
new RaisedButton(
- child: new Text('BUTTON TITLE'),
+ child: const Text('BUTTON TITLE'),
onPressed: () {
// Perform some action
}
@@ -26,7 +26,7 @@
// Buttons are disabled when onPressed isn't
// specified or is null.
new RaisedButton(
- child: new Text('BUTTON TITLE'),
+ child: const Text('BUTTON TITLE'),
onPressed: null
);
// END
@@ -35,7 +35,7 @@
// START buttons_flat
// Create a flat button.
new FlatButton(
- child: new Text('BUTTON TITLE'),
+ child: const Text('BUTTON TITLE'),
onPressed: () {
// Perform some action
}
@@ -45,7 +45,7 @@
// Buttons are disabled when onPressed isn't
// specified or is null.
new FlatButton(
- child: new Text('BUTTON TITLE'),
+ child: const Text('BUTTON TITLE'),
onPressed: null
);
// END
@@ -83,7 +83,7 @@
// Toggleable icon button.
new IconButton(
- icon: new Icon(Icons.thumb_up),
+ icon: const Icon(Icons.thumb_up),
onPressed: () {
setState(() => value = !value);
},
@@ -96,10 +96,10 @@
// Floating action button in Scaffold.
new Scaffold(
appBar: new AppBar(
- title: new Text('Demo')
+ title: const Text('Demo')
),
- floatingActionButton: new FloatingActionButton(
- child: new Icon(Icons.add),
+ floatingActionButton: const FloatingActionButton(
+ child: const Icon(Icons.add),
onPressed: null
)
);
diff --git a/examples/flutter_gallery/lib/gallery/home.dart b/examples/flutter_gallery/lib/gallery/home.dart
index 6177529..adeace8 100644
--- a/examples/flutter_gallery/lib/gallery/home.dart
+++ b/examples/flutter_gallery/lib/gallery/home.dart
@@ -170,7 +170,7 @@
pinned: true,
expandedHeight: _kFlexibleSpaceMaxHeight,
flexibleSpace: new FlexibleSpaceBar(
- title: new Text('Flutter Gallery'),
+ title: const Text('Flutter Gallery'),
// TODO(abarth): Wire up to the parallax in a way that doesn't pop during hero transition.
background: new _AppBarBackground(animation: kAlwaysDismissedAnimation),
),
@@ -194,7 +194,7 @@
home,
new FadeTransition(
opacity: new CurvedAnimation(parent: _controller, curve: Curves.easeInOut),
- child: new Banner(
+ child: const Banner(
message: 'PREVIEW',
location: BannerLocation.topRight,
)
diff --git a/examples/flutter_gallery/lib/gallery/updates.dart b/examples/flutter_gallery/lib/gallery/updates.dart
index e46c5b9..fcc110d 100644
--- a/examples/flutter_gallery/lib/gallery/updates.dart
+++ b/examples/flutter_gallery/lib/gallery/updates.dart
@@ -51,16 +51,16 @@
final TextStyle dialogTextStyle =
theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color);
return new AlertDialog(
- title: new Text('Update Flutter Gallery?'),
+ title: const Text('Update Flutter Gallery?'),
content: new Text('A newer version is available.', style: dialogTextStyle),
actions: <Widget>[
new FlatButton(
- child: new Text('NO THANKS'),
+ child: const Text('NO THANKS'),
onPressed: () {
Navigator.pop(context, false);
}),
new FlatButton(
- child: new Text('UPDATE'),
+ child: const Text('UPDATE'),
onPressed: () {
Navigator.pop(context, true);
}),