Constants! Constants everywhere! (#9286)
Aggressively apply the const lint.
diff --git a/dev/automated_tests/flutter_test/test_async_utils_guarded_test.dart b/dev/automated_tests/flutter_test/test_async_utils_guarded_test.dart
index dad8053..f04a139 100644
--- a/dev/automated_tests/flutter_test/test_async_utils_guarded_test.dart
+++ b/dev/automated_tests/flutter_test/test_async_utils_guarded_test.dart
@@ -14,7 +14,7 @@
Future<Null> guardedHelper(WidgetTester tester) {
return TestAsyncUtils.guard(() async {
- await tester.pumpWidget(new Text('Hello'));
+ await tester.pumpWidget(const Text('Hello'));
});
}
diff --git a/dev/benchmarks/complex_layout/lib/main.dart b/dev/benchmarks/complex_layout/lib/main.dart
index 9ce2923..10dd53f 100644
--- a/dev/benchmarks/complex_layout/lib/main.dart
+++ b/dev/benchmarks/complex_layout/lib/main.dart
@@ -57,7 +57,7 @@
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
- title: new Text('Advanced Layout'),
+ title: const Text('Advanced Layout'),
actions: <Widget>[
new IconButton(
icon: new Icon(Icons.create),
@@ -356,9 +356,9 @@
class ItemDescription extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return new Padding(
+ return const Padding(
padding: const EdgeInsets.all(8.0),
- child: new Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')
+ child: const Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.')
);
}
}
@@ -579,7 +579,7 @@
new FancyDrawerHeader(),
new ListTile(
leading: new Icon(Icons.brightness_5),
- title: new Text('Light'),
+ title: const Text('Light'),
onTap: () { _changeTheme(context, true); },
selected: ComplexLayoutApp.of(context).lightTheme,
trailing: new Radio<bool>(
@@ -590,7 +590,7 @@
),
new ListTile(
leading: new Icon(Icons.brightness_7),
- title: new Text('Dark'),
+ title: const Text('Dark'),
onTap: () { _changeTheme(context, false); },
selected: !ComplexLayoutApp.of(context).lightTheme,
trailing: new Radio<bool>(
@@ -602,7 +602,7 @@
new Divider(),
new ListTile(
leading: new Icon(Icons.hourglass_empty),
- title: new Text('Animate Slowly'),
+ title: const Text('Animate Slowly'),
selected: timeDilation != 1.0,
onTap: () { ComplexLayoutApp.of(context).toggleAnimationSpeed(); },
trailing: new Checkbox(
diff --git a/dev/devicelab/lib/framework/utils.dart b/dev/devicelab/lib/framework/utils.dart
index 509ea9c..06de108 100644
--- a/dev/devicelab/lib/framework/utils.dart
+++ b/dev/devicelab/lib/framework/utils.dart
@@ -15,7 +15,7 @@
String cwd = Directory.current.path;
List<ProcessInfo> _runningProcesses = <ProcessInfo>[];
-ProcessManager _processManager = new LocalProcessManager();
+ProcessManager _processManager = const LocalProcessManager();
class ProcessInfo {
ProcessInfo(this.command, this.process);
diff --git a/dev/devicelab/test/run_test.dart b/dev/devicelab/test/run_test.dart
index a2b03149..db11eb7 100644
--- a/dev/devicelab/test/run_test.dart
+++ b/dev/devicelab/test/run_test.dart
@@ -10,7 +10,7 @@
import 'package:test/test.dart';
void main() {
- final ProcessManager processManager = new LocalProcessManager();
+ final ProcessManager processManager = const LocalProcessManager();
group('run.dart script', () {
Future<int> runScript(List<String> testNames) async {
diff --git a/dev/manual_tests/card_collection.dart b/dev/manual_tests/card_collection.dart
index d0c303d..49310fa 100644
--- a/dev/manual_tests/card_collection.dart
+++ b/dev/manual_tests/card_collection.dart
@@ -88,7 +88,7 @@
data: const IconThemeData(color: Colors.black),
child: new ListView(
children: <Widget>[
- new DrawerHeader(child: new Center(child: new Text('Options'))),
+ const DrawerHeader(child: const Center(child: const Text('Options'))),
buildDrawerCheckbox("Make card labels editable", _editable, _toggleEditable),
buildDrawerCheckbox("Fixed size cards", _fixedSizeCards, _toggleFixedSizeCards),
buildDrawerCheckbox("Let the sun shine", _sunshine, _toggleSunshine),
@@ -110,7 +110,7 @@
new ListTile(
leading: new Icon(Icons.dvr),
onTap: () { debugDumpApp(); debugDumpRenderTree(); },
- title: new Text('Dump App to Console'),
+ title: const Text('Dump App to Console'),
),
],
),
diff --git a/dev/manual_tests/drag_and_drop.dart b/dev/manual_tests/drag_and_drop.dart
index 94203c4..6a28a9d 100644
--- a/dev/manual_tests/drag_and_drop.dart
+++ b/dev/manual_tests/drag_and_drop.dart
@@ -42,7 +42,7 @@
}
class Dot extends StatefulWidget {
- Dot({ Key key, this.color, this.size, this.child, this.tappable: false }) : super(key: key);
+ const Dot({ Key key, this.color, this.size, this.child, this.tappable: false }) : super(key: key);
final Color color;
final double size;
@@ -193,13 +193,13 @@
color: Colors.blue.shade700,
size: kBallSize,
tappable: true,
- child: new Center(child: new Text('BALL'))
+ child: const Center(child: const Text('BALL'))
)
);
final Widget dashedBall = new Container(
width: kBallSize,
height: kBallSize,
- child: new CustomPaint(
+ child: const CustomPaint(
painter: const DashOutlineCirclePainter()
)
);
@@ -238,7 +238,7 @@
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
- title: new Text('Drag and Drop Flutter Demo')
+ title: const Text('Drag and Drop Flutter Demo')
),
body: new Column(
children: <Widget>[
@@ -251,19 +251,19 @@
color: Colors.yellow.shade300,
under: true,
heavy: false,
- child: new Text('under')
+ child: const Text('under')
),
new ExampleDragSource(
color: Colors.green.shade300,
under: false,
heavy: true,
- child: new Text('long-press above')
+ child: const Text('long-press above')
),
new ExampleDragSource(
color: Colors.indigo.shade300,
under: false,
heavy: false,
- child: new Text('above')
+ child: const Text('above')
),
],
)
diff --git a/dev/manual_tests/material_arc.dart b/dev/manual_tests/material_arc.dart
index ed4e596..bdc23c3 100644
--- a/dev/manual_tests/material_arc.dart
+++ b/dev/manual_tests/material_arc.dart
@@ -444,7 +444,7 @@
length: _allDemos.length,
child: new Scaffold(
appBar: new AppBar(
- title: new Text('Animation'),
+ title: const Text('Animation'),
bottom: new TabBar(
tabs: _allDemos.map((_ArcDemo demo) => new Tab(text: demo.title)).toList(),
),
diff --git a/dev/manual_tests/overlay_geometry.dart b/dev/manual_tests/overlay_geometry.dart
index e5dd37b..2b9b194 100644
--- a/dev/manual_tests/overlay_geometry.dart
+++ b/dev/manual_tests/overlay_geometry.dart
@@ -181,7 +181,7 @@
Widget build(BuildContext context) {
final List<Widget> layers = <Widget>[
new Scaffold(
- appBar: new AppBar(title: new Text('Tap a Card')),
+ appBar: new AppBar(title: const Text('Tap a Card')),
body: new Container(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
child: new NotificationListener<ScrollNotification>(
diff --git a/dev/manual_tests/page_view.dart b/dev/manual_tests/page_view.dart
index f7cc6b8..0c9152c 100644
--- a/dev/manual_tests/page_view.dart
+++ b/dev/manual_tests/page_view.dart
@@ -84,22 +84,22 @@
return new Drawer(
child: new ListView(
children: <Widget>[
- new DrawerHeader(child: new Center(child: new Text('Options'))),
+ const DrawerHeader(child: const Center(child: const Text('Options'))),
new ListTile(
leading: new Icon(Icons.more_horiz),
selected: scrollDirection == Axis.horizontal,
- trailing: new Text('Horizontal Layout'),
+ trailing: const Text('Horizontal Layout'),
onTap: switchScrollDirection,
),
new ListTile(
leading: new Icon(Icons.more_vert),
selected: scrollDirection == Axis.vertical,
- trailing: new Text('Vertical Layout'),
+ trailing: const Text('Vertical Layout'),
onTap: switchScrollDirection,
),
new ListTile(
onTap: toggleItemsWrap,
- title: new Text('Scrolling wraps around'),
+ title: const Text('Scrolling wraps around'),
// TODO(abarth): Actually make this checkbox change this value.
trailing: new Checkbox(value: itemsWrap, onChanged: null),
),
@@ -110,7 +110,7 @@
Widget _buildAppBar() {
return new AppBar(
- title: new Text('PageView'),
+ title: const Text('PageView'),
actions: <Widget>[
new Text(scrollDirection == Axis.horizontal ? "horizontal" : "vertical"),
],
diff --git a/dev/manual_tests/raw_keyboard.dart b/dev/manual_tests/raw_keyboard.dart
index 392c856..62420c2 100644
--- a/dev/manual_tests/raw_keyboard.dart
+++ b/dev/manual_tests/raw_keyboard.dart
@@ -10,7 +10,7 @@
title: 'Hardware Key Demo',
home: new Scaffold(
appBar: new AppBar(
- title: new Text('Hardware Key Demo'),
+ title: const Text('Hardware Key Demo'),
),
body: new Center(
child: new RawKeyboardDemo(),
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);
}),
diff --git a/examples/flutter_view/lib/main.dart b/examples/flutter_view/lib/main.dart
index 0b34730..9cd4da8 100644
--- a/examples/flutter_view/lib/main.dart
+++ b/examples/flutter_view/lib/main.dart
@@ -61,7 +61,7 @@
child: new Center(
child: new Text(
'Platform button tapped $_counter time${ _counter == 1 ? '' : 's' }.',
- style: new TextStyle(fontSize: 17.0))
+ style: const TextStyle(fontSize: 17.0))
),
),
new Container(
@@ -69,7 +69,7 @@
child: new Row(
children: <Widget>[
new Image.asset('assets/flutter-mark-square-64.png', scale: 1.5),
- new Text('Flutter', style: new TextStyle(fontSize: 30.0)),
+ const Text('Flutter', style: const TextStyle(fontSize: 30.0)),
],
),
),
@@ -77,7 +77,7 @@
),
floatingActionButton: new FloatingActionButton(
onPressed: _sendFlutterIncrement,
- child: new Icon(Icons.add),
+ child: const Icon(Icons.add),
),
);
}
diff --git a/examples/hello_world/lib/main.dart b/examples/hello_world/lib/main.dart
index fc37338..1ad8675 100644
--- a/examples/hello_world/lib/main.dart
+++ b/examples/hello_world/lib/main.dart
@@ -4,4 +4,4 @@
import 'package:flutter/widgets.dart';
-void main() => runApp(new Center(child: new Text('Hello, world!')));
+void main() => runApp(const Center(child: const Text('Hello, world!')));
diff --git a/examples/layers/rendering/touch_input.dart b/examples/layers/rendering/touch_input.dart
index 8c3f3a6..6fd5685 100644
--- a/examples/layers/rendering/touch_input.dart
+++ b/examples/layers/rendering/touch_input.dart
@@ -102,8 +102,8 @@
void main() {
// Create some styled text to tell the user to interact with the app.
final RenderParagraph paragraph = new RenderParagraph(
- new TextSpan(
- style: new TextStyle(color: Colors.black87),
+ const TextSpan(
+ style: const TextStyle(color: Colors.black87),
text: "Touch me!"
)
);
diff --git a/examples/layers/services/lifecycle.dart b/examples/layers/services/lifecycle.dart
index 7f979c3..5196c83 100644
--- a/examples/layers/services/lifecycle.dart
+++ b/examples/layers/services/lifecycle.dart
@@ -35,7 +35,7 @@
@override
Widget build(BuildContext context) {
if (_lastLifecyleState == null)
- return new Text('This widget has not observed any lifecycle changes.');
+ return const Text('This widget has not observed any lifecycle changes.');
return new Text('The most recent lifecycle state this widget observed was: $_lastLifecyleState.');
}
}
diff --git a/examples/layers/widgets/custom_render_box.dart b/examples/layers/widgets/custom_render_box.dart
index b93d8bc..f5fa0f5 100644
--- a/examples/layers/widgets/custom_render_box.dart
+++ b/examples/layers/widgets/custom_render_box.dart
@@ -46,5 +46,5 @@
}
void main() {
- runApp(new Dots(child: new Center(child: new Text('Touch me!'))));
+ runApp(new Dots(child: const Center(child: const Text('Touch me!'))));
}
diff --git a/examples/layers/widgets/gestures.dart b/examples/layers/widgets/gestures.dart
index 2bc7015..deee29e 100644
--- a/examples/layers/widgets/gestures.dart
+++ b/examples/layers/widgets/gestures.dart
@@ -188,7 +188,7 @@
value: _scaleEnabled,
onChanged: (bool value) { setState(() { _scaleEnabled = value; }); }
),
- new Text('Scale'),
+ const Text('Scale'),
]
),
new Row(
@@ -197,7 +197,7 @@
value: _tapEnabled,
onChanged: (bool value) { setState(() { _tapEnabled = value; }); }
),
- new Text('Tap'),
+ const Text('Tap'),
]
),
new Row(
@@ -206,7 +206,7 @@
value: _doubleTapEnabled,
onChanged: (bool value) { setState(() { _doubleTapEnabled = value; }); }
),
- new Text('Double Tap'),
+ const Text('Double Tap'),
]
),
new Row(
@@ -215,7 +215,7 @@
value: _longPressEnabled,
onChanged: (bool value) { setState(() { _longPressEnabled = value; }); }
),
- new Text('Long Press'),
+ const Text('Long Press'),
]
),
],
@@ -233,7 +233,7 @@
runApp(new MaterialApp(
theme: new ThemeData.dark(),
home: new Scaffold(
- appBar: new AppBar(title: new Text('Gestures Demo')),
+ appBar: new AppBar(title: const Text('Gestures Demo')),
body: new GestureDemo()
)
));
diff --git a/examples/layers/widgets/hello_world.dart b/examples/layers/widgets/hello_world.dart
index fc37338..1ad8675 100644
--- a/examples/layers/widgets/hello_world.dart
+++ b/examples/layers/widgets/hello_world.dart
@@ -4,4 +4,4 @@
import 'package:flutter/widgets.dart';
-void main() => runApp(new Center(child: new Text('Hello, world!')));
+void main() => runApp(const Center(child: const Text('Hello, world!')));
diff --git a/examples/layers/widgets/media_query.dart b/examples/layers/widgets/media_query.dart
index 1158376..5a638dd 100644
--- a/examples/layers/widgets/media_query.dart
+++ b/examples/layers/widgets/media_query.dart
@@ -51,8 +51,8 @@
new Expanded(
child: new Text(name)
),
- new IconButton(
- icon: new Icon(Icons.more_vert),
+ const IconButton(
+ icon: const Icon(Icons.more_vert),
onPressed: null
)
]
@@ -103,7 +103,7 @@
title: 'Media Query Example',
home: new Scaffold(
appBar: new AppBar(
- title: new Text('Media Query Example')
+ title: const Text('Media Query Example')
),
body: new Material(child: new AdaptiveContainer(names: _kNames))
)
diff --git a/examples/layers/widgets/sectors.dart b/examples/layers/widgets/sectors.dart
index 060b087..c978218 100644
--- a/examples/layers/widgets/sectors.dart
+++ b/examples/layers/widgets/sectors.dart
@@ -106,7 +106,7 @@
margin: const EdgeInsets.only(right: 10.0),
child: new WidgetToRenderBoxAdapter(renderBox: sectorAddIcon)
),
- new Text('ADD SECTOR'),
+ const Text('ADD SECTOR'),
]
)
)
@@ -121,7 +121,7 @@
margin: const EdgeInsets.only(right: 10.0),
child: new WidgetToRenderBoxAdapter(renderBox: sectorRemoveIcon)
),
- new Text('REMOVE SECTOR'),
+ const Text('REMOVE SECTOR'),
]
)
)
@@ -155,7 +155,7 @@
title: 'Sector Layout',
home: new Scaffold(
appBar: new AppBar(
- title: new Text('Sector Layout in a Widget Tree')
+ title: const Text('Sector Layout in a Widget Tree')
),
body: buildBody()
)
diff --git a/examples/layers/widgets/spinning_mixed.dart b/examples/layers/widgets/spinning_mixed.dart
index eb0aae3..0ffefaf 100644
--- a/examples/layers/widgets/spinning_mixed.dart
+++ b/examples/layers/widgets/spinning_mixed.dart
@@ -52,7 +52,7 @@
child: new Row(
children: <Widget>[
new Image.network('https://flutter.io/images/favicon.png'),
- new Text('PRESS ME'),
+ const Text('PRESS ME'),
]
),
onPressed: () {
diff --git a/examples/layers/widgets/styled_text.dart b/examples/layers/widgets/styled_text.dart
index e151da3..917bc0e 100644
--- a/examples/layers/widgets/styled_text.dart
+++ b/examples/layers/widgets/styled_text.dart
@@ -124,7 +124,7 @@
theme: new ThemeData.light(),
home: new Scaffold(
appBar: new AppBar(
- title: new Text('Hal and Dave')
+ title: const Text('Hal and Dave')
),
body: new Material(
color: Colors.grey.shade50,
diff --git a/examples/platform_channel/lib/main.dart b/examples/platform_channel/lib/main.dart
index 19f6738..eea88f1 100644
--- a/examples/platform_channel/lib/main.dart
+++ b/examples/platform_channel/lib/main.dart
@@ -62,11 +62,11 @@
new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- new Text(_batteryLevel, key: new Key('Battery level label')),
+ new Text(_batteryLevel, key: const Key('Battery level label')),
new Padding(
- padding: new EdgeInsets.all(16.0),
+ padding: const EdgeInsets.all(16.0),
child: new RaisedButton(
- child: new Text('Refresh'),
+ child: const Text('Refresh'),
onPressed: _getBatteryLevel,
),
),
diff --git a/examples/platform_channel_swift/lib/main.dart b/examples/platform_channel_swift/lib/main.dart
index 9d9f639..abe4412 100644
--- a/examples/platform_channel_swift/lib/main.dart
+++ b/examples/platform_channel_swift/lib/main.dart
@@ -37,10 +37,10 @@
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
new RaisedButton(
- child: new Text('Get Battery Level'),
+ child: const Text('Get Battery Level'),
onPressed: _getBatteryLevel,
),
- new Text(_batteryLevel, key: new Key('Battery level label')),
+ new Text(_batteryLevel, key: const Key('Battery level label')),
],
),
),
diff --git a/examples/stocks/lib/stock_home.dart b/examples/stocks/lib/stock_home.dart
index 0ac3446..75a3a47 100644
--- a/examples/stocks/lib/stock_home.dart
+++ b/examples/stocks/lib/stock_home.dart
@@ -20,21 +20,21 @@
@override
Widget build(BuildContext context) {
return new AlertDialog(
- title: new Text('Not Implemented'),
- content: new Text('This feature has not yet been implemented.'),
+ title: const Text('Not Implemented'),
+ content: const Text('This feature has not yet been implemented.'),
actions: <Widget>[
new FlatButton(
onPressed: debugDumpApp,
child: new Row(
children: <Widget>[
- new Icon(
+ const Icon(
Icons.dvr,
size: 18.0,
),
new Container(
width: 8.0,
),
- new Text('DUMP APP TO CONSOLE'),
+ const Text('DUMP APP TO CONSOLE'),
],
),
),
@@ -42,7 +42,7 @@
onPressed: () {
Navigator.pop(context, false);
},
- child: new Text('OH WELL'),
+ child: const Text('OH WELL'),
),
],
);
@@ -117,20 +117,20 @@
return new Drawer(
child: new ListView(
children: <Widget>[
- new DrawerHeader(child: new Center(child: new Text('Stocks'))),
+ const DrawerHeader(child: const Center(child: const Text('Stocks'))),
new ListTile(
- leading: new Icon(Icons.assessment),
- title: new Text('Stock List'),
+ leading: const Icon(Icons.assessment),
+ title: const Text('Stock List'),
selected: true,
),
new ListTile(
- leading: new Icon(Icons.account_balance),
- title: new Text('Account Balance'),
+ leading: const Icon(Icons.account_balance),
+ title: const Text('Account Balance'),
enabled: false,
),
new ListTile(
- leading: new Icon(Icons.dvr),
- title: new Text('Dump App to Console'),
+ leading: const Icon(Icons.dvr),
+ title: const Text('Dump App to Console'),
onTap: () {
try {
debugDumpApp();
@@ -144,8 +144,8 @@
),
new Divider(),
new ListTile(
- leading: new Icon(Icons.thumb_up),
- title: new Text('Optimistic'),
+ leading: const Icon(Icons.thumb_up),
+ title: const Text('Optimistic'),
trailing: new Radio<StockMode>(
value: StockMode.optimistic,
groupValue: config.configuration.stockMode,
@@ -156,8 +156,8 @@
},
),
new ListTile(
- leading: new Icon(Icons.thumb_down),
- title: new Text('Pessimistic'),
+ leading: const Icon(Icons.thumb_down),
+ title: const Text('Pessimistic'),
trailing: new Radio<StockMode>(
value: StockMode.pessimistic,
groupValue: config.configuration.stockMode,
@@ -169,13 +169,13 @@
),
new Divider(),
new ListTile(
- leading: new Icon(Icons.settings),
- title: new Text('Settings'),
+ leading: const Icon(Icons.settings),
+ title: const Text('Settings'),
onTap: _handleShowSettings,
),
new ListTile(
- leading: new Icon(Icons.help),
- title: new Text('About'),
+ leading: const Icon(Icons.help),
+ title: const Text('About'),
onTap: _handleShowAbout,
),
],
@@ -197,7 +197,7 @@
title: new Text(StockStrings.of(context).title()),
actions: <Widget>[
new IconButton(
- icon: new Icon(Icons.search),
+ icon: const Icon(Icons.search),
onPressed: _handleSearchBegin,
tooltip: 'Search',
),
@@ -207,19 +207,19 @@
new CheckedPopupMenuItem<_StockMenuItem>(
value: _StockMenuItem.autorefresh,
checked: _autorefresh,
- child: new Text('Autorefresh'),
+ child: const Text('Autorefresh'),
),
new PopupMenuItem<_StockMenuItem>(
value: _StockMenuItem.refresh,
- child: new Text('Refresh'),
+ child: const Text('Refresh'),
),
new PopupMenuItem<_StockMenuItem>(
value: _StockMenuItem.speedUp,
- child: new Text('Increase animation speed'),
+ child: const Text('Increase animation speed'),
),
new PopupMenuItem<_StockMenuItem>(
value: _StockMenuItem.speedDown,
- child: new Text('Decrease animation speed'),
+ child: const Text('Decrease animation speed'),
),
],
),
@@ -287,7 +287,7 @@
Widget buildSearchBar() {
return new AppBar(
leading: new IconButton(
- icon: new Icon(Icons.arrow_back),
+ icon: const Icon(Icons.arrow_back),
color: Theme.of(context).accentColor,
onPressed: _handleSearchEnd,
tooltip: 'Back',
@@ -313,7 +313,7 @@
Widget buildFloatingActionButton() {
return new FloatingActionButton(
tooltip: 'Create company',
- child: new Icon(Icons.add),
+ child: const Icon(Icons.add),
backgroundColor: Colors.redAccent,
onPressed: _handleCreateCompany,
);
diff --git a/examples/stocks/lib/stock_settings.dart b/examples/stocks/lib/stock_settings.dart
index 1d93aa0..4865053 100644
--- a/examples/stocks/lib/stock_settings.dart
+++ b/examples/stocks/lib/stock_settings.dart
@@ -68,17 +68,17 @@
showDialog<bool>(
context: context,
child: new AlertDialog(
- title: new Text("Change mode?"),
- content: new Text("Optimistic mode means everything is awesome. Are you sure you can handle that?"),
+ title: const Text("Change mode?"),
+ content: const Text("Optimistic mode means everything is awesome. Are you sure you can handle that?"),
actions: <Widget>[
new FlatButton(
- child: new Text('NO THANKS'),
+ child: const Text('NO THANKS'),
onPressed: () {
Navigator.pop(context, false);
}
),
new FlatButton(
- child: new Text('AGREE'),
+ child: const Text('AGREE'),
onPressed: () {
Navigator.pop(context, true);
}
@@ -97,15 +97,15 @@
Widget buildAppBar(BuildContext context) {
return new AppBar(
- title: new Text('Settings')
+ title: const Text('Settings')
);
}
Widget buildSettingsPane(BuildContext context) {
final List<Widget> rows = <Widget>[
new ListTile(
- leading: new Icon(Icons.thumb_up),
- title: new Text('Everything is awesome'),
+ leading: const Icon(Icons.thumb_up),
+ title: const Text('Everything is awesome'),
onTap: _confirmOptimismChange,
trailing: new Checkbox(
value: config.configuration.stockMode == StockMode.optimistic,
@@ -113,8 +113,8 @@
),
),
new ListTile(
- leading: new Icon(Icons.backup),
- title: new Text('Back up stock list to the cloud'),
+ leading: const Icon(Icons.backup),
+ title: const Text('Back up stock list to the cloud'),
onTap: () { _handleBackupChanged(!(config.configuration.backupMode == BackupMode.enabled)); },
trailing: new Switch(
value: config.configuration.backupMode == BackupMode.enabled,
@@ -122,8 +122,8 @@
),
),
new ListTile(
- leading: new Icon(Icons.picture_in_picture),
- title: new Text('Show rendering performance overlay'),
+ leading: const Icon(Icons.picture_in_picture),
+ title: const Text('Show rendering performance overlay'),
onTap: () { _handleShowPerformanceOverlayChanged(!config.configuration.showPerformanceOverlay); },
trailing: new Switch(
value: config.configuration.showPerformanceOverlay,
@@ -131,8 +131,8 @@
),
),
new ListTile(
- leading: new Icon(Icons.accessibility),
- title: new Text('Show semantics overlay'),
+ leading: const Icon(Icons.accessibility),
+ title: const Text('Show semantics overlay'),
onTap: () { _handleShowSemanticsDebuggerChanged(!config.configuration.showSemanticsDebugger); },
trailing: new Switch(
value: config.configuration.showSemanticsDebugger,
@@ -144,8 +144,8 @@
// material grid and size construction lines are only available in checked mode
rows.addAll(<Widget>[
new ListTile(
- leading: new Icon(Icons.border_clear),
- title: new Text('Show material grid (for debugging)'),
+ leading: const Icon(Icons.border_clear),
+ title: const Text('Show material grid (for debugging)'),
onTap: () { _handleShowGridChanged(!config.configuration.debugShowGrid); },
trailing: new Switch(
value: config.configuration.debugShowGrid,
@@ -153,8 +153,8 @@
),
),
new ListTile(
- leading: new Icon(Icons.border_all),
- title: new Text('Show construction lines (for debugging)'),
+ leading: const Icon(Icons.border_all),
+ title: const Text('Show construction lines (for debugging)'),
onTap: () { _handleShowSizesChanged(!config.configuration.debugShowSizes); },
trailing: new Switch(
value: config.configuration.debugShowSizes,
@@ -162,8 +162,8 @@
),
),
new ListTile(
- leading: new Icon(Icons.format_color_text),
- title: new Text('Show baselines (for debugging)'),
+ leading: const Icon(Icons.format_color_text),
+ title: const Text('Show baselines (for debugging)'),
onTap: () { _handleShowBaselinesChanged(!config.configuration.debugShowBaselines); },
trailing: new Switch(
value: config.configuration.debugShowBaselines,
@@ -171,8 +171,8 @@
),
),
new ListTile(
- leading: new Icon(Icons.filter_none),
- title: new Text('Show layer boundaries (for debugging)'),
+ leading: const Icon(Icons.filter_none),
+ title: const Text('Show layer boundaries (for debugging)'),
onTap: () { _handleShowLayersChanged(!config.configuration.debugShowLayers); },
trailing: new Switch(
value: config.configuration.debugShowLayers,
@@ -180,8 +180,8 @@
),
),
new ListTile(
- leading: new Icon(Icons.mouse),
- title: new Text('Show pointer hit-testing (for debugging)'),
+ leading: const Icon(Icons.mouse),
+ title: const Text('Show pointer hit-testing (for debugging)'),
onTap: () { _handleShowPointersChanged(!config.configuration.debugShowPointers); },
trailing: new Switch(
value: config.configuration.debugShowPointers,
@@ -189,8 +189,8 @@
),
),
new ListTile(
- leading: new Icon(Icons.gradient),
- title: new Text('Show repaint rainbow (for debugging)'),
+ leading: const Icon(Icons.gradient),
+ title: const Text('Show repaint rainbow (for debugging)'),
onTap: () { _handleShowRainbowChanged(!config.configuration.debugShowRainbow); },
trailing: new Switch(
value: config.configuration.debugShowRainbow,
diff --git a/examples/stocks/lib/stock_symbol_viewer.dart b/examples/stocks/lib/stock_symbol_viewer.dart
index 6601d81..153e9fb 100644
--- a/examples/stocks/lib/stock_symbol_viewer.dart
+++ b/examples/stocks/lib/stock_symbol_viewer.dart
@@ -100,8 +100,8 @@
Widget build(BuildContext context) {
return new Container(
padding: const EdgeInsets.all(10.0),
- 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 _StockSymbolView(
stock: stock,
diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart
index 3e6cd25..5d1f13a 100644
--- a/packages/flutter/lib/src/material/about.dart
+++ b/packages/flutter/lib/src/material/about.dart
@@ -290,7 +290,7 @@
),
actions: <Widget>[
new FlatButton(
- child: new Text('VIEW LICENSES'),
+ child: const Text('VIEW LICENSES'),
onPressed: () {
showLicensePage(
context: context,
@@ -302,7 +302,7 @@
}
),
new FlatButton(
- child: new Text('CLOSE'),
+ child: const Text('CLOSE'),
onPressed: () {
Navigator.pop(context);
}
@@ -377,9 +377,9 @@
if (!mounted)
return;
setState(() {
- _licenses.add(new Padding(
+ _licenses.add(const Padding(
padding: const EdgeInsets.symmetric(vertical: 18.0),
- child: new Text(
+ child: const Text(
'🍀', // That's U+1F340. Could also use U+2766 (❦) if U+1F340 doesn't work everywhere.
textAlign: TextAlign.center
)
@@ -443,7 +443,7 @@
}
return new Scaffold(
appBar: new AppBar(
- title: new Text('Licenses')
+ title: const Text('Licenses')
),
body: new DefaultTextStyle(
style: Theme.of(context).textTheme.caption,
diff --git a/packages/flutter/lib/src/material/data_table.dart b/packages/flutter/lib/src/material/data_table.dart
index ff8b500..039597b 100644
--- a/packages/flutter/lib/src/material/data_table.dart
+++ b/packages/flutter/lib/src/material/data_table.dart
@@ -450,7 +450,7 @@
}) {
final bool isLightTheme = Theme.of(context).brightness == Brightness.light;
if (showEditIcon) {
- final Widget icon = new Icon(Icons.edit, size: 18.0);
+ final Widget icon = const Icon(Icons.edit, size: 18.0);
label = new Expanded(child: label);
label = new Row(children: numeric ? <Widget>[ icon, label ] : <Widget>[ label, icon ]);
}
@@ -523,7 +523,7 @@
int displayColumnIndex = 0;
if (showCheckboxColumn) {
- tableColumns[0] = new FixedColumnWidth(_kTablePadding + Checkbox.width + _kTablePadding / 2.0);
+ tableColumns[0] = const FixedColumnWidth(_kTablePadding + Checkbox.width + _kTablePadding / 2.0);
tableRows[0].children[0] = _buildCheckbox(
color: theme.accentColor,
checked: allChecked,
diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart
index 8fe0156..f95b769 100644
--- a/packages/flutter/lib/src/material/date_picker.dart
+++ b/packages/flutter/lib/src/material/date_picker.dart
@@ -677,11 +677,11 @@
child: new ButtonBar(
children: <Widget>[
new FlatButton(
- child: new Text('CANCEL'),
+ child: const Text('CANCEL'),
onPressed: _handleCancel,
),
new FlatButton(
- child: new Text('OK'),
+ child: const Text('OK'),
onPressed: _handleOk,
),
],
diff --git a/packages/flutter/lib/src/material/expand_icon.dart b/packages/flutter/lib/src/material/expand_icon.dart
index d00c781..3bb261d 100644
--- a/packages/flutter/lib/src/material/expand_icon.dart
+++ b/packages/flutter/lib/src/material/expand_icon.dart
@@ -107,7 +107,7 @@
onPressed: config.onPressed == null ? null : _handlePressed,
icon: new RotationTransition(
turns: _iconTurns,
- child: new Icon(Icons.expand_more)
+ child: const Icon(Icons.expand_more)
)
);
}
diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart
index ef430cd..1b543e7 100644
--- a/packages/flutter/lib/src/material/input_decorator.dart
+++ b/packages/flutter/lib/src/material/input_decorator.dart
@@ -305,7 +305,7 @@
if (decoration.hideDivider) {
return new Container(
- margin: margin + new EdgeInsets.only(bottom: bottomBorder),
+ margin: margin + const EdgeInsets.only(bottom: bottomBorder),
padding: padding,
child: child,
);
diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart
index 6713e88..a0d856a 100644
--- a/packages/flutter/lib/src/material/list_tile.dart
+++ b/packages/flutter/lib/src/material/list_tile.dart
@@ -106,7 +106,7 @@
/// ```
static ListTileTheme of(BuildContext context) {
final ListTileTheme result = context.inheritFromWidgetOfExactType(ListTileTheme);
- return result ?? new ListTileTheme();
+ return result ?? const ListTileTheme();
}
@override
diff --git a/packages/flutter/lib/src/material/paginated_data_table.dart b/packages/flutter/lib/src/material/paginated_data_table.dart
index ba2423a..f2d40c7 100644
--- a/packages/flutter/lib/src/material/paginated_data_table.dart
+++ b/packages/flutter/lib/src/material/paginated_data_table.dart
@@ -298,7 +298,7 @@
}
} else if (_selectedRowCount == 1) {
// TODO(ianh): Real l10n.
- headerWidgets.add(new Expanded(child: new Text('1 item selected')));
+ headerWidgets.add(const Expanded(child: const Text('1 item selected')));
} else {
headerWidgets.add(new Expanded(child: new Text('$_selectedRowCount items selected')));
}
@@ -328,7 +328,7 @@
})
.toList();
footerWidgets.addAll(<Widget>[
- new Text('Rows per page:'),
+ const Text('Rows per page:'),
new DropdownButtonHideUnderline(
child: new DropdownButton<int>(
items: availableRowsPerPage,
@@ -347,7 +347,7 @@
),
new Container(width: 32.0),
new IconButton(
- icon: new Icon(Icons.chevron_left),
+ icon: const Icon(Icons.chevron_left),
padding: EdgeInsets.zero,
tooltip: 'Previous page',
onPressed: _firstRowIndex <= 0 ? null : () {
@@ -356,7 +356,7 @@
),
new Container(width: 24.0),
new IconButton(
- icon: new Icon(Icons.chevron_right),
+ icon: const Icon(Icons.chevron_right),
padding: EdgeInsets.zero,
tooltip: 'Next page',
onPressed: (!_rowCountApproximate && (_firstRowIndex + config.rowsPerPage >= _rowCount)) ? null : () {
diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart
index fea0e7b..06bb4a9 100644
--- a/packages/flutter/lib/src/material/popup_menu.dart
+++ b/packages/flutter/lib/src/material/popup_menu.dart
@@ -547,7 +547,7 @@
Widget build(BuildContext context) {
if (config.child == null) {
return new IconButton(
- icon: new Icon(Icons.more_vert),
+ icon: const Icon(Icons.more_vert),
padding: config.padding,
tooltip: config.tooltip,
onPressed: showButtonMenu,
diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart
index b7771a9..48add10 100644
--- a/packages/flutter/lib/src/material/stepper.dart
+++ b/packages/flutter/lib/src/material/stepper.dart
@@ -249,7 +249,7 @@
color: isDarkActive ? _kCircleActiveDark : _kCircleActiveLight,
);
case StepState.error:
- return new Text('!', style: _kStepStyle);
+ return const Text('!', style: _kStepStyle);
}
return null;
}
@@ -351,7 +351,7 @@
color: _isDark() ? themeData.backgroundColor : themeData.primaryColor,
textColor: Colors.white,
textTheme: ButtonTextTheme.normal,
- child: new Text('CONTINUE'),
+ child: const Text('CONTINUE'),
),
new Container(
margin: const EdgeInsets.only(left: 8.0),
@@ -359,7 +359,7 @@
onPressed: config.onStepCancel,
textColor: cancelColor,
textTheme: ButtonTextTheme.normal,
- child: new Text('CANCEL'),
+ child: const Text('CANCEL'),
),
),
],
diff --git a/packages/flutter/lib/src/material/text_selection.dart b/packages/flutter/lib/src/material/text_selection.dart
index f56d6c3..e3e268d 100644
--- a/packages/flutter/lib/src/material/text_selection.dart
+++ b/packages/flutter/lib/src/material/text_selection.dart
@@ -27,17 +27,17 @@
final List<Widget> items = <Widget>[];
if (!value.selection.isCollapsed) {
- items.add(new FlatButton(child: new Text('CUT'), onPressed: _handleCut));
- items.add(new FlatButton(child: new Text('COPY'), onPressed: _handleCopy));
+ items.add(new FlatButton(child: const Text('CUT'), onPressed: _handleCut));
+ items.add(new FlatButton(child: const Text('COPY'), onPressed: _handleCopy));
}
items.add(new FlatButton(
- child: new Text('PASTE'),
+ child: const Text('PASTE'),
// TODO(mpcomplete): This should probably be grayed-out if there is nothing to paste.
onPressed: _handlePaste
));
if (value.text.isNotEmpty) {
if (value.selection.isCollapsed)
- items.add(new FlatButton(child: new Text('SELECT ALL'), onPressed: _handleSelectAll));
+ items.add(new FlatButton(child: const Text('SELECT ALL'), onPressed: _handleSelectAll));
}
return new Material(
diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart
index 50b47f7..57d65e4 100644
--- a/packages/flutter/lib/src/material/time_picker.dart
+++ b/packages/flutter/lib/src/material/time_picker.dart
@@ -702,11 +702,11 @@
child: new ButtonBar(
children: <Widget>[
new FlatButton(
- child: new Text('CANCEL'),
+ child: const Text('CANCEL'),
onPressed: _handleCancel
),
new FlatButton(
- child: new Text('OK'),
+ child: const Text('OK'),
onPressed: _handleOk
),
]
diff --git a/packages/flutter/lib/src/material/two_level_list.dart b/packages/flutter/lib/src/material/two_level_list.dart
index 7be3b57..4203e30 100644
--- a/packages/flutter/lib/src/material/two_level_list.dart
+++ b/packages/flutter/lib/src/material/two_level_list.dart
@@ -213,7 +213,7 @@
),
trailing: new RotationTransition(
turns: _iconTurns,
- child: new Icon(Icons.expand_more)
+ child: const Icon(Icons.expand_more)
)
)
),
diff --git a/packages/flutter/lib/src/widgets/container.dart b/packages/flutter/lib/src/widgets/container.dart
index 80b7573..09f64b3 100644
--- a/packages/flutter/lib/src/widgets/container.dart
+++ b/packages/flutter/lib/src/widgets/container.dart
@@ -21,15 +21,14 @@
///
/// The [decoration] and [position] arguments must not be null. By default the
/// decoration paints behind the child.
- DecoratedBox({
+ const DecoratedBox({
Key key,
@required this.decoration,
this.position: DecorationPosition.background,
Widget child
- }) : super(key: key, child: child) {
- assert(decoration != null);
- assert(position != null);
- }
+ }) : assert(decoration != null),
+ assert(position != null),
+ super(key: key, child: child);
/// What decoration to paint.
///
diff --git a/packages/flutter/lib/src/widgets/text.dart b/packages/flutter/lib/src/widgets/text.dart
index 8a35833..98abbcc 100644
--- a/packages/flutter/lib/src/widgets/text.dart
+++ b/packages/flutter/lib/src/widgets/text.dart
@@ -14,7 +14,7 @@
///
/// Consider using [DefaultTextStyle.merge] to inherit styling information
/// from the current default text style for a given [BuildContext].
- DefaultTextStyle({
+ const DefaultTextStyle({
Key key,
@required this.style,
this.textAlign,
@@ -22,12 +22,11 @@
this.overflow: TextOverflow.clip,
this.maxLines,
@required Widget child,
- }) : super(key: key, child: child) {
- assert(style != null);
- assert(softWrap != null);
- assert(overflow != null);
- assert(child != null);
- }
+ }) : assert(style != null),
+ assert(softWrap != null),
+ assert(overflow != null),
+ assert(child != null),
+ super(key: key, child: child);
/// A const-constructible default text style that provides fallback values.
///
@@ -140,7 +139,7 @@
///
/// If the [style] argument is null, the text will use the style from the
/// closest enclosing [DefaultTextStyle].
- Text(this.data, {
+ const Text(this.data, {
Key key,
this.style,
this.textAlign,
@@ -148,9 +147,8 @@
this.overflow,
this.textScaleFactor,
this.maxLines,
- }) : super(key: key) {
- assert(data != null);
- }
+ }) : assert(data != null),
+ super(key: key);
/// The text to display.
final String data;
diff --git a/packages/flutter/test/cupertino/button_test.dart b/packages/flutter/test/cupertino/button_test.dart
index ba8e731..b769827 100644
--- a/packages/flutter/test/cupertino/button_test.dart
+++ b/packages/flutter/test/cupertino/button_test.dart
@@ -16,7 +16,7 @@
testWidgets('Default layout minimum size', (WidgetTester tester) async {
await tester.pumpWidget(
new Center(child: new CupertinoButton(
- child: new Text('X', style: testStyle),
+ child: const Text('X', style: testStyle),
onPressed: null,
))
);
@@ -32,7 +32,7 @@
final double minSize = 60.0;
await tester.pumpWidget(
new Center(child: new CupertinoButton(
- child: new Text('X', style: testStyle),
+ child: const Text('X', style: testStyle),
onPressed: null,
minSize: minSize,
))
@@ -48,7 +48,7 @@
testWidgets('Size grows with text', (WidgetTester tester) async {
await tester.pumpWidget(
new Center(child: new CupertinoButton(
- child: new Text('XXXX', style: testStyle),
+ child: const Text('XXXX', style: testStyle),
onPressed: null,
))
);
@@ -62,7 +62,7 @@
testWidgets('Button with background is wider', (WidgetTester tester) async {
await tester.pumpWidget(new Center(child: new CupertinoButton(
- child: new Text('X', style: testStyle),
+ child: const Text('X', style: testStyle),
onPressed: null,
color: const Color(0xFFFFFFFF),
)));
@@ -76,7 +76,7 @@
testWidgets('Custom padding', (WidgetTester tester) async {
await tester.pumpWidget(new Center(child: new CupertinoButton(
- child: new Text(' ', style: testStyle),
+ child: const Text(' ', style: testStyle),
onPressed: null,
padding: const EdgeInsets.all(100.0),
)));
@@ -94,7 +94,7 @@
builder: (BuildContext context, StateSetter setState) {
return new Center(
child: new CupertinoButton(
- child: new Text('Tap me'),
+ child: const Text('Tap me'),
onPressed: () {
setState(() {
value = true;
@@ -117,7 +117,7 @@
testWidgets('Disabled button doesn\'t animate', (WidgetTester tester) async {
await tester.pumpWidget(new Center(child: new CupertinoButton(
- child: new Text('Tap me'),
+ child: const Text('Tap me'),
onPressed: null,
)));
expect(SchedulerBinding.instance.transientCallbackCount, equals(0));
@@ -128,7 +128,7 @@
testWidgets('pressedOpacity defaults to 0.1', (WidgetTester tester) async {
await tester.pumpWidget(new Center(child: new CupertinoButton(
- child: new Text('Tap me'),
+ child: const Text('Tap me'),
onPressed: () { },
)));
@@ -149,7 +149,7 @@
final double pressedOpacity = 0.5;
await tester.pumpWidget(new Center(child: new CupertinoButton(
pressedOpacity: pressedOpacity,
- child: new Text('Tap me'),
+ child: const Text('Tap me'),
onPressed: () { },
)));
diff --git a/packages/flutter/test/cupertino/dialog_test.dart b/packages/flutter/test/cupertino/dialog_test.dart
index 91f00fc..82266c3 100644
--- a/packages/flutter/test/cupertino/dialog_test.dart
+++ b/packages/flutter/test/cupertino/dialog_test.dart
@@ -20,11 +20,11 @@
showDialog<Null>(
context: context,
child: new CupertinoAlertDialog(
- title: new Text('The title'),
- content: new Text('The content'),
+ title: const Text('The title'),
+ content: const Text('The content'),
actions: <Widget>[
new CupertinoDialogAction(
- child: new Text('Cancel'),
+ child: const Text('Cancel'),
),
new CupertinoDialogAction(
isDestructive: true,
@@ -32,13 +32,13 @@
didDelete = true;
Navigator.pop(context);
},
- child: new Text('Delete'),
+ child: const Text('Delete'),
),
],
),
);
},
- child: new Text('Go'),
+ child: const Text('Go'),
);
},
),
@@ -66,7 +66,7 @@
testWidgets('Dialog action styles', (WidgetTester tester) async {
await tester.pumpWidget(new CupertinoDialogAction(
isDestructive: true,
- child: new Text('Ok'),
+ child: const Text('Ok'),
));
final DefaultTextStyle widget = tester.widget(find.byType(DefaultTextStyle));
diff --git a/packages/flutter/test/foundation/error_reporting_test.dart b/packages/flutter/test/foundation/error_reporting_test.dart
index 028619b..6bf6f8e 100644
--- a/packages/flutter/test/foundation/error_reporting_test.dart
+++ b/packages/flutter/test/foundation/error_reporting_test.dart
@@ -199,7 +199,7 @@
test('Error reporting - NoSuchMethodError', () async {
expect(console, isEmpty);
- FlutterError.dumpErrorToConsole(new FlutterErrorDetails(
+ FlutterError.dumpErrorToConsole(const FlutterErrorDetails(
exception: 'hello',
));
expect(console.join('\n'), matches(new RegExp(
@@ -209,7 +209,7 @@
'════════════════════════════════════════════════════════════════════════════════════════════════════\$',
)));
console.clear();
- FlutterError.dumpErrorToConsole(new FlutterErrorDetails(
+ FlutterError.dumpErrorToConsole(const FlutterErrorDetails(
exception: 'hello again',
));
expect(console.join('\n'), 'Another exception was thrown: hello again');
diff --git a/packages/flutter/test/material/about_test.dart b/packages/flutter/test/material/about_test.dart
index 921c0aa..233353f 100644
--- a/packages/flutter/test/material/about_test.dart
+++ b/packages/flutter/test/material/about_test.dart
@@ -15,7 +15,7 @@
title: 'Pirate app',
home: new Scaffold(
appBar: new AppBar(
- title: new Text('Home'),
+ title: const Text('Home'),
),
drawer: new Drawer(
child: new ListView(
@@ -25,7 +25,7 @@
applicationIcon: const FlutterLogo(),
applicationLegalese: 'I am the very model of a modern major general.',
aboutBoxChildren: <Widget>[
- new Text('About box'),
+ const Text('About box'),
]
),
],
@@ -89,7 +89,7 @@
]);
});
- await tester.pumpWidget(new Center(
+ await tester.pumpWidget(const Center(
child: const LicensePage()
));
diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart
index 82d2d75..e1e17d0 100644
--- a/packages/flutter/test/material/app_bar_test.dart
+++ b/packages/flutter/test/material/app_bar_test.dart
@@ -15,7 +15,7 @@
primary: true,
slivers: <Widget>[
new SliverAppBar(
- title: new Text('AppBar Title'),
+ title: const Text('AppBar Title'),
floating: floating,
pinned: pinned,
expandedHeight: expandedHeight,
@@ -63,7 +63,7 @@
theme: new ThemeData(platform: TargetPlatform.android),
home: new Scaffold(
appBar: new AppBar(
- title: new Text('X'),
+ title: const Text('X'),
),
),
),
@@ -82,7 +82,7 @@
theme: new ThemeData(platform: TargetPlatform.iOS),
home: new Scaffold(
appBar: new AppBar(
- title: new Text('X'),
+ title: const Text('X'),
),
),
),
@@ -101,7 +101,7 @@
home: new Scaffold(
appBar: new AppBar(
centerTitle: true,
- title: new Text('X'),
+ title: const Text('X'),
)
)
)
@@ -121,7 +121,7 @@
home: new Scaffold(
appBar: new AppBar(
centerTitle: false,
- title: new Text('X'),
+ title: const Text('X'),
),
),
),
@@ -138,7 +138,7 @@
home: new Scaffold(
appBar: new AppBar(
centerTitle: false,
- title: new Text('X'),
+ title: const Text('X'),
),
// A drawer causes a leading hamburger.
drawer: new Drawer(),
@@ -254,9 +254,9 @@
new SizedBox(
height: kToolbarHeight,
child: new AppBar(
- leading: new Text('L'),
- title: new Text('No Scaffold'),
- actions: <Widget>[new Text('A1'), new Text('A2')],
+ leading: const Text('L'),
+ title: const Text('No Scaffold'),
+ actions: <Widget>[const Text('A1'), const Text('A2')],
),
),
);
@@ -276,7 +276,7 @@
width: 0.0,
child: new Scaffold(
appBar: new AppBar(
- title: new Text('X'),
+ title: const Text('X'),
),
),
),
@@ -325,7 +325,7 @@
theme: new ThemeData(platform: TargetPlatform.android),
home: new Scaffold(
appBar: new AppBar(
- title: new Text('X'),
+ title: const Text('X'),
),
drawer: new Column(), // Doesn't really matter. Triggers a hamburger regardless.
),
@@ -343,16 +343,16 @@
theme: new ThemeData(platform: TargetPlatform.android),
home: new Scaffold(
appBar: new AppBar(
- title: new Text('X'),
+ title: const Text('X'),
actions: <Widget> [
- new IconButton(
- icon: new Icon(Icons.share),
+ const IconButton(
+ icon: const Icon(Icons.share),
onPressed: null,
tooltip: 'Share',
iconSize: 20.0,
),
- new IconButton(
- icon: new Icon(Icons.add),
+ const IconButton(
+ icon: const Icon(Icons.add),
onPressed: null,
tooltip: 'Add',
iconSize: 60.0,
diff --git a/packages/flutter/test/material/app_test.dart b/packages/flutter/test/material/app_test.dart
index 96d9610..f9a7a8a 100644
--- a/packages/flutter/test/material/app_test.dart
+++ b/packages/flutter/test/material/app_test.dart
@@ -30,7 +30,7 @@
await tester.pumpWidget(
new MaterialApp(
home: new MaterialApp(
- home: new Text('Home sweet home'),
+ home: const Text('Home sweet home'),
),
),
);
@@ -58,7 +58,7 @@
autofocus: true,
node: focusScopeNode,
child: new MaterialApp(
- home: new Text('Home'),
+ home: const Text('Home'),
),
));
@@ -95,7 +95,7 @@
builder: (BuildContext context) {
return new Material(
child: new RaisedButton(
- child: new Text('X'),
+ child: const Text('X'),
onPressed: () { Navigator.of(context).pushNamed('/next'); },
),
);
@@ -132,7 +132,7 @@
});
testWidgets('Cannot pop the initial route', (WidgetTester tester) async {
- await tester.pumpWidget(new MaterialApp(home: new Text('Home')));
+ await tester.pumpWidget(new MaterialApp(home: const Text('Home')));
expect(find.text('Home'), findsOneWidget);
diff --git a/packages/flutter/test/material/back_button_test.dart b/packages/flutter/test/material/back_button_test.dart
index 526b861..489fbad 100644
--- a/packages/flutter/test/material/back_button_test.dart
+++ b/packages/flutter/test/material/back_button_test.dart
@@ -9,11 +9,11 @@
testWidgets('BackButton control test', (WidgetTester tester) async {
await tester.pumpWidget(
new MaterialApp(
- home: new Material(child: new Text('Home')),
+ home: new Material(child: const Text('Home')),
routes: <String, WidgetBuilder>{
'/next': (BuildContext context) {
return new Material(
- child: new Center(
+ child: const Center(
child: const BackButton(),
)
);
diff --git a/packages/flutter/test/material/bottom_navigation_bar_test.dart b/packages/flutter/test/material/bottom_navigation_bar_test.dart
index 1642cbc..c8de2b4 100644
--- a/packages/flutter/test/material/bottom_navigation_bar_test.dart
+++ b/packages/flutter/test/material/bottom_navigation_bar_test.dart
@@ -14,12 +14,12 @@
bottomNavigationBar: new BottomNavigationBar(
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
- icon: new Icon(Icons.ac_unit),
- title: new Text('AC')
+ icon: const Icon(Icons.ac_unit),
+ title: const Text('AC')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_alarm),
- title: new Text('Alarm')
+ icon: const Icon(Icons.access_alarm),
+ title: const Text('Alarm')
)
],
onTap: (int index) {
@@ -40,12 +40,12 @@
bottomNavigationBar: new BottomNavigationBar(
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
- icon: new Icon(Icons.ac_unit),
- title: new Text('AC')
+ icon: const Icon(Icons.ac_unit),
+ title: const Text('AC')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_alarm),
- title: new Text('Alarm')
+ icon: const Icon(Icons.access_alarm),
+ title: const Text('Alarm')
)
]
)
@@ -65,12 +65,12 @@
type: BottomNavigationBarType.shifting,
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
- icon: new Icon(Icons.ac_unit),
- title: new Text('AC')
+ icon: const Icon(Icons.ac_unit),
+ title: const Text('AC')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_alarm),
- title: new Text('Alarm')
+ icon: const Icon(Icons.access_alarm),
+ title: const Text('Alarm')
)
]
)
@@ -89,12 +89,12 @@
type: BottomNavigationBarType.shifting,
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
- icon: new Icon(Icons.ac_unit),
- title: new Text('AC')
+ icon: const Icon(Icons.ac_unit),
+ title: const Text('AC')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_alarm),
- title: new Text('Alarm')
+ icon: const Icon(Icons.access_alarm),
+ title: const Text('Alarm')
)
]
)
@@ -116,20 +116,20 @@
type: BottomNavigationBarType.shifting,
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
- icon: new Icon(Icons.ac_unit),
- title: new Text('AC')
+ icon: const Icon(Icons.ac_unit),
+ title: const Text('AC')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_alarm),
- title: new Text('Alarm')
+ icon: const Icon(Icons.access_alarm),
+ title: const Text('Alarm')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_time),
- title: new Text('Time')
+ icon: const Icon(Icons.access_time),
+ title: const Text('Time')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.add),
- title: new Text('Add')
+ icon: const Icon(Icons.add),
+ title: const Text('Add')
)
]
)
@@ -176,20 +176,20 @@
type: BottomNavigationBarType.shifting,
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
- icon: new Icon(Icons.ac_unit),
- title: new Text('AC')
+ icon: const Icon(Icons.ac_unit),
+ title: const Text('AC')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_alarm),
- title: new Text('Alarm')
+ icon: const Icon(Icons.access_alarm),
+ title: const Text('Alarm')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_time),
- title: new Text('Time')
+ icon: const Icon(Icons.access_time),
+ title: const Text('Time')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.add),
- title: new Text('Add')
+ icon: const Icon(Icons.add),
+ title: const Text('Add')
)
]
)
@@ -214,20 +214,20 @@
type: BottomNavigationBarType.fixed,
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
- icon: new Icon(Icons.ac_unit),
- title: new Text('AC')
+ icon: const Icon(Icons.ac_unit),
+ title: const Text('AC')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_alarm),
- title: new Text('Alarm')
+ icon: const Icon(Icons.access_alarm),
+ title: const Text('Alarm')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.access_time),
- title: new Text('Time')
+ icon: const Icon(Icons.access_time),
+ title: const Text('Time')
),
new BottomNavigationBarItem(
- icon: new Icon(Icons.add),
- title: new Text('Add')
+ icon: const Icon(Icons.add),
+ title: const Text('Add')
)
]
)
@@ -249,11 +249,11 @@
iconSize: 12.0,
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
- title: new Text('A'),
- icon: new Icon(Icons.ac_unit),
+ title: const Text('A'),
+ icon: const Icon(Icons.ac_unit),
),
new BottomNavigationBarItem(
- title: new Text('B'),
+ title: const Text('B'),
icon: new Builder(
builder: (BuildContext context) {
builderIconSize = IconTheme.of(context).size;
diff --git a/packages/flutter/test/material/buttons_test.dart b/packages/flutter/test/material/buttons_test.dart
index 4fe8fc9..558a4bc 100644
--- a/packages/flutter/test/material/buttons_test.dart
+++ b/packages/flutter/test/material/buttons_test.dart
@@ -18,7 +18,7 @@
child: new Center(
child: new FlatButton(
onPressed: () { },
- child: new Text('ABC')
+ child: const Text('ABC')
)
)
)
@@ -43,8 +43,8 @@
});
testWidgets('Does button highlight + splash colors work if set directly', (WidgetTester tester) async {
- final Color directSplashColor = new Color(0xFF000011);
- final Color directHighlightColor = new Color(0xFF000011);
+ final Color directSplashColor = const Color(0xFF000011);
+ final Color directHighlightColor = const Color(0xFF000011);
Widget buttonWidget = new Material(
child: new Center(
@@ -66,7 +66,7 @@
final Point center = tester.getCenter(find.byType(MaterialButton));
final TestGesture gesture = await tester.startGesture(center);
await tester.pump(); // start gesture
- await tester.pump(new Duration(milliseconds: 200)); // wait for splash to be well under way
+ await tester.pump(const Duration(milliseconds: 200)); // wait for splash to be well under way
expect(
Material.of(tester.element(find.byType(MaterialButton))),
@@ -75,8 +75,8 @@
..rrect(color: directHighlightColor)
);
- final Color themeSplashColor1 = new Color(0xFF001100);
- final Color themeHighlightColor1 = new Color(0xFF001100);
+ final Color themeSplashColor1 = const Color(0xFF001100);
+ final Color themeHighlightColor1 = const Color(0xFF001100);
buttonWidget = new Material(
child: new Center(
@@ -103,8 +103,8 @@
..rrect(color: themeHighlightColor1)
);
- final Color themeSplashColor2 = new Color(0xFF002200);
- final Color themeHighlightColor2 = new Color(0xFF002200);
+ final Color themeSplashColor2 = const Color(0xFF002200);
+ final Color themeHighlightColor2 = const Color(0xFF002200);
await tester.pumpWidget(
new Theme(
diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart
index f9fea61..1461f73 100644
--- a/packages/flutter/test/material/chip_test.dart
+++ b/packages/flutter/test/material/chip_test.dart
@@ -14,9 +14,9 @@
child: new Center(
child: new Chip(
avatar: new CircleAvatar(
- child: new Text('C')
+ child: const Text('C')
),
- label: new Text('Chip'),
+ label: const Text('Chip'),
onDeleted: () {
didDeleteChip = true;
}
diff --git a/packages/flutter/test/material/circle_avatar_test.dart b/packages/flutter/test/material/circle_avatar_test.dart
index b73caff..6ff3bd6 100644
--- a/packages/flutter/test/material/circle_avatar_test.dart
+++ b/packages/flutter/test/material/circle_avatar_test.dart
@@ -14,7 +14,7 @@
child: new CircleAvatar(
backgroundColor: backgroundColor,
radius: 50.0,
- child: new Text('Z'),
+ child: const Text('Z'),
),
),
);
@@ -36,7 +36,7 @@
new Center(
child: new CircleAvatar(
foregroundColor: foregroundColor,
- child: new Text('Z'),
+ child: const Text('Z'),
),
),
);
@@ -64,7 +64,7 @@
data: theme,
child: new Center(
child: new CircleAvatar(
- child: new Text('Z'),
+ child: const Text('Z'),
),
),
),
diff --git a/packages/flutter/test/material/colors_test.dart b/packages/flutter/test/material/colors_test.dart
index cfab64e..0d26b1c 100644
--- a/packages/flutter/test/material/colors_test.dart
+++ b/packages/flutter/test/material/colors_test.dart
@@ -11,7 +11,7 @@
void main() {
test('MaterialColor basic functionality', () {
- final MaterialColor color = new MaterialColor(
+ final MaterialColor color = const MaterialColor(
500,
const <int, Color>{
50: const Color(50),
diff --git a/packages/flutter/test/material/data_table_test.dart b/packages/flutter/test/material/data_table_test.dart
index ff3efee..08cdfd7 100644
--- a/packages/flutter/test/material/data_table_test.dart
+++ b/packages/flutter/test/material/data_table_test.dart
@@ -19,12 +19,12 @@
log.add('select-all: $value');
},
columns: <DataColumn>[
- new DataColumn(
- label: new Text('Name'),
+ const DataColumn(
+ label: const Text('Name'),
tooltip: 'Name',
),
new DataColumn(
- label: new Text('Calories'),
+ label: const Text('Calories'),
tooltip: 'Calories',
numeric: true,
onSort: (int columnIndex, bool ascending) {
diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart
index dc08b02..de33bec 100644
--- a/packages/flutter/test/material/date_picker_test.dart
+++ b/packages/flutter/test/material/date_picker_test.dart
@@ -127,7 +127,7 @@
onPressed: () {
buttonContext = context;
},
- child: new Text('Go'),
+ child: const Text('Go'),
);
},
),
diff --git a/packages/flutter/test/material/debug_test.dart b/packages/flutter/test/material/debug_test.dart
index 06a7fc4..76f14fa 100644
--- a/packages/flutter/test/material/debug_test.dart
+++ b/packages/flutter/test/material/debug_test.dart
@@ -9,7 +9,7 @@
testWidgets('debugCheckHasMaterial control test', (WidgetTester tester) async {
await tester.pumpWidget(new FlatButton(
onPressed: null,
- child: new Text('Go'),
+ child: const Text('Go'),
));
expect(tester.takeException(), isFlutterError);
});
diff --git a/packages/flutter/test/material/dialog_test.dart b/packages/flutter/test/material/dialog_test.dart
index b1fbb4c..f947cea 100644
--- a/packages/flutter/test/material/dialog_test.dart
+++ b/packages/flutter/test/material/dialog_test.dart
@@ -16,7 +16,7 @@
builder: (BuildContext context) {
return new Center(
child: new RaisedButton(
- child: new Text('X'),
+ child: const Text('X'),
onPressed: () {
showDialog<Null>(
context: context,
@@ -33,7 +33,7 @@
onPressed: () {
didPressOk = true;
},
- child: new Text('OK')
+ child: const Text('OK')
)
]
)
@@ -66,13 +66,13 @@
builder: (BuildContext context) {
return new Center(
child: new RaisedButton(
- child: new Text('X'),
+ child: const Text('X'),
onPressed: () {
showDialog<Null>(
context: context,
child: new AlertDialog(
- title: new Text('Title'),
- content: new Text('Y'),
+ title: const Text('Title'),
+ content: const Text('Y'),
actions: <Widget>[ ],
),
);
@@ -104,7 +104,7 @@
child: new Center(
child: new RaisedButton(
onPressed: null,
- child: new Text('Go'),
+ child: const Text('Go'),
),
),
),
@@ -116,16 +116,16 @@
final Future<int> result = showDialog(
context: context,
child: new SimpleDialog(
- title: new Text('Title'),
+ title: const Text('Title'),
children: <Widget>[
new SimpleDialogOption(
onPressed: () {
Navigator.pop(context, 42);
},
- child: new Text('First option'),
+ child: const Text('First option'),
),
new SimpleDialogOption(
- child: new Text('Second option'),
+ child: const Text('Second option'),
),
],
),
@@ -145,7 +145,7 @@
child: new Center(
child: new RaisedButton(
onPressed: null,
- child: new Text('Go'),
+ child: const Text('Go'),
),
),
),
@@ -160,7 +160,7 @@
width: 100.0,
height: 100.0,
alignment: FractionalOffset.center,
- child: new Text('Dialog1'),
+ child: const Text('Dialog1'),
),
);
@@ -180,7 +180,7 @@
width: 100.0,
height: 100.0,
alignment: FractionalOffset.center,
- child: new Text('Dialog2'),
+ child: const Text('Dialog2'),
),
);
diff --git a/packages/flutter/test/material/drawer_test.dart b/packages/flutter/test/material/drawer_test.dart
index 980bb04..d73593b 100644
--- a/packages/flutter/test/material/drawer_test.dart
+++ b/packages/flutter/test/material/drawer_test.dart
@@ -17,12 +17,12 @@
new DrawerHeader(
child: new Container(
key: containerKey,
- child: new Text('header')
+ child: const Text('header')
)
),
new ListTile(
- leading: new Icon(Icons.archive),
- title: new Text('Archive')
+ leading: const Icon(Icons.archive),
+ title: const Text('Archive')
)
]
)
diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart
index d5a2da0..cb0417b 100644
--- a/packages/flutter/test/material/dropdown_test.dart
+++ b/packages/flutter/test/material/dropdown_test.dart
@@ -329,7 +329,7 @@
String value;
// The hint will define the dropdown's width
- Widget build() => buildFrame(buttonKey: buttonKey, value: value, hint: new Text('onetwothree'));
+ Widget build() => buildFrame(buttonKey: buttonKey, value: value, hint: const Text('onetwothree'));
await tester.pumpWidget(build());
expect(find.text('onetwothree'), findsOneWidget);
diff --git a/packages/flutter/test/material/flexible_space_bar_test.dart b/packages/flutter/test/material/flexible_space_bar_test.dart
index 43b264e..b705d13 100644
--- a/packages/flutter/test/material/flexible_space_bar_test.dart
+++ b/packages/flutter/test/material/flexible_space_bar_test.dart
@@ -13,7 +13,7 @@
home: new Scaffold(
appBar: new AppBar(
flexibleSpace: new FlexibleSpaceBar(
- title: new Text('X')
+ title: const Text('X')
)
)
)
@@ -34,7 +34,7 @@
home: new Scaffold(
appBar: new AppBar(
flexibleSpace: new FlexibleSpaceBar(
- title: new Text('X')
+ title: const Text('X')
)
)
)
diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart
index cf8ba7d..5017271 100644
--- a/packages/flutter/test/material/floating_action_button_test.dart
+++ b/packages/flutter/test/material/floating_action_button_test.dart
@@ -15,7 +15,7 @@
onPressed: () {
didPressButton = true;
},
- child: new Icon(Icons.add),
+ child: const Icon(Icons.add),
),
),
);
@@ -29,10 +29,10 @@
await tester.pumpWidget(
new MaterialApp(
home: new Scaffold(
- floatingActionButton: new FloatingActionButton(
+ floatingActionButton: const FloatingActionButton(
onPressed: null,
tooltip: 'Add',
- child: new Icon(Icons.add),
+ child: const Icon(Icons.add),
),
),
),
diff --git a/packages/flutter/test/material/grid_title_test.dart b/packages/flutter/test/material/grid_title_test.dart
index eb6c58c..b64b7e4 100644
--- a/packages/flutter/test/material/grid_title_test.dart
+++ b/packages/flutter/test/material/grid_title_test.dart
@@ -13,10 +13,10 @@
await tester.pumpWidget(new GridTile(
header: new GridTileBar(
key: headerKey,
- leading: new Icon(Icons.thumb_up),
- title: new Text('Header'),
- subtitle: new Text('Subtitle'),
- trailing: new Icon(Icons.thumb_up),
+ leading: const Icon(Icons.thumb_up),
+ title: const Text('Header'),
+ subtitle: const Text('Subtitle'),
+ trailing: const Icon(Icons.thumb_up),
),
child: new DecoratedBox(
decoration: new BoxDecoration(
@@ -25,7 +25,7 @@
),
footer: new GridTileBar(
key: footerKey,
- title: new Text('Footer'),
+ title: const Text('Footer'),
backgroundColor: Colors.black38,
),
));
@@ -36,7 +36,7 @@
expect(tester.getBottomLeft(find.byKey(headerKey)).y,
lessThan(tester.getTopLeft(find.byKey(footerKey)).y));
- await tester.pumpWidget(new GridTile(child: new Text('Simple')));
+ await tester.pumpWidget(new GridTile(child: const Text('Simple')));
expect(find.text('Simple'), findsOneWidget);
});
diff --git a/packages/flutter/test/material/icon_button_test.dart b/packages/flutter/test/material/icon_button_test.dart
index 84e9933..e4819e6 100644
--- a/packages/flutter/test/material/icon_button_test.dart
+++ b/packages/flutter/test/material/icon_button_test.dart
@@ -26,7 +26,7 @@
child: new Center(
child: new IconButton(
onPressed: mockOnPressedFunction,
- icon: new Icon(Icons.link),
+ icon: const Icon(Icons.link),
),
),
),
@@ -46,7 +46,7 @@
child: new IconButton(
iconSize: 10.0,
onPressed: mockOnPressedFunction,
- icon: new Icon(Icons.link),
+ icon: const Icon(Icons.link),
),
),
),
@@ -64,7 +64,7 @@
iconSize: 10.0,
padding: const EdgeInsets.all(30.0),
onPressed: mockOnPressedFunction,
- icon: new Icon(Icons.link),
+ icon: const Icon(Icons.link),
),
),
),
@@ -81,7 +81,7 @@
child: new IconButton(
padding: EdgeInsets.zero,
onPressed: mockOnPressedFunction,
- icon: new Icon(Icons.ac_unit),
+ icon: const Icon(Icons.ac_unit),
iconSize: 80.0,
),
),
@@ -102,7 +102,7 @@
children: <Widget> [
new IconButton(
onPressed: mockOnPressedFunction,
- icon: new Icon(Icons.ac_unit),
+ icon: const Icon(Icons.ac_unit),
),
],
),
@@ -119,7 +119,7 @@
child: new Center(
child: new IconButton(
onPressed: mockOnPressedFunction,
- icon: new Icon(Icons.ac_unit),
+ icon: const Icon(Icons.ac_unit),
iconSize: 80.0,
),
),
@@ -137,7 +137,7 @@
child: new Center(
child: new IconButton(
onPressed: mockOnPressedFunction,
- icon: new Icon(Icons.ac_unit),
+ icon: const Icon(Icons.ac_unit),
),
),
),
@@ -155,7 +155,7 @@
child: new Center(
child: new IconButton(
onPressed: mockOnPressedFunction,
- icon: new Icon(Icons.ac_unit),
+ icon: const Icon(Icons.ac_unit),
tooltip: 'Test tooltip',
),
),
@@ -178,7 +178,7 @@
new IconButton(
padding: EdgeInsets.zero,
onPressed: mockOnPressedFunction,
- icon: new Icon(Icons.ac_unit),
+ icon: const Icon(Icons.ac_unit),
),
],
),
diff --git a/packages/flutter/test/material/icon_test.dart b/packages/flutter/test/material/icon_test.dart
index 9af85bd..687c60d 100644
--- a/packages/flutter/test/material/icon_test.dart
+++ b/packages/flutter/test/material/icon_test.dart
@@ -10,7 +10,7 @@
void main() {
testWidgets('Icon sizing - no theme, default size', (WidgetTester tester) async {
await tester.pumpWidget(
- new Center(
+ const Center(
child: const Icon(null),
),
);
@@ -21,7 +21,7 @@
testWidgets('Icon sizing - no theme, explicit size', (WidgetTester tester) async {
await tester.pumpWidget(
- new Center(
+ const Center(
child: const Icon(
null,
size: 96.0,
@@ -81,7 +81,7 @@
testWidgets('Icon with custom font', (WidgetTester tester) async {
await tester.pumpWidget(
- new Center(
+ const Center(
child: const Icon(const IconData(0x41, fontFamily: 'Roboto')),
),
);
diff --git a/packages/flutter/test/material/image_icon_test.dart b/packages/flutter/test/material/image_icon_test.dart
index bac85ca..bf14f05 100644
--- a/packages/flutter/test/material/image_icon_test.dart
+++ b/packages/flutter/test/material/image_icon_test.dart
@@ -15,7 +15,7 @@
void main() {
testWidgets('ImageIcon sizing - no theme, default size', (WidgetTester tester) async {
await tester.pumpWidget(
- new Center(
+ const Center(
child: const ImageIcon(_kImage)
)
);
@@ -42,7 +42,7 @@
testWidgets('ImageIcon sizing - no theme, explicit size', (WidgetTester tester) async {
await tester.pumpWidget(
- new Center(
+ const Center(
child: const ImageIcon(
null,
size: 96.0
diff --git a/packages/flutter/test/material/ink_paint_test.dart b/packages/flutter/test/material/ink_paint_test.dart
index 115cfae..9b7f4e2 100644
--- a/packages/flutter/test/material/ink_paint_test.dart
+++ b/packages/flutter/test/material/ink_paint_test.dart
@@ -10,8 +10,8 @@
void main() {
testWidgets('Does the ink widget render a border radius', (WidgetTester tester) async {
- final Color highlightColor = new Color(0xAAFF0000);
- final Color splashColor = new Color(0xAA0000FF);
+ final Color highlightColor = const Color(0xAAFF0000);
+ final Color splashColor = const Color(0xAA0000FF);
final BorderRadius borderRadius = new BorderRadius.circular(6.0);
await tester.pumpWidget(
@@ -34,16 +34,16 @@
final Point center = tester.getCenter(find.byType(InkWell));
final TestGesture gesture = await tester.startGesture(center);
await tester.pump(); // start gesture
- await tester.pump(new Duration(milliseconds: 200)); // wait for splash to be well under way
+ await tester.pump(const Duration(milliseconds: 200)); // wait for splash to be well under way
final RenderBox box = Material.of(tester.element(find.byType(InkWell))) as dynamic;
expect(
box,
paints
- ..clipRRect(rrect: new RRect.fromLTRBR(300.0, 270.0, 500.0, 330.0, new Radius.circular(6.0)))
+ ..clipRRect(rrect: new RRect.fromLTRBR(300.0, 270.0, 500.0, 330.0, const Radius.circular(6.0)))
..circle(x: 400.0, y: 300.0, radius: 21.0, color: splashColor)
..rrect(
- rrect: new RRect.fromLTRBR(300.0, 270.0, 500.0, 330.0, new Radius.circular(6.0)),
+ rrect: new RRect.fromLTRBR(300.0, 270.0, 500.0, 330.0, const Radius.circular(6.0)),
color: highlightColor,
)
);
diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart
index cb16959..068f6a0 100644
--- a/packages/flutter/test/material/list_tile_test.dart
+++ b/packages/flutter/test/material/list_tile_test.dart
@@ -18,7 +18,7 @@
@override
Widget build(BuildContext context) {
iconTheme = IconTheme.of(context);
- return new Icon(Icons.add);
+ return const Icon(Icons.add);
}
}
@@ -53,10 +53,10 @@
home: new Material(
child: new Center(
child: new ListTile(
- leading: new Text('leading'),
- title: new Text('title'),
- subtitle: hasSubtitle ? new Text('subtitle') : null,
- trailing: new Text('trailing'),
+ leading: const Text('leading'),
+ title: const Text('title'),
+ subtitle: hasSubtitle ? const Text('subtitle') : null,
+ trailing: const Text('trailing'),
dense: dense,
isThreeLine: isThreeLine,
),
diff --git a/packages/flutter/test/material/modal_bottom_sheet_test.dart b/packages/flutter/test/material/modal_bottom_sheet_test.dart
index 2582b25..7f12d2e 100644
--- a/packages/flutter/test/material/modal_bottom_sheet_test.dart
+++ b/packages/flutter/test/material/modal_bottom_sheet_test.dart
@@ -25,7 +25,7 @@
bool showBottomSheetThenCalled = false;
showModalBottomSheet<Null>(
context: savedContext,
- builder: (BuildContext context) => new Text('BottomSheet')
+ builder: (BuildContext context) => const Text('BottomSheet')
).then<Null>((Null result) {
expectSync(result, isNull);
showBottomSheetThenCalled = true;
@@ -47,7 +47,7 @@
showBottomSheetThenCalled = false;
showModalBottomSheet<Null>(
context: savedContext,
- builder: (BuildContext context) => new Text('BottomSheet'),
+ builder: (BuildContext context) => const Text('BottomSheet'),
).then<Null>((Null result) {
expectSync(result, isNull);
showBottomSheetThenCalled = true;
@@ -73,7 +73,7 @@
await tester.pumpWidget(new MaterialApp(
home: new Scaffold(
key: scaffoldKey,
- body: new Center(child: new Text('body'))
+ body: const Center(child: const Text('body'))
)
));
@@ -83,7 +83,7 @@
scaffoldKey.currentState.showBottomSheet<Null>((BuildContext context) {
return new Container(
margin: const EdgeInsets.all(40.0),
- child: new Text('BottomSheet')
+ child: const Text('BottomSheet')
);
}).closed.whenComplete(() {
showBottomSheetThenCalled = true;
@@ -126,14 +126,14 @@
await tester.pumpWidget(new MaterialApp(
home: new Scaffold(
key: scaffoldKey,
- body: new Center(child: new Text('body'))
+ body: const Center(child: const Text('body'))
)
));
scaffoldKey.currentState.showBottomSheet<Null>((BuildContext context) {
return new Container(
margin: const EdgeInsets.all(40.0),
- child: new Text('BottomSheet')
+ child: const Text('BottomSheet')
);
});
diff --git a/packages/flutter/test/material/page_test.dart b/packages/flutter/test/material/page_test.dart
index b0e9454..26ad665 100644
--- a/packages/flutter/test/material/page_test.dart
+++ b/packages/flutter/test/material/page_test.dart
@@ -10,10 +10,10 @@
await tester.pumpWidget(
new MaterialApp(
theme: new ThemeData(platform: TargetPlatform.android),
- home: new Material(child: new Text('Page 1')),
+ home: new Material(child: const Text('Page 1')),
routes: <String, WidgetBuilder>{
'/next': (BuildContext context) {
- return new Material(child: new Text('Page 2'));
+ return new Material(child: const Text('Page 2'));
},
},
)
@@ -66,10 +66,10 @@
await tester.pumpWidget(
new MaterialApp(
theme: new ThemeData(platform: TargetPlatform.iOS),
- home: new Material(child: new Text('Page 1')),
+ home: new Material(child: const Text('Page 1')),
routes: <String, WidgetBuilder>{
'/next': (BuildContext context) {
- return new Material(child: new Text('Page 2'));
+ return new Material(child: const Text('Page 2'));
},
},
)
@@ -130,7 +130,7 @@
await tester.pumpWidget(
new MaterialApp(
theme: new ThemeData(platform: TargetPlatform.iOS),
- home: new Material(child: new Text('Page 1')),
+ home: new Material(child: const Text('Page 1')),
)
);
@@ -138,7 +138,7 @@
tester.state<NavigatorState>(find.byType(Navigator)).push(new MaterialPageRoute<Null>(
builder: (BuildContext context) {
- return new Material(child: new Text('Page 2'));
+ return new Material(child: const Text('Page 2'));
},
fullscreenDialog: true,
));
@@ -191,10 +191,10 @@
await tester.pumpWidget(
new MaterialApp(
theme: new ThemeData(platform: TargetPlatform.android),
- home: new Scaffold(body: new Text('Page 1')),
+ home: new Scaffold(body: const Text('Page 1')),
routes: <String, WidgetBuilder>{
'/next': (BuildContext context) {
- return new Scaffold(body: new Text('Page 2'));
+ return new Scaffold(body: const Text('Page 2'));
},
},
)
@@ -222,10 +222,10 @@
await tester.pumpWidget(
new MaterialApp(
theme: new ThemeData(platform: TargetPlatform.iOS),
- home: new Scaffold(body: new Text('Page 1')),
+ home: new Scaffold(body: const Text('Page 1')),
routes: <String, WidgetBuilder>{
'/next': (BuildContext context) {
- return new Scaffold(body: new Text('Page 2'));
+ return new Scaffold(body: const Text('Page 2'));
},
},
)
@@ -264,13 +264,13 @@
await tester.pumpWidget(
new MaterialApp(
theme: new ThemeData(platform: TargetPlatform.iOS),
- home: new Scaffold(body: new Text('Page 1')),
+ home: new Scaffold(body: const Text('Page 1')),
)
);
tester.state<NavigatorState>(find.byType(Navigator)).push(new MaterialPageRoute<Null>(
builder: (BuildContext context) {
- return new Scaffold(body: new Text('Page 2'));
+ return new Scaffold(body: const Text('Page 2'));
},
fullscreenDialog: true,
));
diff --git a/packages/flutter/test/material/paginated_data_table_test.dart b/packages/flutter/test/material/paginated_data_table_test.dart
index 4398d6b..b8c403b 100644
--- a/packages/flutter/test/material/paginated_data_table_test.dart
+++ b/packages/flutter/test/material/paginated_data_table_test.dart
@@ -49,7 +49,7 @@
await tester.pumpWidget(new MaterialApp(
home: new PaginatedDataTable(
- header: new Text('Test table'),
+ header: const Text('Test table'),
source: source,
rowsPerPage: 2,
availableRowsPerPage: <int>[
@@ -62,9 +62,9 @@
log.add('page-changed: $rowIndex');
},
columns: <DataColumn>[
- new DataColumn(label: new Text('Name')),
- new DataColumn(label: new Text('Calories'), numeric: true),
- new DataColumn(label: new Text('Generation')),
+ const DataColumn(label: const Text('Name')),
+ const DataColumn(label: const Text('Calories'), numeric: true),
+ const DataColumn(label: const Text('Generation')),
],
)
));
@@ -113,32 +113,32 @@
Widget buildTable(TestDataSource source) {
return new PaginatedDataTable(
- header: new Text('Test table'),
+ header: const Text('Test table'),
source: source,
onPageChanged: (int rowIndex) {
log.add('page-changed: $rowIndex');
},
columns: <DataColumn>[
- new DataColumn(
- label: new Text('Name'),
+ const DataColumn(
+ label: const Text('Name'),
tooltip: 'Name',
),
new DataColumn(
- label: new Text('Calories'),
+ label: const Text('Calories'),
tooltip: 'Calories',
numeric: true,
onSort: (int columnIndex, bool ascending) {
log.add('column-sort: $columnIndex $ascending');
}
),
- new DataColumn(
- label: new Text('Generation'),
+ const DataColumn(
+ label: const Text('Generation'),
tooltip: 'Generation',
),
],
actions: <Widget>[
new IconButton(
- icon: new Icon(Icons.adjust),
+ icon: const Icon(Icons.adjust),
onPressed: () {
log.add('action: adjust');
},
diff --git a/packages/flutter/test/material/persistent_bottom_sheet_test.dart b/packages/flutter/test/material/persistent_bottom_sheet_test.dart
index 329eb44..b53159c 100644
--- a/packages/flutter/test/material/persistent_bottom_sheet_test.dart
+++ b/packages/flutter/test/material/persistent_bottom_sheet_test.dart
@@ -14,7 +14,7 @@
await tester.pumpWidget(new MaterialApp(
home: new Scaffold(
key: scaffoldKey,
- body: new Center(child: new Text('body'))
+ body: const Center(child: const Text('body'))
)
));
@@ -41,7 +41,7 @@
await tester.pumpWidget(new MaterialApp(
home: new Scaffold(
key: scaffoldKey,
- body: new Center(child: new Text('body'))
+ body: const Center(child: const Text('body'))
)
));
@@ -49,9 +49,9 @@
return new ListView(
shrinkWrap: true,
children: <Widget>[
- new Container(height: 100.0, child: new Text('One')),
- new Container(height: 100.0, child: new Text('Two')),
- new Container(height: 100.0, child: new Text('Three')),
+ new Container(height: 100.0, child: const Text('One')),
+ new Container(height: 100.0, child: const Text('Two')),
+ new Container(height: 100.0, child: const Text('Three')),
],
);
});
diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart
index 844b84b..f0e484f 100644
--- a/packages/flutter/test/material/popup_menu_test.dart
+++ b/packages/flutter/test/material/popup_menu_test.dart
@@ -11,7 +11,7 @@
new MaterialApp(
routes: <String, WidgetBuilder> {
'/next': (BuildContext context) {
- return new Text('Next');
+ return const Text('Next');
}
},
home: new Material(
@@ -26,7 +26,7 @@
return <PopupMenuItem<int>>[
new PopupMenuItem<int>(
value: 1,
- child: new Text('One')
+ child: const Text('One')
)
];
}
diff --git a/packages/flutter/test/material/refresh_indicator_test.dart b/packages/flutter/test/material/refresh_indicator_test.dart
index eb2c248..819ad01 100644
--- a/packages/flutter/test/material/refresh_indicator_test.dart
+++ b/packages/flutter/test/material/refresh_indicator_test.dart
@@ -54,9 +54,9 @@
reverse: true,
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
- new SizedBox(
+ const SizedBox(
height: 200.0,
- child: new Text('X'),
+ child: const Text('X'),
),
],
),
@@ -79,9 +79,9 @@
child: new ListView(
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
- new SizedBox(
+ const SizedBox(
height: 200.0,
- child: new Text('X'),
+ child: const Text('X'),
),
],
),
@@ -104,9 +104,9 @@
reverse: true,
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
- new SizedBox(
+ const SizedBox(
height: 200.0,
- child: new Text('X'),
+ child: const Text('X'),
),
],
),
@@ -128,9 +128,9 @@
child: new ListView(
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
- new SizedBox(
+ const SizedBox(
height: 200.0,
- child: new Text('X'),
+ child: const Text('X'),
),
],
),
@@ -154,9 +154,9 @@
child: new ListView(
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
- new SizedBox(
+ const SizedBox(
height: 200.0,
- child: new Text('X'),
+ child: const Text('X'),
),
],
),
@@ -179,9 +179,9 @@
child: new ListView(
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
- new SizedBox(
+ const SizedBox(
height: 200.0,
- child: new Text('X'),
+ child: const Text('X'),
),
],
),
@@ -220,9 +220,9 @@
child: new ListView(
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
- new SizedBox(
+ const SizedBox(
height: 200.0,
- child: new Text('X'),
+ child: const Text('X'),
),
],
),
@@ -262,9 +262,9 @@
child: new ListView(
physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[
- new SizedBox(
+ const SizedBox(
height: 200.0,
- child: new Text('X'),
+ child: const Text('X'),
),
],
),
diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart
index 8d55572..ea41333 100644
--- a/packages/flutter/test/material/scaffold_test.dart
+++ b/packages/flutter/test/material/scaffold_test.dart
@@ -10,7 +10,7 @@
testWidgets('Scaffold control test', (WidgetTester tester) async {
final Key bodyKey = new UniqueKey();
await tester.pumpWidget(new Scaffold(
- appBar: new AppBar(title: new Text('Title')),
+ appBar: new AppBar(title: const Text('Title')),
body: new Container(key: bodyKey)
));
@@ -20,7 +20,7 @@
await tester.pumpWidget(new MediaQuery(
data: const MediaQueryData(padding: const EdgeInsets.only(bottom: 100.0)),
child: new Scaffold(
- appBar: new AppBar(title: new Text('Title')),
+ appBar: new AppBar(title: const Text('Title')),
body: new Container(key: bodyKey)
)
));
@@ -31,7 +31,7 @@
await tester.pumpWidget(new MediaQuery(
data: const MediaQueryData(padding: const EdgeInsets.only(bottom: 100.0)),
child: new Scaffold(
- appBar: new AppBar(title: new Text('Title')),
+ appBar: new AppBar(title: const Text('Title')),
body: new Container(key: bodyKey),
resizeToAvoidBottomPadding: false
)
@@ -72,7 +72,7 @@
),
child: new Scaffold(
appBar: new AppBar(
- title: new Text('Title'),
+ title: const Text('Title'),
),
body: new Container(key: bodyKey),
),
@@ -83,20 +83,20 @@
testWidgets('Floating action animation', (WidgetTester tester) async {
await tester.pumpWidget(new Scaffold(
- floatingActionButton: new FloatingActionButton(
+ floatingActionButton: const FloatingActionButton(
key: const Key('one'),
onPressed: null,
- child: new Text("1")
+ child: const Text("1")
)
));
expect(tester.binding.transientCallbackCount, 0);
await tester.pumpWidget(new Scaffold(
- floatingActionButton: new FloatingActionButton(
+ floatingActionButton: const FloatingActionButton(
key: const Key('two'),
onPressed: null,
- child: new Text("2")
+ child: const Text("2")
)
));
@@ -107,10 +107,10 @@
expect(tester.binding.transientCallbackCount, 0);
await tester.pumpWidget(new Scaffold(
- floatingActionButton: new FloatingActionButton(
+ floatingActionButton: const FloatingActionButton(
key: const Key('one'),
onPressed: null,
- child: new Text("1")
+ child: const Text("1")
)
));
@@ -140,8 +140,8 @@
new SliverAppBar(
pinned: true,
expandedHeight: appBarHeight,
- title: new Text('Title'),
- flexibleSpace: new FlexibleSpaceBar(title: new Text('Title')),
+ title: const Text('Title'),
+ flexibleSpace: new FlexibleSpaceBar(title: const Text('Title')),
),
new SliverPadding(
padding: const EdgeInsets.only(top: appBarHeight),
@@ -185,7 +185,7 @@
primary: true,
slivers: <Widget>[
new SliverAppBar(
- title: new Text('Title')
+ title: const Text('Title')
),
new SliverList(
delegate: new SliverChildListDelegate(new List<Widget>.generate(
@@ -228,7 +228,7 @@
theme: new ThemeData(platform: TargetPlatform.android),
home: new Scaffold(
appBar: new AppBar(
- title: new Text('Title'),
+ title: const Text('Title'),
),
body: new Builder(
builder: (BuildContext context) {
@@ -241,7 +241,7 @@
);
});
},
- child: new Text('X'),
+ child: const Text('X'),
);
},
),
@@ -273,7 +273,7 @@
backgroundColor: Colors.amber[500],
),
height: 5000.0,
- child: new Text('body'),
+ child: const Text('body'),
),
),
persistentFooterButtons: <Widget>[
@@ -281,7 +281,7 @@
onPressed: () {
didPressButton = true;
},
- child: new Text('X'),
+ child: const Text('X'),
)
],
),
@@ -298,10 +298,10 @@
Future<Null> expectBackIcon(WidgetTester tester, TargetPlatform platform, IconData expectedIcon) async {
final GlobalKey rootKey = new GlobalKey();
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
- '/': (_) => new Container(key: rootKey, child: new Text('Home')),
+ '/': (_) => new Container(key: rootKey, child: const Text('Home')),
'/scaffold': (_) => new Scaffold(
appBar: new AppBar(),
- body: new Text('Scaffold'),
+ body: const Text('Scaffold'),
)
};
await tester.pumpWidget(
@@ -360,7 +360,7 @@
testWidgets('body size with button', (WidgetTester tester) async {
final Key testKey = new UniqueKey();
await tester.pumpWidget(
- new Scaffold(body: new FlatButton(key: testKey, onPressed: () { }, child: new Text('')))
+ new Scaffold(body: new FlatButton(key: testKey, onPressed: () { }, child: const Text('')))
);
expect(tester.element(find.byKey(testKey)).size, const Size(88.0, 36.0));
expect(tester.renderObject<RenderBox>(find.byKey(testKey)).localToGlobal(Point.origin), const Point(0.0, 0.0));
diff --git a/packages/flutter/test/material/scrollbar_test.dart b/packages/flutter/test/material/scrollbar_test.dart
index 8b1484b..da2dc08 100644
--- a/packages/flutter/test/material/scrollbar_test.dart
+++ b/packages/flutter/test/material/scrollbar_test.dart
@@ -19,14 +19,14 @@
child: new Scrollbar(
child: new ListView(
children: <Widget>[
- new Container(height: 40.0, child: new Text('0')),
- new Container(height: 40.0, child: new Text('1')),
- new Container(height: 40.0, child: new Text('2')),
- new Container(height: 40.0, child: new Text('3')),
- new Container(height: 40.0, child: new Text('4')),
- new Container(height: 40.0, child: new Text('5')),
- new Container(height: 40.0, child: new Text('6')),
- new Container(height: 40.0, child: new Text('7')),
+ new Container(height: 40.0, child: const Text('0')),
+ new Container(height: 40.0, child: const Text('1')),
+ new Container(height: 40.0, child: const Text('2')),
+ new Container(height: 40.0, child: const Text('3')),
+ new Container(height: 40.0, child: const Text('4')),
+ new Container(height: 40.0, child: const Text('5')),
+ new Container(height: 40.0, child: const Text('6')),
+ new Container(height: 40.0, child: const Text('7')),
]
)
)
diff --git a/packages/flutter/test/material/snack_bar_test.dart b/packages/flutter/test/material/snack_bar_test.dart
index 21641d8..195997a 100644
--- a/packages/flutter/test/material/snack_bar_test.dart
+++ b/packages/flutter/test/material/snack_bar_test.dart
@@ -266,7 +266,7 @@
return new GestureDetector(
onTap: () {
Scaffold.of(context).showSnackBar(new SnackBar(
- content: new Text('I am a snack bar.'),
+ content: const Text('I am a snack bar.'),
duration: const Duration(seconds: 2),
action: new SnackBarAction(
label: 'ACTION',
@@ -276,7 +276,7 @@
)
));
},
- child: new Text('X')
+ child: const Text('X')
);
}
)
@@ -304,12 +304,12 @@
return new GestureDetector(
onTap: () {
Scaffold.of(context).showSnackBar(new SnackBar(
- content: new Text('I am a snack bar.'),
+ content: const Text('I am a snack bar.'),
duration: const Duration(seconds: 2),
action: new SnackBarAction(label: 'ACTION', onPressed: () {})
));
},
- child: new Text('X')
+ child: const Text('X')
);
}
)
@@ -348,7 +348,7 @@
return new GestureDetector(
onTap: () {
Scaffold.of(context).showSnackBar(new SnackBar(
- content: new Text('snack'),
+ content: const Text('snack'),
duration: const Duration(seconds: 2),
action: new SnackBarAction(
label: 'ACTION',
@@ -360,7 +360,7 @@
closedReason = reason;
});
},
- child: new Text('X')
+ child: const Text('X')
);
},
)
diff --git a/packages/flutter/test/material/stepper_test.dart b/packages/flutter/test/material/stepper_test.dart
index 1ddafd2..3b977d7 100644
--- a/packages/flutter/test/material/stepper_test.dart
+++ b/packages/flutter/test/material/stepper_test.dart
@@ -17,14 +17,14 @@
},
steps: <Step>[
new Step(
- title: new Text('Step 1'),
+ title: const Text('Step 1'),
content: const SizedBox(
width: 100.0,
height: 100.0
)
),
new Step(
- title: new Text('Step 2'),
+ title: const Text('Step 2'),
content: const SizedBox(
width: 100.0,
height: 100.0
@@ -45,14 +45,14 @@
child: new Stepper(
steps: <Step>[
new Step(
- title: new Text('Step 1'),
+ title: const Text('Step 1'),
content: const SizedBox(
width: 100.0,
height: 100.0
)
),
new Step(
- title: new Text('Step 2'),
+ title: const Text('Step 2'),
content: const SizedBox(
width: 200.0,
height: 200.0
@@ -74,14 +74,14 @@
currentStep: 1,
steps: <Step>[
new Step(
- title: new Text('Step 1'),
+ title: const Text('Step 1'),
content: const SizedBox(
width: 100.0,
height: 100.0
)
),
new Step(
- title: new Text('Step 2'),
+ title: const Text('Step 2'),
content: const SizedBox(
width: 200.0,
height: 200.0
@@ -109,7 +109,7 @@
type: StepperType.horizontal,
steps: <Step>[
new Step(
- title: new Text('Step 1'),
+ title: const Text('Step 1'),
content: const SizedBox(
width: 100.0,
height: 100.0
@@ -132,12 +132,12 @@
type: StepperType.horizontal,
steps: <Step>[
new Step(
- title: new Text('Step 1'),
- content: new Text('A')
+ title: const Text('Step 1'),
+ content: const Text('A')
),
new Step(
- title: new Text('Step 2'),
- content: new Text('B')
+ title: const Text('Step 2'),
+ content: const Text('B')
)
]
)
@@ -154,12 +154,12 @@
type: StepperType.horizontal,
steps: <Step>[
new Step(
- title: new Text('Step 1'),
- content: new Text('A')
+ title: const Text('Step 1'),
+ content: const Text('A')
),
new Step(
- title: new Text('Step 2'),
- content: new Text('B')
+ title: const Text('Step 2'),
+ content: const Text('B')
)
]
)
@@ -186,14 +186,14 @@
},
steps: <Step>[
new Step(
- title: new Text('Step 1'),
+ title: const Text('Step 1'),
content: const SizedBox(
width: 100.0,
height: 100.0
)
),
new Step(
- title: new Text('Step 2'),
+ title: const Text('Step 2'),
content: const SizedBox(
width: 200.0,
height: 200.0
@@ -222,14 +222,14 @@
},
steps: <Step>[
new Step(
- title: new Text('Step 1'),
+ title: const Text('Step 1'),
content: const SizedBox(
width: 100.0,
height: 100.0
)
),
new Step(
- title: new Text('Step 2'),
+ title: const Text('Step 2'),
state: StepState.disabled,
content: const SizedBox(
width: 100.0,
@@ -251,21 +251,21 @@
child: new Stepper(
steps: <Step>[
new Step(
- title: new Text('Step 1'),
+ title: const Text('Step 1'),
content: const SizedBox(
width: 100.0,
height: 300.0
)
),
new Step(
- title: new Text('Step 2'),
+ title: const Text('Step 2'),
content: const SizedBox(
width: 100.0,
height: 300.0
)
),
new Step(
- title: new Text('Step 3'),
+ title: const Text('Step 3'),
content: const SizedBox(
width: 100.0,
height: 100.0
@@ -286,21 +286,21 @@
currentStep: 2,
steps: <Step>[
new Step(
- title: new Text('Step 1'),
+ title: const Text('Step 1'),
content: const SizedBox(
width: 100.0,
height: 300.0
)
),
new Step(
- title: new Text('Step 2'),
+ title: const Text('Step 2'),
content: const SizedBox(
width: 100.0,
height: 300.0
)
),
new Step(
- title: new Text('Step 3'),
+ title: const Text('Step 3'),
content: const SizedBox(
width: 100.0,
height: 100.0
@@ -322,7 +322,7 @@
child: new Stepper(
steps: <Step>[
new Step(
- title: new Text('A'),
+ title: const Text('A'),
state: StepState.complete,
content: const SizedBox(
width: 100.0,
@@ -330,7 +330,7 @@
)
),
new Step(
- title: new Text('B'),
+ title: const Text('B'),
content: const SizedBox(
width: 100.0,
height: 100.0
@@ -353,7 +353,7 @@
child: new Stepper(
steps: <Step>[
new Step(
- title: new Text('A'),
+ title: const Text('A'),
state: StepState.error,
content: const SizedBox(
width: 100.0,
diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart
index 09ee174..932373f 100644
--- a/packages/flutter/test/material/tabs_test.dart
+++ b/packages/flutter/test/material/tabs_test.dart
@@ -95,15 +95,15 @@
length: tabs.length,
child: new Scaffold(
appBar: new AppBar(
- title: new Text('tabs'),
+ title: const Text('tabs'),
bottom: new TabBar(
tabs: tabs.map((String tab) => new Tab(text: tab)).toList(),
),
),
body: new TabBarView(
children: <Widget>[
- new Center(child: new Text('LEFT CHILD')),
- new Center(child: new Text('RIGHT CHILD'))
+ const Center(child: const Text('LEFT CHILD')),
+ const Center(child: const Text('RIGHT CHILD'))
]
)
)
@@ -419,7 +419,7 @@
length: tabs.length,
child: new Scaffold(
appBar: new AppBar(
- title: new Text('tabs'),
+ title: const Text('tabs'),
bottom: new TabBar(
isScrollable: true,
tabs: tabs.map((String tab) => new Tab(text: tab)).toList(),
@@ -486,7 +486,7 @@
theme: new ThemeData(platform: TargetPlatform.android),
home: new Scaffold(
appBar: new AppBar(
- title: new Text('tabs'),
+ title: const Text('tabs'),
bottom: new TabBar(
controller: controller,
tabs: tabs.map((String tab) => new Tab(text: tab)).toList(),
@@ -495,8 +495,8 @@
body: new TabBarView(
controller: controller,
children: <Widget>[
- new Center(child: new Text('LEFT CHILD')),
- new Center(child: new Text('RIGHT CHILD'))
+ const Center(child: const Text('LEFT CHILD')),
+ const Center(child: const Text('RIGHT CHILD'))
]
),
),
@@ -545,7 +545,7 @@
theme: new ThemeData(platform: TargetPlatform.android),
home: new Scaffold(
appBar: new AppBar(
- title: new Text('tabs'),
+ title: const Text('tabs'),
bottom: new TabBar(
controller: controller,
tabs: tabs.map((String tab) => new Tab(text: tab)).toList(),
@@ -554,9 +554,9 @@
body: new TabBarView(
controller: controller,
children: <Widget>[
- new Center(child: new Text('CHILD A')),
- new Center(child: new Text('CHILD B')),
- new Center(child: new Text('CHILD C')),
+ const Center(child: const Text('CHILD A')),
+ const Center(child: const Text('CHILD B')),
+ const Center(child: const Text('CHILD C')),
]
),
),
@@ -618,13 +618,13 @@
new Builder(
builder: (BuildContext context) {
firstColor = IconTheme.of(context).color;
- return new Text('First');
+ return const Text('First');
}
),
new Builder(
builder: (BuildContext context) {
secondColor = IconTheme.of(context).color;
- return new Text('Second');
+ return const Text('Second');
}
),
],
@@ -646,7 +646,7 @@
new Material(
child: new TabBarView(
controller: controller,
- children: <Widget>[ new Text('First'), new Text('Second') ],
+ children: <Widget>[ const Text('First'), const Text('Second') ],
),
),
);
@@ -745,7 +745,7 @@
child: new TabBar(
key: new UniqueKey(),
controller: controller,
- tabs: <Widget>[ new Text('A'), new Text('B') ],
+ tabs: <Widget>[ const Text('A'), const Text('B') ],
),
);
}
diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart
index 4d10e7b..412aafc 100644
--- a/packages/flutter/test/material/text_field_test.dart
+++ b/packages/flutter/test/material/text_field_test.dart
@@ -83,7 +83,7 @@
child: new Material(
child: new TextField(
key: textFieldKey,
- decoration: new InputDecoration(
+ decoration: const InputDecoration(
hintText: 'Placeholder',
),
onChanged: (String value) {
@@ -125,7 +125,7 @@
return new Center(
child: new Material(
child: new TextField(
- decoration: new InputDecoration(
+ decoration: const InputDecoration(
hintText: 'Placeholder',
),
),
@@ -170,7 +170,7 @@
child: new Material(
child: new TextField(
obscureText: true,
- decoration: new InputDecoration(
+ decoration: const InputDecoration(
hintText: 'Placeholder',
),
),
@@ -434,7 +434,7 @@
key: textFieldKey,
style: const TextStyle(color: Colors.black, fontSize: 34.0),
maxLines: maxLines,
- decoration: new InputDecoration(
+ decoration: const InputDecoration(
hintText: 'Placeholder',
),
),
@@ -679,7 +679,7 @@
child: new Material(
child: new TextField(
key: textFieldKey,
- decoration: new InputDecoration(
+ decoration: const InputDecoration(
hintText: 'Placeholder',
),
onChanged: (String value) { textFieldValue = value; },
@@ -717,7 +717,7 @@
data: themeData,
child: new Material(
child: new TextField(
- decoration: new InputDecoration(
+ decoration: const InputDecoration(
hintText: 'Placeholder',
),
style: style,
@@ -768,13 +768,13 @@
child: new Column(
children: <Widget>[
new TextField(
- decoration: new InputDecoration(
+ decoration: const InputDecoration(
labelText: 'First',
),
),
new TextField(
key: secondKey,
- decoration: new InputDecoration(
+ decoration: const InputDecoration(
labelText: 'Second',
),
),
@@ -810,8 +810,8 @@
new Center(
child: new Material(
child: new TextField(
- decoration: new InputDecoration(
- icon: new Icon(Icons.phone),
+ decoration: const InputDecoration(
+ icon: const Icon(Icons.phone),
labelText: 'label',
),
),
@@ -829,7 +829,7 @@
overlay(new Center(
child: new Material(
child: new TextField(
- decoration: new InputDecoration.collapsed(
+ decoration: const InputDecoration.collapsed(
hintText: 'hint',
),
),
@@ -857,7 +857,7 @@
final RenderEditable editable = findRenderEditable(tester);
Point topLeft = editable.localToGlobal(
- editable.getLocalRectForCaret(new TextPosition(offset: 0)).topLeft
+ editable.getLocalRectForCaret(const TextPosition(offset: 0)).topLeft
);
expect(topLeft.x, equals(399.0));
@@ -866,7 +866,7 @@
await tester.pump();
topLeft = editable.localToGlobal(
- editable.getLocalRectForCaret(new TextPosition(offset: 2)).topLeft
+ editable.getLocalRectForCaret(const TextPosition(offset: 2)).topLeft
);
expect(topLeft.x, equals(399.0));
@@ -891,7 +891,7 @@
final RenderEditable editable = findRenderEditable(tester);
Point topLeft = editable.localToGlobal(
- editable.getLocalRectForCaret(new TextPosition(offset: 0)).topLeft
+ editable.getLocalRectForCaret(const TextPosition(offset: 0)).topLeft
);
expect(topLeft.x, equals(399.0));
@@ -900,7 +900,7 @@
await tester.pump();
topLeft = editable.localToGlobal(
- editable.getLocalRectForCaret(new TextPosition(offset: 2)).topLeft
+ editable.getLocalRectForCaret(const TextPosition(offset: 2)).topLeft
);
expect(topLeft.x, equals(399.0));
diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart
index 9566d68..5d9d5e0 100644
--- a/packages/flutter/test/material/theme_test.dart
+++ b/packages/flutter/test/material/theme_test.dart
@@ -25,7 +25,7 @@
key: popupMenuButtonKey,
itemBuilder: (BuildContext context) {
return <PopupMenuItem<String>>[
- new PopupMenuItem<String>(child: new Text('menuItem'))
+ new PopupMenuItem<String>(child: const Text('menuItem'))
];
}
),
@@ -71,7 +71,7 @@
key: popupMenuButtonKey,
itemBuilder: (BuildContext context) {
return <PopupMenuItem<String>>[
- new PopupMenuItem<String>(child: new Text('menuItem'))
+ new PopupMenuItem<String>(child: const Text('menuItem'))
];
}
),
@@ -105,7 +105,7 @@
items: <DropdownMenuItem<String>>[
new DropdownMenuItem<String>(
value: 'menuItem',
- child: new Text('menuItem'),
+ child: const Text('menuItem'),
),
],
)
@@ -137,10 +137,10 @@
onPressed: () {
showModalBottomSheet<Null>(
context: context,
- builder: (BuildContext context) => new Text('bottomSheet'),
+ builder: (BuildContext context) => const Text('bottomSheet'),
);
},
- child: new Text('SHOW'),
+ child: const Text('SHOW'),
);
}
)
@@ -174,10 +174,10 @@
onPressed: () {
showDialog<Null>(
context: context,
- child: new Text('dialog'),
+ child: const Text('dialog'),
);
},
- child: new Text('SHOW'),
+ child: const Text('SHOW'),
);
}
)
@@ -214,7 +214,7 @@
)
);
},
- child: new Text('SHOW'),
+ child: const Text('SHOW'),
);
},
),
diff --git a/packages/flutter/test/material/time_picker_test.dart b/packages/flutter/test/material/time_picker_test.dart
index 6f210fd..d1dd701 100644
--- a/packages/flutter/test/material/time_picker_test.dart
+++ b/packages/flutter/test/material/time_picker_test.dart
@@ -19,7 +19,7 @@
child: new Builder(
builder: (BuildContext context) {
return new RaisedButton(
- child: new Text('X'),
+ child: const Text('X'),
onPressed: () async {
onChanged(await showTimePicker(
context: context,
diff --git a/packages/flutter/test/material/two_level_list_test.dart b/packages/flutter/test/material/two_level_list_test.dart
index 232b7c1..0cad958 100644
--- a/packages/flutter/test/material/two_level_list_test.dart
+++ b/packages/flutter/test/material/two_level_list_test.dart
@@ -16,7 +16,7 @@
child: new TwoLevelList(
children: <Widget>[
new TwoLevelSublist(
- title: new Text('Title'),
+ title: const Text('Title'),
)
]
)
@@ -36,16 +36,16 @@
child: new SingleChildScrollView(
child: new TwoLevelList(
children: <Widget>[
- new TwoLevelListItem(title: new Text('Top'), key: topKey),
+ new TwoLevelListItem(title: const Text('Top'), key: topKey),
new TwoLevelSublist(
key: sublistKey,
- title: new Text('Sublist'),
+ title: const Text('Sublist'),
children: <Widget>[
- new TwoLevelListItem(title: new Text('0')),
- new TwoLevelListItem(title: new Text('1'))
+ new TwoLevelListItem(title: const Text('0')),
+ new TwoLevelListItem(title: const Text('1'))
]
),
- new TwoLevelListItem(title: new Text('Bottom'), key: bottomKey)
+ new TwoLevelListItem(title: const Text('Bottom'), key: bottomKey)
]
)
)
@@ -95,13 +95,13 @@
child: new TwoLevelList(
children: <Widget>[
new TwoLevelSublist(
- title: new Text('Sublist'),
+ title: const Text('Sublist'),
onOpenChanged: (bool opened) {
didChangeOpen = opened;
},
children: <Widget>[
- new TwoLevelListItem(title: new Text('0')),
- new TwoLevelListItem(title: new Text('1'))
+ new TwoLevelListItem(title: const Text('0')),
+ new TwoLevelListItem(title: const Text('1'))
]
),
]
diff --git a/packages/flutter/test/material/user_accounts_drawer_header_test.dart b/packages/flutter/test/material/user_accounts_drawer_header_test.dart
index 83c8fae..79008f2 100644
--- a/packages/flutter/test/material/user_accounts_drawer_header_test.dart
+++ b/packages/flutter/test/material/user_accounts_drawer_header_test.dart
@@ -18,26 +18,26 @@
child: new UserAccountsDrawerHeader(
currentAccountPicture: new CircleAvatar(
key: avatarA,
- child: new Text('A'),
+ child: const Text('A'),
),
otherAccountsPictures: <Widget>[
new CircleAvatar(
- child: new Text('B'),
+ child: const Text('B'),
),
new CircleAvatar(
key: avatarC,
- child: new Text('C'),
+ child: const Text('C'),
),
new CircleAvatar(
key: avatarD,
- child: new Text('D'),
+ child: const Text('D'),
),
new CircleAvatar(
- child: new Text('E'),
+ child: const Text('E'),
)
],
- accountName: new Text("name"),
- accountEmail: new Text("email"),
+ accountName: const Text("name"),
+ accountEmail: const Text("email"),
),
),
),
@@ -112,7 +112,7 @@
expect(find.byType(Icon), findsOneWidget);
await tester.pumpWidget(buildFrame(
- accountName: new Text('accountName'),
+ accountName: const Text('accountName'),
onDetailsPressed: () { },
));
expect(
@@ -121,7 +121,7 @@
);
await tester.pumpWidget(buildFrame(
- accountEmail: new Text('accountEmail'),
+ accountEmail: const Text('accountEmail'),
onDetailsPressed: () { },
));
expect(
@@ -130,8 +130,8 @@
);
await tester.pumpWidget(buildFrame(
- accountName: new Text('accountName'),
- accountEmail: new Text('accountEmail'),
+ accountName: const Text('accountName'),
+ accountEmail: const Text('accountEmail'),
onDetailsPressed: () { },
));
expect(
@@ -148,19 +148,19 @@
);
await tester.pumpWidget(buildFrame(
- currentAccountPicture: new CircleAvatar(child: new Text('A')),
+ currentAccountPicture: new CircleAvatar(child: const Text('A')),
));
expect(find.text('A'), findsOneWidget);
await tester.pumpWidget(buildFrame(
- otherAccountsPictures: <Widget>[new CircleAvatar(child: new Text('A'))],
+ otherAccountsPictures: <Widget>[new CircleAvatar(child: const Text('A'))],
));
expect(find.text('A'), findsOneWidget);
final Key avatarA = const Key('A');
await tester.pumpWidget(buildFrame(
- currentAccountPicture: new CircleAvatar(key: avatarA, child: new Text('A')),
- accountName: new Text('accountName'),
+ currentAccountPicture: new CircleAvatar(key: avatarA, child: const Text('A')),
+ accountName: const Text('accountName'),
));
expect(
tester.getBottomLeft(find.byKey(avatarA)).x,
diff --git a/packages/flutter/test/material/will_pop_test.dart b/packages/flutter/test/material/will_pop_test.dart
index f63e199..27dd45b 100644
--- a/packages/flutter/test/material/will_pop_test.dart
+++ b/packages/flutter/test/material/will_pop_test.dart
@@ -34,7 +34,7 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Sample Page')),
+ appBar: new AppBar(title: const Text('Sample Page')),
);
}
}
@@ -49,7 +49,7 @@
@override
Widget build(BuildContext context) {
return new Scaffold(
- appBar: new AppBar(title: new Text('Sample Form')),
+ appBar: new AppBar(title: const Text('Sample Form')),
body: new SizedBox.expand(
child: new Form(
onWillPop: () {
@@ -77,12 +77,12 @@
await tester.pumpWidget(
new MaterialApp(
home: new Scaffold(
- appBar: new AppBar(title: new Text('Home')),
+ appBar: new AppBar(title: const Text('Home')),
body: new Builder(
builder: (BuildContext context) {
return new Center(
child: new FlatButton(
- child: new Text('X'),
+ child: const Text('X'),
onPressed: () {
showDialog<Null>(
context: context,
@@ -131,12 +131,12 @@
Widget buildFrame() {
return new MaterialApp(
home: new Scaffold(
- appBar: new AppBar(title: new Text('Home')),
+ appBar: new AppBar(title: const Text('Home')),
body: new Builder(
builder: (BuildContext context) {
return new Center(
child: new FlatButton(
- child: new Text('X'),
+ child: const Text('X'),
onPressed: () {
Navigator.of(context).push(new MaterialPageRoute<Null>(
builder: (BuildContext context) {
@@ -188,11 +188,11 @@
child: new AlertDialog(
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); },
),
],
@@ -203,12 +203,12 @@
Widget buildFrame() {
return new MaterialApp(
home: new Scaffold(
- appBar: new AppBar(title: new Text('Home')),
+ appBar: new AppBar(title: const Text('Home')),
body: new Builder(
builder: (BuildContext context) {
return new Center(
child: new FlatButton(
- child: new Text('X'),
+ child: const Text('X'),
onPressed: () {
Navigator.of(context).push(new MaterialPageRoute<Null>(
builder: (BuildContext context) {
@@ -289,12 +289,12 @@
Widget buildFrame() {
return new MaterialApp(
home: new Scaffold(
- appBar: new AppBar(title: new Text('Home')),
+ appBar: new AppBar(title: const Text('Home')),
body: new Builder(
builder: (BuildContext context) {
return new Center(
child: new FlatButton(
- child: new Text('X'),
+ child: const Text('X'),
onPressed: () {
Navigator.of(context).push(route);
},
diff --git a/packages/flutter/test/painting/text_painter_test.dart b/packages/flutter/test/painting/text_painter_test.dart
index a15760a..ef01854 100644
--- a/packages/flutter/test/painting/text_painter_test.dart
+++ b/packages/flutter/test/painting/text_painter_test.dart
@@ -36,9 +36,9 @@
test('TextPainter size test', () {
final TextPainter painter = new TextPainter(
- text: new TextSpan(
+ text: const TextSpan(
text: 'X',
- style: new TextStyle(
+ style: const TextStyle(
inherit: false,
fontFamily: 'Ahem',
fontSize: 123.0,
diff --git a/packages/flutter/test/widgets/animated_container_test.dart b/packages/flutter/test/widgets/animated_container_test.dart
index 8af0240..6f159ea 100644
--- a/packages/flutter/test/widgets/animated_container_test.dart
+++ b/packages/flutter/test/widgets/animated_container_test.dart
@@ -119,7 +119,7 @@
duration: const Duration(milliseconds: 200),
width: 100.0,
height: 100.0,
- child: new Text('X')
+ child: const Text('X')
)
)
);
@@ -139,7 +139,7 @@
duration: const Duration(milliseconds: 200),
width: 200.0,
height: 200.0,
- child: new Text('X')
+ child: const Text('X')
)
)
);
@@ -163,7 +163,7 @@
duration: const Duration(milliseconds: 200),
width: 200.0,
height: 100.0,
- child: new Text('X')
+ child: const Text('X')
)
)
);
diff --git a/packages/flutter/test/widgets/baseline_test.dart b/packages/flutter/test/widgets/baseline_test.dart
index 1744941..23216b0 100644
--- a/packages/flutter/test/widgets/baseline_test.dart
+++ b/packages/flutter/test/widgets/baseline_test.dart
@@ -8,13 +8,13 @@
void main() {
testWidgets('Baseline - control test', (WidgetTester tester) async {
await tester.pumpWidget(
- new Center(
- child: new DefaultTextStyle(
+ const Center(
+ child: const DefaultTextStyle(
style: const TextStyle(
fontFamily: 'Ahem',
fontSize: 100.0,
),
- child: new Text('X'),
+ child: const Text('X'),
),
),
);
@@ -23,16 +23,16 @@
testWidgets('Baseline - position test', (WidgetTester tester) async {
await tester.pumpWidget(
- new Center(
- child: new Baseline(
+ const Center(
+ child: const Baseline(
baseline: 180.0,
baselineType: TextBaseline.alphabetic,
- child: new DefaultTextStyle(
+ child: const DefaultTextStyle(
style: const TextStyle(
fontFamily: 'Ahem',
fontSize: 100.0,
),
- child: new Text('X'),
+ child: const Text('X'),
),
),
),
diff --git a/packages/flutter/test/widgets/center_test.dart b/packages/flutter/test/widgets/center_test.dart
index 7cdac37..4364f28 100644
--- a/packages/flutter/test/widgets/center_test.dart
+++ b/packages/flutter/test/widgets/center_test.dart
@@ -7,6 +7,6 @@
void main() {
testWidgets('Can be placed in an infinite box', (WidgetTester tester) async {
- await tester.pumpWidget(new ListView(children: <Widget>[new Center()]));
+ await tester.pumpWidget(new ListView(children: <Widget>[const Center()]));
});
}
diff --git a/packages/flutter/test/widgets/clamp_overscrolls_test.dart b/packages/flutter/test/widgets/clamp_overscrolls_test.dart
index 264b157..df9da33 100644
--- a/packages/flutter/test/widgets/clamp_overscrolls_test.dart
+++ b/packages/flutter/test/widgets/clamp_overscrolls_test.dart
@@ -20,9 +20,9 @@
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
- new SizedBox(height: 100.0, child: new Text('top')),
+ const SizedBox(height: 100.0, child: const Text('top')),
new Expanded(child: new Container()),
- new SizedBox(height: 100.0, child: new Text('bottom')),
+ const SizedBox(height: 100.0, child: const Text('bottom')),
],
),
),
diff --git a/packages/flutter/test/widgets/container_test.dart b/packages/flutter/test/widgets/container_test.dart
index 9d98899..96ec7da 100644
--- a/packages/flutter/test/widgets/container_test.dart
+++ b/packages/flutter/test/widgets/container_test.dart
@@ -23,10 +23,10 @@
maxHeight: 82.0,
),
margin: const EdgeInsets.all(5.0),
- child: new SizedBox(
+ child: const SizedBox(
width: 25.0,
height: 33.0,
- child: new DecoratedBox(
+ child: const DecoratedBox(
decoration: const BoxDecoration(backgroundColor: const Color(0xFFFFFF00)),
),
),
diff --git a/packages/flutter/test/widgets/dismissible_test.dart b/packages/flutter/test/widgets/dismissible_test.dart
index 2dd7d8e..d788cdc 100644
--- a/packages/flutter/test/widgets/dismissible_test.dart
+++ b/packages/flutter/test/widgets/dismissible_test.dart
@@ -313,7 +313,7 @@
testWidgets('Dismissible starts from the full size when collapsing', (WidgetTester tester) async {
scrollDirection = Axis.vertical;
dismissDirection = DismissDirection.horizontal;
- background = new Text('background');
+ background = const Text('background');
await tester.pumpWidget(buildTest());
expect(dismissedItems, isEmpty);
diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart
index 21787ef..8bb2d15 100644
--- a/packages/flutter/test/widgets/draggable_test.dart
+++ b/packages/flutter/test/widgets/draggable_test.dart
@@ -15,15 +15,15 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging'),
+ child: const Text('Source'),
+ feedback: const Text('Dragging'),
onDragStarted: () {
++dragStartedCount;
},
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Container(height: 100.0, child: new Text('Target'));
+ return new Container(height: 100.0, child: const Text('Target'));
},
onAccept: accepted.add
),
@@ -76,8 +76,8 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging')
+ child: const Text('Source'),
+ feedback: const Text('Dragging')
),
new Stack(
children: <Widget>[
@@ -86,13 +86,13 @@
onTap: () {
events.add('tap');
},
- child: new Container(child: new Text('Button')
+ child: new Container(child: const Text('Button')
)
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
return new IgnorePointer(
- child: new Container(child: new Text('Target'))
+ child: new Container(child: const Text('Target'))
);
},
onAccept: (int data) {
@@ -171,13 +171,13 @@
onTap: () {
events.add('tap');
},
- child: new Container(child: new Text('Button'))
+ child: new Container(child: const Text('Button'))
),
- feedback: new Text('Dragging')
+ feedback: const Text('Dragging')
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Text('Target');
+ return const Text('Target');
},
onAccept: (int data) {
events.add('drop');
@@ -220,12 +220,12 @@
children: <Widget>[
new LongPressDraggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging')
+ child: const Text('Source'),
+ feedback: const Text('Dragging')
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Text('Target');
+ return const Text('Target');
},
onAccept: (int data) {
events.add('drop');
@@ -266,12 +266,12 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging')
+ child: const Text('Source'),
+ feedback: const Text('Dragging')
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Text('Target');
+ return const Text('Target');
},
onAccept: (int data) {
events.add('drop');
@@ -314,7 +314,7 @@
children: <Widget>[
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Text('Target');
+ return const Text('Target');
},
onAccept: (int data) {
events.add('drop $data');
@@ -323,14 +323,14 @@
new Container(height: 400.0),
new Draggable<int>(
data: 1,
- child: new Text('H'),
- feedback: new Text('Dragging'),
+ child: const Text('H'),
+ feedback: const Text('Dragging'),
affinity: Axis.horizontal,
),
new Draggable<int>(
data: 2,
- child: new Text('V'),
- feedback: new Text('Dragging'),
+ child: const Text('V'),
+ feedback: const Text('Dragging'),
affinity: Axis.vertical,
),
new Container(height: 500.0),
@@ -421,7 +421,7 @@
children: <Widget>[
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Text('Target');
+ return const Text('Target');
},
onAccept: (int data) {
events.add('drop $data');
@@ -430,14 +430,14 @@
new Container(width: 400.0),
new Draggable<int>(
data: 1,
- child: new Text('H'),
- feedback: new Text('Dragging'),
+ child: const Text('H'),
+ feedback: const Text('Dragging'),
affinity: Axis.horizontal,
),
new Draggable<int>(
data: 2,
- child: new Text('V'),
- feedback: new Text('Dragging'),
+ child: const Text('V'),
+ feedback: const Text('Dragging'),
affinity: Axis.vertical,
),
new Container(width: 500.0),
@@ -527,15 +527,15 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging'),
+ child: const Text('Source'),
+ feedback: const Text('Dragging'),
onDraggableCanceled: (Velocity velocity, Offset offset) {
onDraggableCanceledCalled = true;
}
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Container(height: 100.0, child: new Text('Target'));
+ return new Container(height: 100.0, child: const Text('Target'));
},
onAccept: accepted.add
),
@@ -590,8 +590,8 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging'),
+ child: const Text('Source'),
+ feedback: const Text('Dragging'),
onDraggableCanceled: (Velocity velocity, Offset offset) {
onDraggableCanceledCalled = true;
onDraggableCanceledVelocity = velocity;
@@ -602,7 +602,7 @@
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
return new Container(
height: 100.0,
- child: new Text('Target')
+ child: const Text('Target')
);
},
onWillAccept: (int data) => false
@@ -659,8 +659,8 @@
home: new Column(children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Source'),
+ child: const Text('Source'),
+ feedback: const Text('Source'),
onDraggableCanceled: (Velocity velocity, Offset offset) {
onDraggableCanceledCalled = true;
onDraggableCanceledVelocity = velocity;
@@ -671,7 +671,7 @@
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
return new Container(
height: 100.0,
- child: new Text('Target')
+ child: const Text('Target')
);
},
onWillAccept: (int data) => false),
@@ -708,13 +708,13 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('IntSource'),
- feedback: new Text('IntDragging')
+ child: const Text('IntSource'),
+ feedback: const Text('IntDragging')
),
new Draggable<double>(
data: 1.0,
- child: new Text('DoubleSource'),
- feedback: new Text('DoubleDragging')
+ child: const Text('DoubleSource'),
+ feedback: const Text('DoubleDragging')
),
new Stack(
children: <Widget>[
@@ -723,7 +723,7 @@
return new IgnorePointer(
child: new Container(
height: 100.0,
- child: new Text('Target1')
+ child: const Text('Target1')
)
);
},
@@ -734,7 +734,7 @@
return new IgnorePointer(
child: new Container(
height: 100.0,
- child: new Text('Target2')
+ child: const Text('Target2')
)
);
},
@@ -821,8 +821,8 @@
children: <Widget>[
new Draggable<DragTargetData>(
data: dragTargetData,
- child: new Text('Source'),
- feedback: new Text('Dragging')
+ child: const Text('Source'),
+ feedback: const Text('Dragging')
),
new Stack(
children: <Widget>[
@@ -831,7 +831,7 @@
return new IgnorePointer(
child: new Container(
height: 100.0,
- child: new Text('Target1')
+ child: const Text('Target1')
)
);
}, onAccept: acceptedDragTargetDatas.add
@@ -841,7 +841,7 @@
return new IgnorePointer(
child: new Container(
height: 100.0,
- child: new Text('Target2')
+ child: const Text('Target2')
)
);
},
@@ -882,12 +882,12 @@
new Draggable<int>(
data: 1,
maxSimultaneousDrags: maxSimultaneousDrags,
- child: new Text('Source'),
- feedback: new Text('Dragging')
+ child: const Text('Source'),
+ feedback: const Text('Dragging')
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Container(height: 100.0, child: new Text('Target'));
+ return new Container(height: 100.0, child: const Text('Target'));
},
onAccept: accepted.add
),
@@ -1061,12 +1061,12 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging')
+ child: const Text('Source'),
+ feedback: const Text('Dragging')
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Text('Target');
+ return const Text('Target');
},
onAccept: (int data) {
events.add('drop');
@@ -1099,8 +1099,8 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging')
+ child: const Text('Source'),
+ feedback: const Text('Dragging')
),
]
)
@@ -1119,12 +1119,12 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging')
+ child: const Text('Source'),
+ feedback: const Text('Dragging')
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Container(height: 100.0, child: new Text('Target'));
+ return new Container(height: 100.0, child: const Text('Target'));
},
onAccept: accepted.add
),
@@ -1151,7 +1151,7 @@
children: <Widget>[
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Container(height: 100.0, child: new Text('Target'));
+ return new Container(height: 100.0, child: const Text('Target'));
},
onAccept: accepted.add
),
@@ -1193,8 +1193,8 @@
events.add('tap');
},
child: new LongPressDraggable<int>(
- feedback: new Text('Feedback'),
- child: new Text('X'),
+ feedback: const Text('Feedback'),
+ child: const Text('X'),
),
),
),
@@ -1230,15 +1230,15 @@
children: <Widget>[
new Draggable<int>(
data: 1,
- child: new Text('Source'),
- feedback: new Text('Dragging'),
+ child: const Text('Source'),
+ feedback: const Text('Dragging'),
onDragStarted: () {
++dragStartedCount;
},
),
new DragTarget<int>(
builder: (BuildContext context, List<int> data, List<dynamic> rejects) {
- return new Container(height: 100.0, child: new Text('Target'));
+ return new Container(height: 100.0, child: const Text('Target'));
},
onAccept: accepted.add
),
diff --git a/packages/flutter/test/widgets/drawer_test.dart b/packages/flutter/test/widgets/drawer_test.dart
index f032408..587c63d 100644
--- a/packages/flutter/test/widgets/drawer_test.dart
+++ b/packages/flutter/test/widgets/drawer_test.dart
@@ -18,7 +18,7 @@
savedContext = context;
return new Scaffold(
key: scaffoldKey,
- drawer: new Text('drawer'),
+ drawer: const Text('drawer'),
body: new Container()
);
}
@@ -45,7 +45,7 @@
new MaterialApp(
home: new Scaffold(
key: scaffoldKey,
- drawer: new Text('drawer'),
+ drawer: const Text('drawer'),
body: new Container()
)
)
@@ -80,7 +80,7 @@
drawer: new Drawer(
child: new ListView(
children: <Widget>[
- new Text('drawer'),
+ const Text('drawer'),
new Container(
height: 1000.0,
decoration: new BoxDecoration(
@@ -137,9 +137,9 @@
drawer: new Drawer(
child: new ListView(
children: <Widget>[
- new Text('drawer'),
+ const Text('drawer'),
new FlatButton(
- child: new Text('close'),
+ child: const Text('close'),
onPressed: () => Navigator.pop(context)
),
]
@@ -147,7 +147,7 @@
),
body: new Container(
child: new FlatButton(
- child: new Text('button'),
+ child: const Text('button'),
onPressed: () { buttonPressed = true; }
)
)
diff --git a/packages/flutter/test/widgets/flex_test.dart b/packages/flutter/test/widgets/flex_test.dart
index 47f991d..123cc91 100644
--- a/packages/flutter/test/widgets/flex_test.dart
+++ b/packages/flutter/test/widgets/flex_test.dart
@@ -31,8 +31,8 @@
backgroundColor: const Color(0xFF0000FF)),
width: 100.0,
height: 100.0,
- child: new Center(
- child: new Text('X'),
+ child: const Center(
+ child: const Text('X'),
),
),
),
@@ -52,7 +52,7 @@
await tester.pumpWidget(
new Row(
children: <Widget>[
- new Flexible(child: const SizedBox(width: 100.0, height: 200.0)),
+ const Flexible(child: const SizedBox(width: 100.0, height: 200.0)),
],
),
);
@@ -65,8 +65,8 @@
await tester.pumpWidget(
new Row(
children: <Widget>[
- new Expanded(flex: null, child: new Text('one')),
- new Flexible(flex: null, child: new Text('two')),
+ const Expanded(flex: null, child: const Text('one')),
+ const Flexible(flex: null, child: const Text('two')),
],
),
);
diff --git a/packages/flutter/test/widgets/framework_test.dart b/packages/flutter/test/widgets/framework_test.dart
index c851c6e..c16ec5b 100644
--- a/packages/flutter/test/widgets/framework_test.dart
+++ b/packages/flutter/test/widgets/framework_test.dart
@@ -162,14 +162,14 @@
final Key key = new GlobalKey(debugLabel: 'problematic');
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(1), child: new Container(key: key)),
- new Container(key: new ValueKey<int>(2)),
+ new Container(key: const ValueKey<int>(1), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(2)),
],
));
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(1), child: new Container(key: key)),
- new Container(key: new ValueKey<int>(2), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(1), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(2), child: new Container(key: key)),
],
));
expect(tester.takeException(), isFlutterError);
@@ -179,14 +179,14 @@
final Key key = new GlobalKey(debugLabel: 'problematic');
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(1)),
- new Container(key: new ValueKey<int>(2), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(1)),
+ new Container(key: const ValueKey<int>(2), child: new Container(key: key)),
],
));
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(1), child: new Container(key: key)),
- new Container(key: new ValueKey<int>(2), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(1), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(2), child: new Container(key: key)),
],
));
expect(tester.takeException(), isFlutterError);
@@ -196,16 +196,16 @@
final Key key = new GlobalKey(debugLabel: 'problematic');
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(0), child: new Container(key: key)),
- new Container(key: new ValueKey<int>(1)),
- new Container(key: new ValueKey<int>(2)),
+ new Container(key: const ValueKey<int>(0), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(1)),
+ new Container(key: const ValueKey<int>(2)),
],
));
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(0)),
- new Container(key: new ValueKey<int>(1), child: new Container(key: key)),
- new Container(key: new ValueKey<int>(2), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(0)),
+ new Container(key: const ValueKey<int>(1), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(2), child: new Container(key: key)),
],
));
expect(tester.takeException(), isFlutterError);
@@ -215,16 +215,16 @@
final Key key = new GlobalKey(debugLabel: 'problematic');
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(1)),
- new Container(key: new ValueKey<int>(2)),
- new Container(key: new ValueKey<int>(3), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(1)),
+ new Container(key: const ValueKey<int>(2)),
+ new Container(key: const ValueKey<int>(3), child: new Container(key: key)),
],
));
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(1), child: new Container(key: key)),
- new Container(key: new ValueKey<int>(2), child: new Container(key: key)),
- new Container(key: new ValueKey<int>(3)),
+ new Container(key: const ValueKey<int>(1), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(2), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(3)),
],
));
expect(tester.takeException(), isFlutterError);
@@ -329,14 +329,14 @@
await tester.pumpWidget(new Stack(
children: <Widget>[
new Container(key: key),
- new Container(key: new ValueKey<int>(0)),
- new Container(key: new ValueKey<int>(1)),
+ new Container(key: const ValueKey<int>(0)),
+ new Container(key: const ValueKey<int>(1)),
],
));
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(0)),
- new Container(key: new ValueKey<int>(1), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(0)),
+ new Container(key: const ValueKey<int>(1), child: new Container(key: key)),
],
));
});
@@ -346,15 +346,15 @@
await tester.pumpWidget(new Stack(
children: <Widget>[
new Container(key: key),
- new Container(key: new ValueKey<int>(0)),
- new Container(key: new ValueKey<int>(1)),
+ new Container(key: const ValueKey<int>(0)),
+ new Container(key: const ValueKey<int>(1)),
],
));
await tester.pumpWidget(new Stack(
children: <Widget>[
new Container(key: key),
- new Container(key: new ValueKey<int>(0)),
- new Container(key: new ValueKey<int>(1), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(0)),
+ new Container(key: const ValueKey<int>(1), child: new Container(key: key)),
],
));
expect(tester.takeException(), isFlutterError);
@@ -364,15 +364,15 @@
final Key key = new GlobalKey(debugLabel: 'problematic');
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(0)),
- new Container(key: new ValueKey<int>(1)),
+ new Container(key: const ValueKey<int>(0)),
+ new Container(key: const ValueKey<int>(1)),
new Container(key: key),
],
));
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(0)),
- new Container(key: new ValueKey<int>(1), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(0)),
+ new Container(key: const ValueKey<int>(1), child: new Container(key: key)),
],
));
});
@@ -381,8 +381,8 @@
final Key key = new GlobalKey(debugLabel: 'problematic');
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(0)),
- new Container(key: new ValueKey<int>(1)),
+ new Container(key: const ValueKey<int>(0)),
+ new Container(key: const ValueKey<int>(1)),
new Container(key: key),
],
));
@@ -394,8 +394,8 @@
};
await tester.pumpWidget(new Stack(
children: <Widget>[
- new Container(key: new ValueKey<int>(0)),
- new Container(key: new ValueKey<int>(1), child: new Container(key: key)),
+ new Container(key: const ValueKey<int>(0)),
+ new Container(key: const ValueKey<int>(1), child: new Container(key: key)),
new Container(key: key),
],
));
diff --git a/packages/flutter/test/widgets/global_keys_duplicated_test.dart b/packages/flutter/test/widgets/global_keys_duplicated_test.dart
index 1c121bb..7d774a0 100644
--- a/packages/flutter/test/widgets/global_keys_duplicated_test.dart
+++ b/packages/flutter/test/widgets/global_keys_duplicated_test.dart
@@ -12,8 +12,8 @@
// This is actually a test of the regular duplicate key logic, which
// happens before the duplicate GlobalKey logic.
await tester.pumpWidget(new Row(children: <Widget>[
- new Container(key: new GlobalObjectKey(0)),
- new Container(key: new GlobalObjectKey(0)),
+ new Container(key: const GlobalObjectKey(0)),
+ new Container(key: const GlobalObjectKey(0)),
]));
final dynamic error = tester.takeException();
expect(error, isFlutterError);
@@ -24,8 +24,8 @@
testWidgets('GlobalKey children of two nodes', (WidgetTester tester) async {
await tester.pumpWidget(new Row(children: <Widget>[
- new Container(child: new Container(key: new GlobalObjectKey(0))),
- new Container(child: new Container(key: new GlobalObjectKey(0))),
+ new Container(child: new Container(key: const GlobalObjectKey(0))),
+ new Container(child: new Container(key: const GlobalObjectKey(0))),
]));
final dynamic error = tester.takeException();
expect(error, isFlutterError);
@@ -38,8 +38,8 @@
testWidgets('GlobalKey children of two different nodes', (WidgetTester tester) async {
await tester.pumpWidget(new Row(children: <Widget>[
- new Container(child: new Container(key: new GlobalObjectKey(0))),
- new Container(key: new Key('x'), child: new Container(key: new GlobalObjectKey(0))),
+ new Container(child: new Container(key: const GlobalObjectKey(0))),
+ new Container(key: const Key('x'), child: new Container(key: const GlobalObjectKey(0))),
]));
final dynamic error = tester.takeException();
expect(error, isFlutterError);
@@ -55,12 +55,12 @@
StateSetter nestedSetState;
bool flag = false;
await tester.pumpWidget(new Row(children: <Widget>[
- new Container(child: new Container(key: new GlobalObjectKey(0))),
+ new Container(child: new Container(key: const GlobalObjectKey(0))),
new Container(child: new StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
nestedSetState = setState;
if (flag)
- return new Container(key: new GlobalObjectKey(0));
+ return new Container(key: const GlobalObjectKey(0));
return new Container();
},
)),
diff --git a/packages/flutter/test/widgets/global_keys_moving_test.dart b/packages/flutter/test/widgets/global_keys_moving_test.dart
index a807fcad..393344b 100644
--- a/packages/flutter/test/widgets/global_keys_moving_test.dart
+++ b/packages/flutter/test/widgets/global_keys_moving_test.dart
@@ -25,7 +25,7 @@
void markNeedsBuild() { setState(() { }); }
@override
- Widget build(BuildContext context) => new Text('leaf');
+ Widget build(BuildContext context) => const Text('leaf');
}
class KeyedWrapper extends StatelessWidget {
diff --git a/packages/flutter/test/widgets/grid_view_layout_test.dart b/packages/flutter/test/widgets/grid_view_layout_test.dart
index 49ccb0e..4645ed1 100644
--- a/packages/flutter/test/widgets/grid_view_layout_test.dart
+++ b/packages/flutter/test/widgets/grid_view_layout_test.dart
@@ -8,10 +8,10 @@
void main() {
testWidgets('Empty GridView', (WidgetTester tester) async {
final List<Widget> children = <Widget>[
- new DecoratedBox(decoration: const BoxDecoration()),
- new DecoratedBox(decoration: const BoxDecoration()),
- new DecoratedBox(decoration: const BoxDecoration()),
- new DecoratedBox(decoration: const BoxDecoration())
+ const DecoratedBox(decoration: const BoxDecoration()),
+ const DecoratedBox(decoration: const BoxDecoration()),
+ const DecoratedBox(decoration: const BoxDecoration()),
+ const DecoratedBox(decoration: const BoxDecoration()),
];
await tester.pumpWidget(new Center(
@@ -25,11 +25,12 @@
),
));
- children.forEach((Widget child) {
- final RenderBox box = tester.renderObject(find.byConfig(child));
+ expect(tester.renderObjectList<RenderBox>(find.byType(DecoratedBox)), hasLength(4));
+
+ for (RenderBox box in tester.renderObjectList<RenderBox>(find.byType(DecoratedBox))) {
expect(box.size.width, equals(100.0), reason: "child width");
expect(box.size.height, equals(100.0), reason: "child height");
- });
+ }
final RenderBox grid = tester.renderObject(find.byType(GridView));
expect(grid.size.width, equals(200.0), reason: "grid width");
@@ -48,11 +49,10 @@
),
));
- children.forEach((Widget child) {
- final RenderBox box = tester.renderObject(find.byConfig(child));
+ for (RenderBox box in tester.renderObjectList<RenderBox>(find.byType(DecoratedBox))) {
expect(box.size.width, equals(50.0), reason: "child width");
expect(box.size.height, equals(50.0), reason: "child height");
- });
+ }
expect(grid.size.width, equals(200.0), reason: "grid width");
expect(grid.size.height, equals(50.0), reason: "grid height");
diff --git a/packages/flutter/test/widgets/heroes_test.dart b/packages/flutter/test/widgets/heroes_test.dart
index d6928e6..c631251 100644
--- a/packages/flutter/test/widgets/heroes_test.dart
+++ b/packages/flutter/test/widgets/heroes_test.dart
@@ -23,7 +23,7 @@
new Card(child: new Hero(tag: 'a', child: new Container(height: 100.0, width: 100.0, key: firstKey))),
new Container(height: 100.0, width: 100.0),
new FlatButton(
- child: new Text('two'),
+ child: const Text('two'),
onPressed: () { Navigator.pushNamed(context, '/two'); }
),
]
@@ -34,14 +34,14 @@
key: routeTwoKey,
children: <Widget>[
new FlatButton(
- child: new Text('pop'),
+ child: const Text('pop'),
onPressed: () { Navigator.pop(context); }
),
new Container(height: 150.0, width: 150.0),
new Card(child: new Hero(tag: 'a', child: new Container(height: 150.0, width: 150.0, key: secondKey))),
new Container(height: 150.0, width: 150.0),
new FlatButton(
- child: new Text('three'),
+ child: const Text('three'),
onPressed: () { Navigator.push(context, new ThreeRoute()); },
),
]
@@ -66,7 +66,7 @@
class MutatingRoute extends MaterialPageRoute<Null> {
MutatingRoute() : super(builder: (BuildContext context) {
- return new Hero(tag: 'a', child: new Text('MutatingRoute'), key: new UniqueKey());
+ return new Hero(tag: 'a', child: const Text('MutatingRoute'), key: new UniqueKey());
});
void markNeedsBuild() {
@@ -200,9 +200,9 @@
home: new Material(
child: new ListView(
children: <Widget>[
- new Hero(tag: 'a', child: new Text('foo')),
+ new Hero(tag: 'a', child: const Text('foo')),
new Builder(builder: (BuildContext context) {
- return new FlatButton(child: new Text('two'), onPressed: () => Navigator.push(context, route));
+ return new FlatButton(child: const Text('two'), onPressed: () => Navigator.push(context, route));
})
]
)
@@ -272,7 +272,7 @@
child: new Container(
width: 100.0,
height: 100.0,
- child: new Text('foo')
+ child: const Text('foo')
)
)
)
@@ -290,7 +290,7 @@
child: new Container(
width: 100.0,
height: 150.0,
- child: new Text('bar')
+ child: const Text('bar')
)
)
)
@@ -393,16 +393,16 @@
home: new Material(
child: new ListView(
children: <Widget>[
- new Hero(tag: 'a', child: new Text('a')),
- new Hero(tag: 'a', child: new Text('a too')),
+ new Hero(tag: 'a', child: const Text('a')),
+ new Hero(tag: 'a', child: const Text('a too')),
new Builder(
builder: (BuildContext context) {
return new FlatButton(
- child: new Text('push'),
+ child: const Text('push'),
onPressed: () {
Navigator.push(context, new PageRouteBuilder<Null>(
pageBuilder: (BuildContext context, Animation<double> _, Animation<double> __) {
- return new Text('fail');
+ return const Text('fail');
},
));
},
@@ -577,7 +577,7 @@
},
),
new FlatButton(
- child: new Text('POP'),
+ child: const Text('POP'),
onPressed: () { Navigator.pop(context); }
),
],
@@ -598,7 +598,7 @@
child: new Hero(tag: 'H', child: new Container(key: homeHeroKey, height: 100.0, width: 100.0)),
),
new FlatButton(
- child: new Text('PUSH'),
+ child: const Text('PUSH'),
onPressed: () { Navigator.push(context, route); }
),
],
@@ -668,17 +668,17 @@
return new Material(
child: new ListView(
children: <Widget>[
- new SizedBox(height: 100.0),
+ const SizedBox(height: 100.0),
// This container will appear at Y=100
new Container(
key: routeContainerKey,
child: new Hero(tag: 'H', child: new Container(key: routeHeroKey, height: 200.0, width: 200.0))
),
new FlatButton(
- child: new Text('POP'),
+ child: const Text('POP'),
onPressed: () { Navigator.pop(context); }
),
- new SizedBox(height: 600.0),
+ const SizedBox(height: 600.0),
],
)
);
@@ -693,16 +693,16 @@
builder: (BuildContext context) { // Navigator.push() needs context
return new ListView(
children: <Widget> [
- new SizedBox(height: 200.0),
+ const SizedBox(height: 200.0),
// This container will appear at Y=200
new Container(
child: new Hero(tag: 'H', child: new Container(key: homeHeroKey, height: 100.0, width: 100.0)),
),
new FlatButton(
- child: new Text('PUSH'),
+ child: const Text('PUSH'),
onPressed: () { Navigator.push(context, route); }
),
- new SizedBox(height: 600.0),
+ const SizedBox(height: 600.0),
],
);
},
@@ -750,13 +750,13 @@
return new Material(
child: new ListView(
children: <Widget>[
- new SizedBox(height: 100.0),
+ const SizedBox(height: 100.0),
// This container will appear at Y=100
new Container(
key: routeContainerKey,
child: new Hero(tag: 'H', child: new Container(key: routeHeroKey, height: 200.0, width: 200.0))
),
- new SizedBox(height: 800.0),
+ const SizedBox(height: 800.0),
],
)
);
@@ -771,13 +771,13 @@
builder: (BuildContext context) { // Navigator.push() needs context
return new ListView(
children: <Widget> [
- new SizedBox(height: 200.0),
+ const SizedBox(height: 200.0),
// This container will appear at Y=200
new Container(
child: new Hero(tag: 'H', child: new Container(key: homeHeroKey, height: 100.0, width: 100.0)),
),
new FlatButton(
- child: new Text('PUSH'),
+ child: const Text('PUSH'),
onPressed: () { Navigator.push(context, route); }
),
],
@@ -832,7 +832,7 @@
new Container(
child: new Hero(tag: 'BC', child: new Container(key: heroBCKey, height: 150.0))
),
- new SizedBox(height: 800.0),
+ const SizedBox(height: 800.0),
],
)
);
@@ -845,19 +845,19 @@
return new Material(
child: new ListView(
children: <Widget>[
- new SizedBox(height: 100.0),
+ const SizedBox(height: 100.0),
// This container will appear at Y=100
new Container(
child: new Hero(tag: 'AB', child: new Container(key: heroABKey, height: 200.0))
),
new FlatButton(
- child: new Text('PUSH C'),
+ child: const Text('PUSH C'),
onPressed: () { Navigator.push(context, routeC); }
),
new Container(
child: new Hero(tag: 'BC', child: new Container(height: 150.0))
),
- new SizedBox(height: 800.0),
+ const SizedBox(height: 800.0),
],
)
);
@@ -872,13 +872,13 @@
builder: (BuildContext context) { // Navigator.push() needs context
return new ListView(
children: <Widget> [
- new SizedBox(height: 200.0),
+ const SizedBox(height: 200.0),
// This container will appear at Y=200
new Container(
child: new Hero(tag: 'AB', child: new Container(height: 100.0, width: 100.0)),
),
new FlatButton(
- child: new Text('PUSH B'),
+ child: const Text('PUSH B'),
onPressed: () { Navigator.push(context, routeB); }
),
],
@@ -939,7 +939,7 @@
),
),
new FlatButton(
- child: new Text('POP'),
+ child: const Text('POP'),
onPressed: () { Navigator.pop(context); }
),
],
@@ -965,7 +965,7 @@
),
),
new FlatButton(
- child: new Text('PUSH'),
+ child: const Text('PUSH'),
onPressed: () { Navigator.push(context, route); }
),
],
diff --git a/packages/flutter/test/widgets/hit_testing_test.dart b/packages/flutter/test/widgets/hit_testing_test.dart
index 73899f8..aea0013 100644
--- a/packages/flutter/test/widgets/hit_testing_test.dart
+++ b/packages/flutter/test/widgets/hit_testing_test.dart
@@ -8,7 +8,7 @@
void main() {
testWidgets('toString control test', (WidgetTester tester) async {
- await tester.pumpWidget(new Center(child: new Text('Hello')));
+ await tester.pumpWidget(const Center(child: const Text('Hello')));
final HitTestResult result = tester.hitTestOnBinding(Point.origin);
expect(result, hasOneLineDescription);
expect(result.path.first, hasOneLineDescription);
diff --git a/packages/flutter/test/widgets/icon_test.dart b/packages/flutter/test/widgets/icon_test.dart
index 5b6d5cc..0a4a6ab 100644
--- a/packages/flutter/test/widgets/icon_test.dart
+++ b/packages/flutter/test/widgets/icon_test.dart
@@ -13,7 +13,7 @@
color: Colors.green[500],
opacity: 0.5
),
- child: new Icon(Icons.add)
+ child: const Icon(Icons.add)
)
);
final RichText text = tester.widget(find.byType(RichText));
diff --git a/packages/flutter/test/widgets/inherited_test.dart b/packages/flutter/test/widgets/inherited_test.dart
index d83a0c0..813bde2 100644
--- a/packages/flutter/test/widgets/inherited_test.dart
+++ b/packages/flutter/test/widgets/inherited_test.dart
@@ -129,7 +129,7 @@
builder: (BuildContext context) {
final ValueInherited v = context.inheritFromWidgetOfExactType(ValueInherited);
log.add('a: ${v.value}');
- return new Text('');
+ return const Text('');
}
)
)
@@ -146,7 +146,7 @@
builder: (BuildContext context) {
final ValueInherited v = context.inheritFromWidgetOfExactType(ValueInherited);
log.add('b: ${v.value}');
- return new Text('');
+ return const Text('');
}
)
)
@@ -204,7 +204,7 @@
builder: (BuildContext context) {
final ValueInherited v = context.inheritFromWidgetOfExactType(ValueInherited);
log.add('a: ${v.value}');
- return new Text('');
+ return const Text('');
}
)
)
@@ -222,7 +222,7 @@
builder: (BuildContext context) {
final ValueInherited v = context.inheritFromWidgetOfExactType(ValueInherited);
log.add('b: ${v.value}');
- return new Text('');
+ return const Text('');
}
)
)
@@ -265,7 +265,7 @@
builder: (BuildContext context) {
final ValueInherited v = context.inheritFromWidgetOfExactType(ValueInherited);
log.add(v.value);
- return new Text('');
+ return const Text('');
}
);
@@ -336,7 +336,7 @@
builder: (BuildContext context) {
final ValueInherited v = context.inheritFromWidgetOfExactType(ValueInherited);
log.add(v.value);
- return new Text('');
+ return const Text('');
}
);
diff --git a/packages/flutter/test/widgets/list_view_builder_test.dart b/packages/flutter/test/widgets/list_view_builder_test.dart
index bcd5eb2..bebebac 100644
--- a/packages/flutter/test/widgets/list_view_builder_test.dart
+++ b/packages/flutter/test/widgets/list_view_builder_test.dart
@@ -27,7 +27,7 @@
);
},
),
- right: new Text('Not Today'),
+ right: const Text('Not Today'),
);
}
@@ -74,7 +74,7 @@
itemExtent: 200.0,
itemBuilder: itemBuilder,
),
- right: new Text('Not Today')
+ right: const Text('Not Today')
);
}
@@ -135,7 +135,7 @@
itemExtent: 200.0,
scrollDirection: Axis.horizontal
),
- right: new Text('Not Today')
+ right: const Text('Not Today')
);
}
diff --git a/packages/flutter/test/widgets/list_view_correction_test.dart b/packages/flutter/test/widgets/list_view_correction_test.dart
index 243dc6f..7dc8a2f 100644
--- a/packages/flutter/test/widgets/list_view_correction_test.dart
+++ b/packages/flutter/test/widgets/list_view_correction_test.dart
@@ -11,12 +11,12 @@
await tester.pumpWidget(new ListView(
controller: controller,
children: <Widget>[
- new Container(height: 400.0, child: new Text('1')),
- new Container(height: 400.0, child: new Text('2')),
- new Container(height: 400.0, child: new Text('3')),
- new Container(height: 400.0, child: new Text('4')),
- new Container(height: 400.0, child: new Text('5')),
- new Container(height: 400.0, child: new Text('6')),
+ new Container(height: 400.0, child: const Text('1')),
+ new Container(height: 400.0, child: const Text('2')),
+ new Container(height: 400.0, child: const Text('3')),
+ new Container(height: 400.0, child: const Text('4')),
+ new Container(height: 400.0, child: const Text('5')),
+ new Container(height: 400.0, child: const Text('6')),
],
));
@@ -28,12 +28,12 @@
await tester.pumpWidget(new ListView(
controller: controller,
children: <Widget>[
- new Container(height: 200.0, child: new Text('1')),
- new Container(height: 400.0, child: new Text('2')),
- new Container(height: 400.0, child: new Text('3')),
- new Container(height: 400.0, child: new Text('4')),
- new Container(height: 400.0, child: new Text('5')),
- new Container(height: 400.0, child: new Text('6')),
+ new Container(height: 200.0, child: const Text('1')),
+ new Container(height: 400.0, child: const Text('2')),
+ new Container(height: 400.0, child: const Text('3')),
+ new Container(height: 400.0, child: const Text('4')),
+ new Container(height: 400.0, child: const Text('5')),
+ new Container(height: 400.0, child: const Text('6')),
],
));
diff --git a/packages/flutter/test/widgets/list_view_misc_test.dart b/packages/flutter/test/widgets/list_view_misc_test.dart
index 5fd5226..95cd389 100644
--- a/packages/flutter/test/widgets/list_view_misc_test.dart
+++ b/packages/flutter/test/widgets/list_view_misc_test.dart
@@ -16,7 +16,7 @@
children: <Widget>[
new Container(
height: 200.0, // less than 600, the height of the test area
- child: new Text('Hello')
+ child: const Text('Hello')
)
]
)
@@ -41,7 +41,7 @@
children: <Widget>[
new Container(
height: 2000.0, // more than 600, the height of the test area
- child: new Text('Hello')
+ child: const Text('Hello')
)
]
)
@@ -113,7 +113,7 @@
Widget buildBlock() {
return new ListView(
controller: controller,
- children: <Widget>[new Text("A"), new Text("B"), new Text("C")]
+ children: <Widget>[const Text("A"), const Text("B"), const Text("C")]
);
}
await tester.pumpWidget(buildBlock());
diff --git a/packages/flutter/test/widgets/list_view_relayout_test.dart b/packages/flutter/test/widgets/list_view_relayout_test.dart
index add6232..a9b949f 100644
--- a/packages/flutter/test/widgets/list_view_relayout_test.dart
+++ b/packages/flutter/test/widgets/list_view_relayout_test.dart
@@ -14,17 +14,17 @@
new ListView(
shrinkWrap: true,
children: <Widget>[
- new Text('1'),
- new Text('2'),
- new Text('3'),
+ const Text('1'),
+ const Text('2'),
+ const Text('3'),
],
),
new ListView(
shrinkWrap: true,
children: <Widget>[
- new Text('4'),
- new Text('5'),
- new Text('6'),
+ const Text('4'),
+ const Text('5'),
+ const Text('6'),
],
),
],
@@ -36,14 +36,14 @@
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 100.0, child: new Text('100')),
+ const SizedBox(height: 100.0, child: const Text('100')),
],
));
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 100.0, child: new Text('100')),
- new SizedBox(height: 200.0, child: new Text('200')),
+ const SizedBox(height: 100.0, child: const Text('100')),
+ const SizedBox(height: 200.0, child: const Text('200')),
],
));
@@ -53,7 +53,7 @@
testWidgets('Underflowing ListView contentExtent should track additional children', (WidgetTester tester) async {
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 100.0, child: new Text('100')),
+ const SizedBox(height: 100.0, child: const Text('100')),
],
));
@@ -62,8 +62,8 @@
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 100.0, child: new Text('100')),
- new SizedBox(height: 200.0, child: new Text('200')),
+ const SizedBox(height: 100.0, child: const Text('100')),
+ const SizedBox(height: 200.0, child: const Text('200')),
],
));
expect(list.geometry.scrollExtent, equals(300.0));
@@ -77,8 +77,8 @@
testWidgets('Overflowing ListView should relayout for missing children', (WidgetTester tester) async {
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 300.0, child: new Text('300')),
- new SizedBox(height: 400.0, child: new Text('400')),
+ const SizedBox(height: 300.0, child: const Text('300')),
+ const SizedBox(height: 400.0, child: const Text('400')),
],
));
@@ -87,7 +87,7 @@
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 300.0, child: new Text('300')),
+ const SizedBox(height: 300.0, child: const Text('300')),
],
));
@@ -105,8 +105,8 @@
testWidgets('Overflowing ListView should not relayout for additional children', (WidgetTester tester) async {
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 300.0, child: new Text('300')),
- new SizedBox(height: 400.0, child: new Text('400')),
+ const SizedBox(height: 300.0, child: const Text('300')),
+ const SizedBox(height: 400.0, child: const Text('400')),
],
));
@@ -115,9 +115,9 @@
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 300.0, child: new Text('300')),
- new SizedBox(height: 400.0, child: new Text('400')),
- new SizedBox(height: 100.0, child: new Text('100')),
+ const SizedBox(height: 300.0, child: const Text('300')),
+ const SizedBox(height: 400.0, child: const Text('400')),
+ const SizedBox(height: 100.0, child: const Text('100')),
],
));
@@ -137,7 +137,7 @@
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 100.0, child: new Text('100')),
+ const SizedBox(height: 100.0, child: const Text('100')),
],
));
@@ -146,9 +146,9 @@
await tester.pumpWidget(new ListView(
children: <Widget>[
- new SizedBox(height: 100.0, child: new Text('100')),
- new SizedBox(height: 200.0, child: new Text('200')),
- new SizedBox(height: 400.0, child: new Text('400')),
+ const SizedBox(height: 100.0, child: const Text('100')),
+ const SizedBox(height: 200.0, child: const Text('200')),
+ const SizedBox(height: 400.0, child: const Text('400')),
],
));
diff --git a/packages/flutter/test/widgets/list_view_viewporting_test.dart b/packages/flutter/test/widgets/list_view_viewporting_test.dart
index 41afdc9..983f030 100644
--- a/packages/flutter/test/widgets/list_view_viewporting_test.dart
+++ b/packages/flutter/test/widgets/list_view_viewporting_test.dart
@@ -27,7 +27,7 @@
);
},
),
- right: new Text('Not Today'),
+ right: const Text('Not Today'),
);
}
@@ -73,7 +73,7 @@
controller: new ScrollController(initialScrollOffset: 300.0),
itemBuilder: itemBuilder,
),
- right: new Text('Not Today'),
+ right: const Text('Not Today'),
);
}
@@ -123,7 +123,7 @@
controller: new ScrollController(initialScrollOffset: 300.0),
itemBuilder: itemBuilder,
),
- right: new Text('Not Today'),
+ right: const Text('Not Today'),
);
}
diff --git a/packages/flutter/test/widgets/listener_test.dart b/packages/flutter/test/widgets/listener_test.dart
index 316db5d..11c7b60 100644
--- a/packages/flutter/test/widgets/listener_test.dart
+++ b/packages/flutter/test/widgets/listener_test.dart
@@ -24,7 +24,7 @@
onPointerDown: (_) {
log.add('bottom');
},
- child: new Text('X')
+ child: const Text('X')
)
)
)
diff --git a/packages/flutter/test/widgets/modal_barrier_test.dart b/packages/flutter/test/widgets/modal_barrier_test.dart
index fa55ee1..e4be1c4 100644
--- a/packages/flutter/test/widgets/modal_barrier_test.dart
+++ b/packages/flutter/test/widgets/modal_barrier_test.dart
@@ -16,10 +16,10 @@
onTap: () {
tapped = true;
},
- child: new SizedBox(
+ child: const SizedBox(
width: 10.0,
height: 10.0,
- child: new Text('target')
+ child: const Text('target')
)
);
});
@@ -88,7 +88,7 @@
Navigator.pushNamed(context, '/modal');
},
child: new Container(
- child: new Text('X')
+ child: const Text('X')
)
);
}
diff --git a/packages/flutter/test/widgets/navigator_test.dart b/packages/flutter/test/widgets/navigator_test.dart
index b03804e..48cab05 100644
--- a/packages/flutter/test/widgets/navigator_test.dart
+++ b/packages/flutter/test/widgets/navigator_test.dart
@@ -16,7 +16,7 @@
decoration: const BoxDecoration(
backgroundColor: const Color(0xFFFFFF00)
),
- child: new Text('X')
+ child: const Text('X')
)
);
}
@@ -36,7 +36,7 @@
decoration: const BoxDecoration(
backgroundColor: const Color(0xFFFF00FF)
),
- child: new Text('Y')
+ child: const Text('Y')
)
);
}
@@ -188,11 +188,11 @@
log.add('left');
Navigator.pushNamed(context, '/second');
},
- child: new Text('left')
+ child: const Text('left')
),
new GestureDetector(
onTap: () { log.add('right'); },
- child: new Text('right')
+ child: const Text('right')
),
]
);
diff --git a/packages/flutter/test/widgets/overflow_box_test.dart b/packages/flutter/test/widgets/overflow_box_test.dart
index 06b1da6..745f08b 100644
--- a/packages/flutter/test/widgets/overflow_box_test.dart
+++ b/packages/flutter/test/widgets/overflow_box_test.dart
@@ -32,7 +32,7 @@
testWidgets('OverflowBox implements debugFillDescription', (WidgetTester tester) async {
final List<String> description = <String>[];
- new OverflowBox(
+ const OverflowBox(
minWidth: 1.0,
maxWidth: 2.0,
minHeight: 3.0,
diff --git a/packages/flutter/test/widgets/overscroll_indicator_test.dart b/packages/flutter/test/widgets/overscroll_indicator_test.dart
index 279f58f..c7b8749 100644
--- a/packages/flutter/test/widgets/overscroll_indicator_test.dart
+++ b/packages/flutter/test/widgets/overscroll_indicator_test.dart
@@ -26,7 +26,7 @@
await tester.pumpWidget(
new CustomScrollView(
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
],
),
);
@@ -59,7 +59,7 @@
await tester.pumpWidget(
new CustomScrollView(
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
],
),
);
@@ -94,7 +94,7 @@
await tester.pumpWidget(
new CustomScrollView(
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
],
),
);
@@ -128,7 +128,7 @@
new CustomScrollView(
physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
],
),
);
@@ -146,7 +146,7 @@
reverse: true,
physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
],
),
);
@@ -164,7 +164,7 @@
new CustomScrollView(
physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
],
),
);
@@ -185,7 +185,7 @@
scrollDirection: Axis.horizontal,
physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
],
),
);
@@ -235,7 +235,7 @@
physics: const AlwaysScrollableScrollPhysics(),
reverse: true,
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
],
),
),
@@ -253,7 +253,7 @@
scrollDirection: Axis.horizontal,
physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
],
),
),
diff --git a/packages/flutter/test/widgets/page_forward_transitions_test.dart b/packages/flutter/test/widgets/page_forward_transitions_test.dart
index 7423a02..95e171b 100644
--- a/packages/flutter/test/widgets/page_forward_transitions_test.dart
+++ b/packages/flutter/test/widgets/page_forward_transitions_test.dart
@@ -87,13 +87,13 @@
return new Column(
children: <Widget>[
new TestTransition(
- childFirstHalf: new Text('A'),
- childSecondHalf: new Text('B'),
+ childFirstHalf: const Text('A'),
+ childSecondHalf: const Text('B'),
animation: route.animation
),
new TestTransition(
- childFirstHalf: new Text('C'),
- childSecondHalf: new Text('D'),
+ childFirstHalf: const Text('C'),
+ childSecondHalf: const Text('D'),
animation: route.secondaryAnimation
),
]
@@ -101,9 +101,9 @@
}
)
);
- case '/2': return new TestRoute<Null>(settings: settings, child: new Text('E'));
- case '/3': return new TestRoute<Null>(settings: settings, child: new Text('F'));
- case '/4': return new TestRoute<Null>(settings: settings, child: new Text('G'));
+ case '/2': return new TestRoute<Null>(settings: settings, child: const Text('E'));
+ case '/3': return new TestRoute<Null>(settings: settings, child: const Text('F'));
+ case '/4': return new TestRoute<Null>(settings: settings, child: const Text('G'));
}
}
)
diff --git a/packages/flutter/test/widgets/page_transitions_test.dart b/packages/flutter/test/widgets/page_transitions_test.dart
index 13979f5..0f73441 100644
--- a/packages/flutter/test/widgets/page_transitions_test.dart
+++ b/packages/flutter/test/widgets/page_transitions_test.dart
@@ -10,7 +10,7 @@
Iterable<OverlayEntry> createOverlayEntries() sync* {
yield new OverlayEntry(builder: _build);
}
- Widget _build(BuildContext context) => new Text('Overlay');
+ Widget _build(BuildContext context) => const Text('Overlay');
}
class PersistentBottomSheetTest extends StatefulWidget {
@@ -27,7 +27,7 @@
void showBottomSheet() {
_scaffoldKey.currentState.showBottomSheet<Null>((BuildContext context) {
- return new Text('bottomSheet');
+ return const Text('bottomSheet');
})
.closed.whenComplete(() {
setState(() {
@@ -40,7 +40,7 @@
Widget build(BuildContext context) {
return new Scaffold(
key: _scaffoldKey,
- body: new Text('Sheet')
+ body: const Text('Sheet')
);
}
}
@@ -50,8 +50,8 @@
final GlobalKey containerKey1 = new GlobalKey();
final GlobalKey containerKey2 = new GlobalKey();
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
- '/': (_) => new Container(key: containerKey1, child: new Text('Home')),
- '/settings': (_) => new Container(key: containerKey2, child: new Text('Settings')),
+ '/': (_) => new Container(key: containerKey1, child: const Text('Home')),
+ '/settings': (_) => new Container(key: containerKey2, child: const Text('Settings')),
};
await tester.pumpWidget(new MaterialApp(routes: routes));
@@ -139,7 +139,7 @@
decoration: const BoxDecoration(backgroundColor: const Color(0xff00ffff)),
child: new Hero(
tag: kHeroTag,
- child: new Text('Home')
+ child: const Text('Home')
)
)
),
@@ -150,7 +150,7 @@
decoration: const BoxDecoration(backgroundColor: const Color(0xffff00ff)),
child: new Hero(
tag: kHeroTag,
- child: new Text('Settings')
+ child: const Text('Settings')
)
)
),
@@ -204,8 +204,8 @@
final GlobalKey containerKey1 = new GlobalKey();
final GlobalKey containerKey2 = new GlobalKey();
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
- '/': (_) => new Scaffold(key: containerKey1, body: new Text('Home')),
- '/settings': (_) => new Scaffold(key: containerKey2, body: new Text('Settings')),
+ '/': (_) => new Scaffold(key: containerKey1, body: const Text('Home')),
+ '/settings': (_) => new Scaffold(key: containerKey2, body: const Text('Settings')),
};
await tester.pumpWidget(new MaterialApp(
@@ -251,7 +251,7 @@
final GlobalKey containerKey1 = new GlobalKey();
final GlobalKey containerKey2 = new GlobalKey();
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
- '/': (_) => new Scaffold(key: containerKey1, body: new Text('Home')),
+ '/': (_) => new Scaffold(key: containerKey1, body: const Text('Home')),
'/sheet': (_) => new PersistentBottomSheetTest(key: containerKey2),
};
@@ -290,15 +290,15 @@
testWidgets('Test completed future', (WidgetTester tester) async {
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
- '/': (_) => new Center(child: new Text('home')),
- '/next': (_) => new Center(child: new Text('next')),
+ '/': (_) => const Center(child: const Text('home')),
+ '/next': (_) => const Center(child: const Text('next')),
};
await tester.pumpWidget(new MaterialApp(routes: routes));
final PageRoute<Null> route = new MaterialPageRoute<Null>(
settings: const RouteSettings(name: '/page'),
- builder: (BuildContext context) => new Center(child: new Text('page')),
+ builder: (BuildContext context) => const Center(child: const Text('page')),
);
int popCount = 0;
diff --git a/packages/flutter/test/widgets/placeholder_test.dart b/packages/flutter/test/widgets/placeholder_test.dart
index 68e2d6b..03a232a 100644
--- a/packages/flutter/test/widgets/placeholder_test.dart
+++ b/packages/flutter/test/widgets/placeholder_test.dart
@@ -11,7 +11,7 @@
await tester.pumpWidget(new Placeholder(key: key));
- key.currentState.child = new Text('target');
+ key.currentState.child = const Text('target');
expect(find.text('target'), findsNothing);
diff --git a/packages/flutter/test/widgets/reassemble_test.dart b/packages/flutter/test/widgets/reassemble_test.dart
index afbc6f7..21d683c 100644
--- a/packages/flutter/test/widgets/reassemble_test.dart
+++ b/packages/flutter/test/widgets/reassemble_test.dart
@@ -8,7 +8,7 @@
void main() {
testWidgets('reassemble does not crash', (WidgetTester tester) async {
await tester.pumpWidget(new MaterialApp(
- home: new Text('Hello World')
+ home: const Text('Hello World')
));
await tester.pump();
tester.binding.reassembleApplication();
diff --git a/packages/flutter/test/widgets/reparent_state_harder_test.dart b/packages/flutter/test/widgets/reparent_state_harder_test.dart
index c9c45d4..d52f1bf 100644
--- a/packages/flutter/test/widgets/reparent_state_harder_test.dart
+++ b/packages/flutter/test/widgets/reparent_state_harder_test.dart
@@ -52,7 +52,7 @@
class DummyStatefulWidgetState extends State<DummyStatefulWidget> {
@override
- Widget build(BuildContext context) => new Text('LEAF');
+ Widget build(BuildContext context) => const Text('LEAF');
}
class RekeyableDummyStatefulWidgetWrapper extends StatefulWidget {
diff --git a/packages/flutter/test/widgets/run_app_test.dart b/packages/flutter/test/widgets/run_app_test.dart
index 0152f00..901cfa1 100644
--- a/packages/flutter/test/widgets/run_app_test.dart
+++ b/packages/flutter/test/widgets/run_app_test.dart
@@ -11,9 +11,9 @@
new Material(
child: new RaisedButton(
onPressed: () {
- runApp(new Center(child: new Text('Done')));
+ runApp(const Center(child: const Text('Done')));
},
- child: new Text('GO')
+ child: const Text('GO')
)
)
);
diff --git a/packages/flutter/test/widgets/scrollable_custom_scroll_behavior_test.dart b/packages/flutter/test/widgets/scrollable_custom_scroll_behavior_test.dart
index 5fd8bfe..be0e204 100644
--- a/packages/flutter/test/widgets/scrollable_custom_scroll_behavior_test.dart
+++ b/packages/flutter/test/widgets/scrollable_custom_scroll_behavior_test.dart
@@ -121,7 +121,7 @@
child: new CustomScrollView(
controller: new TestScrollController(),
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
],
),
));
@@ -133,7 +133,7 @@
child: new CustomScrollView(
controller: new TestScrollController(),
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
],
),
));
diff --git a/packages/flutter/test/widgets/scrollable_test.dart b/packages/flutter/test/widgets/scrollable_test.dart
index 660866f..b37f3f3 100644
--- a/packages/flutter/test/widgets/scrollable_test.dart
+++ b/packages/flutter/test/widgets/scrollable_test.dart
@@ -13,7 +13,7 @@
),
home: new CustomScrollView(
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
],
),
));
diff --git a/packages/flutter/test/widgets/semantics_1_test.dart b/packages/flutter/test/widgets/semantics_1_test.dart
index 5f29050..c700d03 100644
--- a/packages/flutter/test/widgets/semantics_1_test.dart
+++ b/packages/flutter/test/widgets/semantics_1_test.dart
@@ -32,13 +32,13 @@
children: <Widget>[
new Container(
height: 10.0,
- child: new Semantics(label: 'child1')
+ child: const Semantics(label: 'child1')
),
new Container(
height: 10.0,
- child: new IgnorePointer(
+ child: const IgnorePointer(
ignoring: true,
- child: new Semantics(label: 'child2')
+ child: const Semantics(label: 'child2')
)
),
],
@@ -54,13 +54,13 @@
children: <Widget>[
new Container(
height: 10.0,
- child: new Semantics(label: 'child1')
+ child: const Semantics(label: 'child1')
),
new Container(
height: 10.0,
- child: new IgnorePointer(
+ child: const IgnorePointer(
ignoring: false,
- child: new Semantics(label: 'child2')
+ child: const Semantics(label: 'child2')
)
),
],
@@ -93,13 +93,13 @@
children: <Widget>[
new Container(
height: 10.0,
- child: new Semantics(label: 'child1')
+ child: const Semantics(label: 'child1')
),
new Container(
height: 10.0,
- child: new IgnorePointer(
+ child: const IgnorePointer(
ignoring: true,
- child: new Semantics(label: 'child2')
+ child: const Semantics(label: 'child2')
)
),
],
@@ -114,13 +114,13 @@
children: <Widget>[
new Container(
height: 10.0,
- child: new Semantics(label: 'child1')
+ child: const Semantics(label: 'child1')
),
new Container(
height: 10.0,
- child: new IgnorePointer(
+ child: const IgnorePointer(
ignoring: false,
- child: new Semantics(label: 'child2')
+ child: const Semantics(label: 'child2')
)
),
],
diff --git a/packages/flutter/test/widgets/semantics_2_test.dart b/packages/flutter/test/widgets/semantics_2_test.dart
index 2a4a32d..f6c65f0 100644
--- a/packages/flutter/test/widgets/semantics_2_test.dart
+++ b/packages/flutter/test/widgets/semantics_2_test.dart
@@ -23,13 +23,13 @@
children: <Widget>[
new Container(
height: 10.0,
- child: new Semantics(label: 'child1')
+ child: const Semantics(label: 'child1')
),
new Container(
height: 10.0,
- child: new IgnorePointer(
+ child: const IgnorePointer(
ignoring: false,
- child: new Semantics(label: 'child2')
+ child: const Semantics(label: 'child2')
)
),
],
@@ -62,13 +62,13 @@
children: <Widget>[
new Container(
height: 10.0,
- child: new Semantics(label: 'child1')
+ child: const Semantics(label: 'child1')
),
new Container(
height: 10.0,
- child: new IgnorePointer(
+ child: const IgnorePointer(
ignoring: true,
- child: new Semantics(label: 'child2')
+ child: const Semantics(label: 'child2')
)
),
],
@@ -84,13 +84,13 @@
children: <Widget>[
new Container(
height: 10.0,
- child: new Semantics(label: 'child1')
+ child: const Semantics(label: 'child1')
),
new Container(
height: 10.0,
- child: new IgnorePointer(
+ child: const IgnorePointer(
ignoring: false,
- child: new Semantics(label: 'child2')
+ child: const Semantics(label: 'child2')
)
),
],
diff --git a/packages/flutter/test/widgets/semantics_3_test.dart b/packages/flutter/test/widgets/semantics_3_test.dart
index e0bbfc9..3203a1d 100644
--- a/packages/flutter/test/widgets/semantics_3_test.dart
+++ b/packages/flutter/test/widgets/semantics_3_test.dart
@@ -20,7 +20,7 @@
child: new Semantics(
label: 'test',
child: new Container(
- child: new Semantics(
+ child: const Semantics(
checked: true
)
)
@@ -40,7 +40,7 @@
await tester.pumpWidget(
new Container(
child: new Container(
- child: new Semantics(
+ child: const Semantics(
checked: true
)
)
@@ -58,7 +58,7 @@
await tester.pumpWidget(
new Container(
child: new Container(
- child: new Semantics(
+ child: const Semantics(
label: 'test'
)
)
@@ -78,7 +78,7 @@
child: new Semantics(
checked: true,
child: new Container(
- child: new Semantics(
+ child: const Semantics(
label: 'test'
)
)
@@ -105,7 +105,7 @@
child: new Semantics(
checked: true,
child: new Container(
- child: new Semantics(
+ child: const Semantics(
label: 'test'
)
)
diff --git a/packages/flutter/test/widgets/semantics_4_test.dart b/packages/flutter/test/widgets/semantics_4_test.dart
index 61d56e3..014aa06 100644
--- a/packages/flutter/test/widgets/semantics_4_test.dart
+++ b/packages/flutter/test/widgets/semantics_4_test.dart
@@ -23,17 +23,17 @@
await tester.pumpWidget(
new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
label: 'L1'
),
new Semantics(
label: 'L2',
child: new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
checked: true
),
- new Semantics(
+ const Semantics(
checked: false
)
]
@@ -77,17 +77,17 @@
await tester.pumpWidget(
new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
label: 'L1'
),
new Semantics(
label: 'L2',
child: new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
checked: true
),
- new Semantics()
+ const Semantics()
]
)
)
@@ -119,15 +119,15 @@
await tester.pumpWidget(
new Stack(
children: <Widget>[
- new Semantics(),
+ const Semantics(),
new Semantics(
label: 'L2',
child: new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
checked: true
),
- new Semantics()
+ const Semantics()
]
)
)
diff --git a/packages/flutter/test/widgets/semantics_5_test.dart b/packages/flutter/test/widgets/semantics_5_test.dart
index 48e81f3..47fec03 100644
--- a/packages/flutter/test/widgets/semantics_5_test.dart
+++ b/packages/flutter/test/widgets/semantics_5_test.dart
@@ -15,14 +15,14 @@
await tester.pumpWidget(
new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
// this tests that empty nodes disappear
),
- new Semantics(
+ const Semantics(
// this tests whether you can have a container with no other semantics
container: true
),
- new Semantics(
+ const Semantics(
label: 'label' // (force a fork)
),
]
diff --git a/packages/flutter/test/widgets/semantics_7_test.dart b/packages/flutter/test/widgets/semantics_7_test.dart
index 5570626..0d93968 100644
--- a/packages/flutter/test/widgets/semantics_7_test.dart
+++ b/packages/flutter/test/widgets/semantics_7_test.dart
@@ -33,7 +33,7 @@
new MergeSemantics(
child: new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
checked: true
),
new Semantics(
@@ -83,7 +83,7 @@
new MergeSemantics(
child: new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
checked: true
),
new Semantics(
diff --git a/packages/flutter/test/widgets/semantics_8_test.dart b/packages/flutter/test/widgets/semantics_8_test.dart
index 0383c40..feb31d8 100644
--- a/packages/flutter/test/widgets/semantics_8_test.dart
+++ b/packages/flutter/test/widgets/semantics_8_test.dart
@@ -22,10 +22,10 @@
container: true,
child: new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
checked: true
),
- new Semantics(
+ const Semantics(
label: 'label'
)
]
@@ -52,10 +52,10 @@
container: true,
child: new Stack(
children: <Widget>[
- new Semantics(
+ const Semantics(
label: 'label'
),
- new Semantics(
+ const Semantics(
checked: true
)
]
diff --git a/packages/flutter/test/widgets/semantics_debugger_test.dart b/packages/flutter/test/widgets/semantics_debugger_test.dart
index b0bddcc..d4b5550 100644
--- a/packages/flutter/test/widgets/semantics_debugger_test.dart
+++ b/packages/flutter/test/widgets/semantics_debugger_test.dart
@@ -12,11 +12,11 @@
await tester.pumpWidget(
new Stack(
children: <Widget>[
- new Semantics(),
- new Semantics(
+ const Semantics(),
+ const Semantics(
container: true,
),
- new Semantics(
+ const Semantics(
label: 'label',
),
],
@@ -27,11 +27,11 @@
new SemanticsDebugger(
child: new Stack(
children: <Widget>[
- new Semantics(),
- new Semantics(
+ const Semantics(),
+ const Semantics(
container: true,
),
- new Semantics(
+ const Semantics(
label: 'label',
),
],
@@ -50,14 +50,14 @@
new SemanticsDebugger(
child: new Stack(
children: <Widget>[
- new Semantics(label: 'label1'),
+ const Semantics(label: 'label1'),
new Positioned(
key: key,
left: 0.0,
top: 0.0,
width: 100.0,
height: 100.0,
- child: new Semantics(label: 'label2'),
+ child: const Semantics(label: 'label2'),
),
],
),
@@ -68,7 +68,7 @@
new SemanticsDebugger(
child: new Stack(
children: <Widget>[
- new Semantics(label: 'label1'),
+ const Semantics(label: 'label1'),
new Semantics(
container: true,
child: new Stack(
@@ -79,9 +79,9 @@
top: 0.0,
width: 100.0,
height: 100.0,
- child: new Semantics(label: 'label2'),
+ child: const Semantics(label: 'label2'),
),
- new Semantics(label: 'label3'),
+ const Semantics(label: 'label3'),
],
),
),
@@ -94,7 +94,7 @@
new SemanticsDebugger(
child: new Stack(
children: <Widget>[
- new Semantics(label: 'label1'),
+ const Semantics(label: 'label1'),
new Semantics(
container: true,
child: new Stack(
@@ -105,9 +105,9 @@
top: 0.0,
width: 100.0,
height: 100.0,
- child: new Semantics(label: 'label2')),
- new Semantics(label: 'label3'),
- new Semantics(label: 'label4'),
+ child: const Semantics(label: 'label2')),
+ const Semantics(label: 'label3'),
+ const Semantics(label: 'label4'),
],
),
),
@@ -132,13 +132,13 @@
onPressed: () {
log.add('top');
},
- child: new Text('TOP'),
+ child: const Text('TOP'),
),
new RaisedButton(
onPressed: () {
log.add('bottom');
},
- child: new Text('BOTTOM'),
+ child: const Text('BOTTOM'),
),
],
),
@@ -205,7 +205,7 @@
expect(didLongPress, isFalse);
didLongPress = true;
},
- child: new Text('target'),
+ child: const Text('target'),
),
),
);
diff --git a/packages/flutter/test/widgets/set_state_1_test.dart b/packages/flutter/test/widgets/set_state_1_test.dart
index 64e10b1..2ce0f1f 100644
--- a/packages/flutter/test/widgets/set_state_1_test.dart
+++ b/packages/flutter/test/widgets/set_state_1_test.dart
@@ -15,7 +15,7 @@
Widget build(BuildContext context) {
return new Listener(
onPointerDown: _handlePointerDown,
- child: new Text('INSIDE')
+ child: const Text('INSIDE')
);
}
diff --git a/packages/flutter/test/widgets/set_state_2_test.dart b/packages/flutter/test/widgets/set_state_2_test.dart
index f5783ad..608858e 100644
--- a/packages/flutter/test/widgets/set_state_2_test.dart
+++ b/packages/flutter/test/widgets/set_state_2_test.dart
@@ -11,7 +11,7 @@
final Builder inner = new Builder(
builder: (BuildContext context) {
log.add('inner');
- return new Text('inner');
+ return const Text('inner');
}
);
int value = 0;
diff --git a/packages/flutter/test/widgets/set_state_3_test.dart b/packages/flutter/test/widgets/set_state_3_test.dart
index 4a51346..0db63bd 100644
--- a/packages/flutter/test/widgets/set_state_3_test.dart
+++ b/packages/flutter/test/widgets/set_state_3_test.dart
@@ -47,7 +47,7 @@
class LeafState extends State<Leaf> {
@override
- Widget build(BuildContext context) => new Text("leaf");
+ Widget build(BuildContext context) => const Text("leaf");
}
void main() {
diff --git a/packages/flutter/test/widgets/set_state_4_test.dart b/packages/flutter/test/widgets/set_state_4_test.dart
index 5549860..c74afb4 100644
--- a/packages/flutter/test/widgets/set_state_4_test.dart
+++ b/packages/flutter/test/widgets/set_state_4_test.dart
@@ -16,7 +16,7 @@
void test2() { setState(() async { }); }
@override
- Widget build(BuildContext context) => new Text('test');
+ Widget build(BuildContext context) => const Text('test');
}
void main() {
diff --git a/packages/flutter/test/widgets/sliver_fill_remaining_test.dart b/packages/flutter/test/widgets/sliver_fill_remaining_test.dart
index 2bb2a2f..214efd2 100644
--- a/packages/flutter/test/widgets/sliver_fill_remaining_test.dart
+++ b/packages/flutter/test/widgets/sliver_fill_remaining_test.dart
@@ -37,7 +37,7 @@
new CustomScrollView(
controller: controller,
slivers: <Widget>[
- new SliverToBoxAdapter(child: new SizedBox(height: 100.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 100.0)),
new SliverFillRemaining(child: new Container()),
],
),
diff --git a/packages/flutter/test/widgets/slivers_appbar_floating_test.dart b/packages/flutter/test/widgets/slivers_appbar_floating_test.dart
index c7ded30..668063d 100644
--- a/packages/flutter/test/widgets/slivers_appbar_floating_test.dart
+++ b/packages/flutter/test/widgets/slivers_appbar_floating_test.dart
@@ -191,9 +191,9 @@
new SliverPersistentHeader(delegate: new TestDelegate(), floating: true),
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(
+ const SizedBox(
height: 300.0,
- child: new Text('X'),
+ child: const Text('X'),
),
]),
),
diff --git a/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart b/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart
index 34eac49..d8ad36f 100644
--- a/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart
+++ b/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart
@@ -186,9 +186,9 @@
new SliverPersistentHeader(delegate: new TestDelegate(), pinned: true),
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(
+ const SizedBox(
height: 300.0,
- child: new Text('X'),
+ child: const Text('X'),
),
]),
),
diff --git a/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart b/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart
index aea4c40..4a45ddc 100644
--- a/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart
+++ b/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart
@@ -76,9 +76,9 @@
new SliverPersistentHeader(delegate: new TestDelegate()),
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(
+ const SizedBox(
height: 300.0,
- child: new Text('X'),
+ child: const Text('X'),
),
]),
),
diff --git a/packages/flutter/test/widgets/slivers_block_test.dart b/packages/flutter/test/widgets/slivers_block_test.dart
index 4505693..b8ab56f 100644
--- a/packages/flutter/test/widgets/slivers_block_test.dart
+++ b/packages/flutter/test/widgets/slivers_block_test.dart
@@ -14,11 +14,11 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(height: 400.0, child: new Text('a')),
- new SizedBox(height: 400.0, child: new Text('b')),
- new SizedBox(height: 400.0, child: new Text('c')),
- new SizedBox(height: 400.0, child: new Text('d')),
- new SizedBox(height: 400.0, child: new Text('e')),
+ const SizedBox(height: 400.0, child: const Text('a')),
+ const SizedBox(height: 400.0, child: const Text('b')),
+ const SizedBox(height: 400.0, child: const Text('c')),
+ const SizedBox(height: 400.0, child: const Text('d')),
+ const SizedBox(height: 400.0, child: const Text('e')),
]),
),
],
@@ -79,9 +79,9 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(height: 251.0, child: new Text('a')),
- new SizedBox(height: 252.0, child: new Text('b')),
- new SizedBox(key: key1, height: 253.0, child: new Text('c')),
+ const SizedBox(height: 251.0, child: const Text('a')),
+ const SizedBox(height: 252.0, child: const Text('b')),
+ new SizedBox(key: key1, height: 253.0, child: const Text('c')),
]),
),
],
@@ -96,9 +96,9 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(key: key1, height: 253.0, child: new Text('c')),
- new SizedBox(height: 251.0, child: new Text('a')),
- new SizedBox(height: 252.0, child: new Text('b')),
+ new SizedBox(key: key1, height: 253.0, child: const Text('c')),
+ const SizedBox(height: 251.0, child: const Text('a')),
+ const SizedBox(height: 252.0, child: const Text('b')),
]),
),
],
@@ -113,9 +113,9 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(height: 251.0, child: new Text('a')),
- new SizedBox(key: key1, height: 253.0, child: new Text('c')),
- new SizedBox(height: 252.0, child: new Text('b')),
+ const SizedBox(height: 251.0, child: const Text('a')),
+ new SizedBox(key: key1, height: 253.0, child: const Text('c')),
+ const SizedBox(height: 252.0, child: const Text('b')),
]),
),
],
@@ -130,8 +130,8 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(height: 251.0, child: new Text('a')),
- new SizedBox(height: 252.0, child: new Text('b')),
+ const SizedBox(height: 251.0, child: const Text('a')),
+ const SizedBox(height: 252.0, child: const Text('b')),
]),
),
],
@@ -145,9 +145,9 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(height: 251.0, child: new Text('a')),
- new SizedBox(key: key1, height: 253.0, child: new Text('c')),
- new SizedBox(height: 252.0, child: new Text('b')),
+ const SizedBox(height: 251.0, child: const Text('a')),
+ new SizedBox(key: key1, height: 253.0, child: const Text('c')),
+ const SizedBox(height: 252.0, child: const Text('b')),
]),
),
],
@@ -163,8 +163,8 @@
await tester.pumpWidget(new Viewport(
offset: new ViewportOffset.zero(),
slivers: <Widget>[
- new SliverToBoxAdapter(
- child: new SizedBox(height: 400.0, child: new Text('a')),
+ const SliverToBoxAdapter(
+ child: const SizedBox(height: 400.0, child: const Text('a')),
),
],
));
@@ -174,8 +174,8 @@
await tester.pumpWidget(new Viewport(
offset: new ViewportOffset.fixed(100.0),
slivers: <Widget>[
- new SliverToBoxAdapter(
- child: new SizedBox(height: 400.0, child: new Text('a')),
+ const SliverToBoxAdapter(
+ child: const SizedBox(height: 400.0, child: const Text('a')),
),
],
));
@@ -185,8 +185,8 @@
await tester.pumpWidget(new Viewport(
offset: new ViewportOffset.fixed(100.0),
slivers: <Widget>[
- new SliverToBoxAdapter(
- child: new SizedBox(height: 4000.0, child: new Text('a')),
+ const SliverToBoxAdapter(
+ child: const SizedBox(height: 4000.0, child: const Text('a')),
),
],
));
@@ -196,8 +196,8 @@
await tester.pumpWidget(new Viewport(
offset: new ViewportOffset.zero(),
slivers: <Widget>[
- new SliverToBoxAdapter(
- child: new SizedBox(height: 4000.0, child: new Text('a')),
+ const SliverToBoxAdapter(
+ child: const SizedBox(height: 4000.0, child: const Text('a')),
),
],
));
@@ -211,7 +211,7 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(height: 400.0, child: new Text('a')),
+ const SizedBox(height: 400.0, child: const Text('a')),
]),
),
],
@@ -224,7 +224,7 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(height: 400.0, child: new Text('a')),
+ const SizedBox(height: 400.0, child: const Text('a')),
]),
),
],
@@ -237,7 +237,7 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(height: 4000.0, child: new Text('a')),
+ const SizedBox(height: 4000.0, child: const Text('a')),
]),
),
],
@@ -250,7 +250,7 @@
slivers: <Widget>[
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
- new SizedBox(height: 4000.0, child: new Text('a')),
+ const SizedBox(height: 4000.0, child: const Text('a')),
]),
),
],
diff --git a/packages/flutter/test/widgets/slivers_padding_test.dart b/packages/flutter/test/widgets/slivers_padding_test.dart
index 0a88339..4d7fbb0 100644
--- a/packages/flutter/test/widgets/slivers_padding_test.dart
+++ b/packages/flutter/test/widgets/slivers_padding_test.dart
@@ -11,12 +11,12 @@
offset: new ViewportOffset.fixed(offset),
axisDirection: axisDirection,
slivers: <Widget>[
- new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('before'))),
+ const SliverToBoxAdapter(child: const SizedBox(width: 400.0, height: 400.0, child: const Text('before'))),
new SliverPadding(
padding: padding,
- sliver: new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('padded'))),
+ sliver: const SliverToBoxAdapter(child: const SizedBox(width: 400.0, height: 400.0, child: const Text('padded'))),
),
- new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('after'))),
+ const SliverToBoxAdapter(child: const SizedBox(width: 400.0, height: 400.0, child: const Text('after'))),
],
));
}
@@ -164,8 +164,8 @@
await tester.pumpWidget(new Viewport(
offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[
- new SliverPadding(padding: const EdgeInsets.all(100.0)),
- new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('x'))),
+ const SliverPadding(padding: const EdgeInsets.all(100.0)),
+ const SliverToBoxAdapter(child: const SizedBox(width: 400.0, height: 400.0, child: const Text('x'))),
],
));
expect(tester.renderObject<RenderBox>(find.text('x')).localToGlobal(Point.origin), const Point(0.0, 200.0));
@@ -176,8 +176,8 @@
axisDirection: AxisDirection.left,
offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[
- new SliverPadding(padding: const EdgeInsets.fromLTRB(90.0, 1.0, 110.0, 2.0)),
- new SliverToBoxAdapter(child: new SizedBox(width: 201.0, child: new Text('x'))),
+ const SliverPadding(padding: const EdgeInsets.fromLTRB(90.0, 1.0, 110.0, 2.0)),
+ const SliverToBoxAdapter(child: const SizedBox(width: 201.0, child: const Text('x'))),
],
));
expect(tester.renderObject<RenderBox>(find.text('x')).localToGlobal(Point.origin), const Point(399.0, 0.0));
@@ -185,8 +185,8 @@
axisDirection: AxisDirection.left,
offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[
- new SliverPadding(padding: const EdgeInsets.fromLTRB(110.0, 1.0, 80.0, 2.0)),
- new SliverToBoxAdapter(child: new SizedBox(width: 201.0, child: new Text('x'))),
+ const SliverPadding(padding: const EdgeInsets.fromLTRB(110.0, 1.0, 80.0, 2.0)),
+ const SliverToBoxAdapter(child: const SizedBox(width: 201.0, child: const Text('x'))),
],
));
expect(tester.renderObject<RenderBox>(find.text('x')).localToGlobal(Point.origin), const Point(409.0, 0.0));
@@ -197,7 +197,7 @@
axisDirection: AxisDirection.up,
offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[
- new SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
+ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
],
));
expect(tester.renderObject<RenderSliverPadding>(find.byType(SliverPadding)).afterPadding, 2.0);
@@ -205,7 +205,7 @@
axisDirection: AxisDirection.down,
offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[
- new SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
+ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
],
));
expect(tester.renderObject<RenderSliverPadding>(find.byType(SliverPadding)).afterPadding, 8.0);
@@ -213,7 +213,7 @@
axisDirection: AxisDirection.right,
offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[
- new SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
+ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
],
));
expect(tester.renderObject<RenderSliverPadding>(find.byType(SliverPadding)).afterPadding, 4.0);
@@ -221,7 +221,7 @@
axisDirection: AxisDirection.left,
offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[
- new SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
+ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
],
));
expect(tester.renderObject<RenderSliverPadding>(find.byType(SliverPadding)).afterPadding, 1.0);
@@ -229,7 +229,7 @@
axisDirection: AxisDirection.left,
offset: new ViewportOffset.fixed(99999.9),
slivers: <Widget>[
- new SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
+ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
],
));
expect(tester.renderObject<RenderSliverPadding>(find.byType(SliverPadding)).afterPadding, 1.0);
diff --git a/packages/flutter/test/widgets/slivers_test.dart b/packages/flutter/test/widgets/slivers_test.dart
index 0a28148..9b46be9 100644
--- a/packages/flutter/test/widgets/slivers_test.dart
+++ b/packages/flutter/test/widgets/slivers_test.dart
@@ -11,11 +11,11 @@
anchor: anchor / 600.0,
offset: new ViewportOffset.fixed(offset),
slivers: <Widget>[
- new SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
- new SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
- new SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
- new SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
- new SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
+ const SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
],
));
}
diff --git a/packages/flutter/test/widgets/state_setting_in_scrollables_test.dart b/packages/flutter/test/widgets/state_setting_in_scrollables_test.dart
index 6397189..0be4eb5 100644
--- a/packages/flutter/test/widgets/state_setting_in_scrollables_test.dart
+++ b/packages/flutter/test/widgets/state_setting_in_scrollables_test.dart
@@ -27,38 +27,38 @@
setState(() { /* this is needed to trigger the original bug this is regression-testing */ });
scrollController.animateTo(200.0, duration: const Duration(milliseconds: 500), curve: Curves.linear);
},
- child: new DecoratedBox(
+ child: const DecoratedBox(
decoration: const BoxDecoration(backgroundColor: const Color(0)),
child: const SizedBox(
height: 200.0,
),
)
),
- new DecoratedBox(
+ const DecoratedBox(
decoration: const BoxDecoration(backgroundColor: const Color(0)),
child: const SizedBox(
height: 200.0,
),
),
- new DecoratedBox(
+ const DecoratedBox(
decoration: const BoxDecoration(backgroundColor: const Color(0)),
child: const SizedBox(
height: 200.0,
),
),
- new DecoratedBox(
+ const DecoratedBox(
decoration: const BoxDecoration(backgroundColor: const Color(0)),
child: const SizedBox(
height: 200.0,
),
),
- new DecoratedBox(
+ const DecoratedBox(
decoration: const BoxDecoration(backgroundColor: const Color(0)),
child: const SizedBox(
height: 200.0,
),
),
- new DecoratedBox(
+ const DecoratedBox(
decoration: const BoxDecoration(backgroundColor: const Color(0)),
child: const SizedBox(
height: 200.0,
diff --git a/packages/flutter/test/widgets/syncing_test.dart b/packages/flutter/test/widgets/syncing_test.dart
index d5ba7b3..b5cc9ff 100644
--- a/packages/flutter/test/widgets/syncing_test.dart
+++ b/packages/flutter/test/widgets/syncing_test.dart
@@ -111,8 +111,8 @@
});
testWidgets('swap instances around', (WidgetTester tester) async {
- final Widget a = new TestWidget(persistentState: 0x61, syncedState: 0x41, child: new Text('apple'));
- final Widget b = new TestWidget(persistentState: 0x62, syncedState: 0x42, child: new Text('banana'));
+ final Widget a = new TestWidget(persistentState: 0x61, syncedState: 0x41, child: const Text('apple'));
+ final Widget b = new TestWidget(persistentState: 0x62, syncedState: 0x42, child: const Text('banana'));
await tester.pumpWidget(new Column());
final GlobalKey keyA = new GlobalKey();
diff --git a/packages/flutter/test/widgets/table_test.dart b/packages/flutter/test/widgets/table_test.dart
index cbeacde..39c4c13 100644
--- a/packages/flutter/test/widgets/table_test.dart
+++ b/packages/flutter/test/widgets/table_test.dart
@@ -25,17 +25,17 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('AAAAAA'), new Text('B'), new Text('C')
+ const Text('AAAAAA'), const Text('B'), const Text('C')
]
),
new TableRow(
children: <Widget>[
- new Text('D'), new Text('EEE'), new Text('F')
+ const Text('D'), const Text('EEE'), const Text('F')
]
),
new TableRow(
children: <Widget>[
- new Text('G'), new Text('H'), new Text('III')
+ const Text('G'), const Text('H'), const Text('III')
]
),
]
@@ -56,17 +56,17 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('A'), new Text('B'), new Text('C')
+ const Text('A'), const Text('B'), const Text('C')
]
),
new TableRow(
children: <Widget>[
- new Text('D'), new Text('E'), new Text('F')
+ const Text('D'), const Text('E'), const Text('F')
]
),
new TableRow(
children: <Widget>[
- new Text('G'), new Text('H'), new Text('I')
+ const Text('G'), const Text('H'), const Text('I')
]
),
]
@@ -81,12 +81,12 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('a'), new Text('b'), new Text('c'), new Text('d')
+ const Text('a'), const Text('b'), const Text('c'), const Text('d')
]
),
new TableRow(
children: <Widget>[
- new Text('e'), new Text('f'), new Text('g'), new Text('h')
+ const Text('e'), const Text('f'), const Text('g'), const Text('h')
]
),
]
@@ -106,17 +106,17 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('AAAAAA'), new Text('B'), new Text('C')
+ const Text('AAAAAA'), const Text('B'), const Text('C')
]
),
new TableRow(
children: <Widget>[
- new Text('D'), new Text('EEE'), new Text('F')
+ const Text('D'), const Text('EEE'), const Text('F')
]
),
new TableRow(
children: <Widget>[
- new Text('G'), new Text('H'), new Text('III')
+ const Text('G'), const Text('H'), const Text('III')
]
),
]
@@ -127,17 +127,17 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('AAA'), new Text('B'), new Text('C')
+ const Text('AAA'), const Text('B'), const Text('C')
]
),
new TableRow(
children: <Widget>[
- new Text('D'), new Text('E'), new Text('FFFFFF')
+ const Text('D'), const Text('E'), const Text('FFFFFF')
]
),
new TableRow(
children: <Widget>[
- new Text('G'), new Text('H'), new Text('III')
+ const Text('G'), const Text('H'), const Text('III')
]
),
]
@@ -159,17 +159,17 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('AAA'), new Text('B'), new Text('C')
+ const Text('AAA'), const Text('B'), const Text('C')
]
),
new TableRow(
children: <Widget>[
- new Text('D'), new Text('E'), new Text('FFFFFF')
+ const Text('D'), const Text('E'), const Text('FFFFFF')
]
),
new TableRow(
children: <Widget>[
- new Text('G'), new Text('H'), new Text('III')
+ const Text('G'), const Text('H'), const Text('III')
]
),
]
@@ -192,17 +192,17 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('AAAAAA'), new Text('B'), new Text('C')
+ const Text('AAAAAA'), const Text('B'), const Text('C')
]
),
new TableRow(
children: <Widget>[
- new Text('D'), new Text('EEE'), new Text('F')
+ const Text('D'), const Text('EEE'), const Text('F')
]
),
new TableRow(
children: <Widget>[
- new Text('G'), new Text('H'), new Text('III')
+ const Text('G'), const Text('H'), const Text('III')
]
),
]
@@ -214,17 +214,17 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('A'), new Text('B'), new Text('C')
+ const Text('A'), const Text('B'), const Text('C')
]
),
new TableRow(
children: <Widget>[
- new Text('D'), new Text('EEE'), new Text('F')
+ const Text('D'), const Text('EEE'), const Text('F')
]
),
new TableRow(
children: <Widget>[
- new Text('G'), new Text('H'), new Text('III')
+ const Text('G'), const Text('H'), const Text('III')
]
),
]
@@ -246,17 +246,17 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('AAA'), new Text('B'), new Text('C')
+ const Text('AAA'), const Text('B'), const Text('C')
]
),
new TableRow(
children: <Widget>[
- new Text('D'), new Text('E'), new Text('FFFFFF')
+ const Text('D'), const Text('E'), const Text('FFFFFF')
]
),
new TableRow(
children: <Widget>[
- new Text('G'), new Text('H'), new Text('III')
+ const Text('G'), const Text('H'), const Text('III')
]
),
]
@@ -268,17 +268,17 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('AAA'), new Text('B'), new Text('C')
+ const Text('AAA'), const Text('B'), const Text('C')
]
),
new TableRow(
children: <Widget>[
- new Text('D'), new Text('E'), new Text('FFFFFF')
+ const Text('D'), const Text('E'), const Text('FFFFFF')
]
),
new TableRow(
children: <Widget>[
- new Text('G'), new Text('H'), new Text('III')
+ const Text('G'), const Text('H'), const Text('III')
]
),
]
@@ -305,14 +305,14 @@
new StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
contexts.add(context);
- return new Text('A');
+ return const Text('A');
}
)
]
),
new TableRow(
children: <Widget>[
- new Text('b')
+ const Text('b')
]
),
]
@@ -323,7 +323,7 @@
children: <TableRow>[
new TableRow(
children: <Widget>[
- new Text('b')
+ const Text('b')
]
),
new TableRow(
@@ -332,7 +332,7 @@
new StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
contexts.add(context);
- return new Text('A');
+ return const Text('A');
}
)
]
diff --git a/packages/flutter/test/widgets/text_test.dart b/packages/flutter/test/widgets/text_test.dart
index cce7655..282cbed 100644
--- a/packages/flutter/test/widgets/text_test.dart
+++ b/packages/flutter/test/widgets/text_test.dart
@@ -9,8 +9,8 @@
testWidgets('Text respects media query', (WidgetTester tester) async {
await tester.pumpWidget(new MediaQuery(
data: const MediaQueryData(textScaleFactor: 1.5),
- child: new Center(
- child: new Text('Hello')
+ child: const Center(
+ child: const Text('Hello')
)
));
@@ -18,16 +18,16 @@
expect(text, isNotNull);
expect(text.textScaleFactor, 1.5);
- await tester.pumpWidget(new Center(
- child: new Text('Hello')
+ await tester.pumpWidget(const Center(
+ child: const Text('Hello')
));
text = tester.firstWidget(find.byType(RichText));
expect(text, isNotNull);
expect(text.textScaleFactor, 1.0);
- await tester.pumpWidget(new Center(
- child: new Text('Hello', textScaleFactor: 3.0)
+ await tester.pumpWidget(const Center(
+ child: const Text('Hello', textScaleFactor: 3.0)
));
text = tester.firstWidget(find.byType(RichText));
diff --git a/packages/flutter/test/widgets/ticker_provider_test.dart b/packages/flutter/test/widgets/ticker_provider_test.dart
index 1b350e1..177a1af 100644
--- a/packages/flutter/test/widgets/ticker_provider_test.dart
+++ b/packages/flutter/test/widgets/ticker_provider_test.dart
@@ -36,7 +36,7 @@
await tester.pumpWidget(new MaterialApp(
home: new LinearProgressIndicator(),
routes: <String, WidgetBuilder>{
- '/test': (BuildContext context) => new Text('hello'),
+ '/test': (BuildContext context) => const Text('hello'),
},
));
expect(tester.binding.transientCallbackCount, 1);
diff --git a/packages/flutter/test/widgets/transitions_test.dart b/packages/flutter/test/widgets/transitions_test.dart
index 0359570..c92c0a6 100644
--- a/packages/flutter/test/widgets/transitions_test.dart
+++ b/packages/flutter/test/widgets/transitions_test.dart
@@ -9,7 +9,7 @@
testWidgets('toString control test', (WidgetTester tester) async {
final Widget widget = new FadeTransition(
opacity: kAlwaysCompleteAnimation,
- child: new Text('Ready'),
+ child: const Text('Ready'),
);
expect(widget.toString, isNot(throwsException));
});
diff --git a/packages/flutter/test/widgets/wrap_test.dart b/packages/flutter/test/widgets/wrap_test.dart
index efc4416..32e5281 100644
--- a/packages/flutter/test/widgets/wrap_test.dart
+++ b/packages/flutter/test/widgets/wrap_test.dart
@@ -21,10 +21,10 @@
new Wrap(
alignment: WrapAlignment.start,
children: <Widget>[
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
],
),
);
@@ -39,10 +39,10 @@
new Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
],
),
);
@@ -57,10 +57,10 @@
new Wrap(
alignment: WrapAlignment.end,
children: <Widget>[
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
],
),
);
@@ -76,10 +76,10 @@
alignment: WrapAlignment.start,
crossAxisAlignment: WrapCrossAlignment.start,
children: <Widget>[
- new SizedBox(width: 300.0, height: 50.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 50.0),
+ const SizedBox(width: 300.0, height: 50.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 50.0),
],
),
);
@@ -95,10 +95,10 @@
alignment: WrapAlignment.start,
crossAxisAlignment: WrapCrossAlignment.center,
children: <Widget>[
- new SizedBox(width: 300.0, height: 50.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 50.0),
+ const SizedBox(width: 300.0, height: 50.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 50.0),
],
),
);
@@ -114,10 +114,10 @@
alignment: WrapAlignment.start,
crossAxisAlignment: WrapCrossAlignment.end,
children: <Widget>[
- new SizedBox(width: 300.0, height: 50.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 100.0),
- new SizedBox(width: 300.0, height: 50.0),
+ const SizedBox(width: 300.0, height: 50.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 100.0),
+ const SizedBox(width: 300.0, height: 50.0),
],
),
);
@@ -140,9 +140,9 @@
alignment: WrapAlignment.center,
spacing: 5.0,
children: <Widget>[
- new SizedBox(width: 100.0, height: 10.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 300.0, height: 30.0),
+ const SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 300.0, height: 30.0),
],
));
expect(tester.renderObject<RenderBox>(find.byType(Wrap)).size, equals(const Size(800.0, 600.0)));
@@ -156,9 +156,9 @@
alignment: WrapAlignment.spaceBetween,
spacing: 5.0,
children: <Widget>[
- new SizedBox(width: 100.0, height: 10.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 300.0, height: 30.0),
+ const SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 300.0, height: 30.0),
],
));
expect(tester.renderObject<RenderBox>(find.byType(Wrap)).size, equals(const Size(800.0, 600.0)));
@@ -172,9 +172,9 @@
alignment: WrapAlignment.spaceAround,
spacing: 5.0,
children: <Widget>[
- new SizedBox(width: 100.0, height: 10.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 310.0, height: 30.0),
+ const SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 310.0, height: 30.0),
],
));
expect(tester.renderObject<RenderBox>(find.byType(Wrap)).size, equals(const Size(800.0, 600.0)));
@@ -188,9 +188,9 @@
alignment: WrapAlignment.spaceEvenly,
spacing: 5.0,
children: <Widget>[
- new SizedBox(width: 100.0, height: 10.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 310.0, height: 30.0),
+ const SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 310.0, height: 30.0),
],
));
expect(tester.renderObject<RenderBox>(find.byType(Wrap)).size, equals(const Size(800.0, 600.0)));
@@ -206,11 +206,11 @@
runAlignment: WrapAlignment.center,
runSpacing: 5.0,
children: <Widget>[
- new SizedBox(width: 100.0, height: 10.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 300.0, height: 30.0),
- new SizedBox(width: 400.0, height: 40.0),
- new SizedBox(width: 500.0, height: 60.0),
+ const SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 300.0, height: 30.0),
+ const SizedBox(width: 400.0, height: 40.0),
+ const SizedBox(width: 500.0, height: 60.0),
],
));
expect(tester.renderObject<RenderBox>(find.byType(Wrap)).size, equals(const Size(800.0, 600.0)));
@@ -226,11 +226,11 @@
runAlignment: WrapAlignment.spaceBetween,
runSpacing: 5.0,
children: <Widget>[
- new SizedBox(width: 100.0, height: 10.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 300.0, height: 30.0),
- new SizedBox(width: 400.0, height: 40.0),
- new SizedBox(width: 500.0, height: 60.0),
+ const SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 300.0, height: 30.0),
+ const SizedBox(width: 400.0, height: 40.0),
+ const SizedBox(width: 500.0, height: 60.0),
],
));
expect(tester.renderObject<RenderBox>(find.byType(Wrap)).size, equals(const Size(800.0, 600.0)));
@@ -246,11 +246,11 @@
runAlignment: WrapAlignment.spaceAround,
runSpacing: 5.0,
children: <Widget>[
- new SizedBox(width: 100.0, height: 10.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 300.0, height: 30.0),
- new SizedBox(width: 400.0, height: 40.0),
- new SizedBox(width: 500.0, height: 70.0),
+ const SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 300.0, height: 30.0),
+ const SizedBox(width: 400.0, height: 40.0),
+ const SizedBox(width: 500.0, height: 70.0),
],
));
expect(tester.renderObject<RenderBox>(find.byType(Wrap)).size, equals(const Size(800.0, 600.0)));
@@ -266,11 +266,11 @@
runAlignment: WrapAlignment.spaceEvenly,
runSpacing: 5.0,
children: <Widget>[
- new SizedBox(width: 100.0, height: 10.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 300.0, height: 30.0),
- new SizedBox(width: 400.0, height: 40.0),
- new SizedBox(width: 500.0, height: 60.0),
+ const SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 300.0, height: 30.0),
+ const SizedBox(width: 400.0, height: 40.0),
+ const SizedBox(width: 500.0, height: 60.0),
],
));
expect(tester.renderObject<RenderBox>(find.byType(Wrap)).size, equals(const Size(800.0, 600.0)));
@@ -292,10 +292,10 @@
alignment: WrapAlignment.end,
crossAxisAlignment: WrapCrossAlignment.end,
children: <Widget>[
- new SizedBox(width: 100.0, height: 10.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 300.0, height: 30.0),
- new SizedBox(width: 400.0, height: 40.0),
+ const SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 300.0, height: 30.0),
+ const SizedBox(width: 400.0, height: 40.0),
],
),
),
@@ -315,10 +315,10 @@
alignment: WrapAlignment.end,
crossAxisAlignment: WrapCrossAlignment.end,
children: <Widget>[
- new SizedBox(width: 400.0, height: 40.0),
- new SizedBox(width: 300.0, height: 30.0),
- new SizedBox(width: 200.0, height: 20.0),
- new SizedBox(width: 100.0, height: 10.0),
+ const SizedBox(width: 400.0, height: 40.0),
+ const SizedBox(width: 300.0, height: 30.0),
+ const SizedBox(width: 200.0, height: 20.0),
+ const SizedBox(width: 100.0, height: 10.0),
],
),
),
@@ -341,10 +341,10 @@
alignment: WrapAlignment.start,
crossAxisAlignment: WrapCrossAlignment.start,
children: <Widget>[
- new SizedBox(width: 500.0, height: 10.0),
- new SizedBox(width: 500.0, height: 20.0),
- new SizedBox(width: 500.0, height: 30.0),
- new SizedBox(width: 500.0, height: 40.0),
+ const SizedBox(width: 500.0, height: 10.0),
+ const SizedBox(width: 500.0, height: 20.0),
+ const SizedBox(width: 500.0, height: 30.0),
+ const SizedBox(width: 500.0, height: 40.0),
],
),
),
@@ -369,12 +369,12 @@
alignment: WrapAlignment.start,
crossAxisAlignment: WrapCrossAlignment.start,
children: <Widget>[
- new SizedBox(width: 10.0, height: 250.0),
- new SizedBox(width: 20.0, height: 250.0),
- new SizedBox(width: 30.0, height: 250.0),
- new SizedBox(width: 40.0, height: 250.0),
- new SizedBox(width: 50.0, height: 250.0),
- new SizedBox(width: 60.0, height: 250.0),
+ const SizedBox(width: 10.0, height: 250.0),
+ const SizedBox(width: 20.0, height: 250.0),
+ const SizedBox(width: 30.0, height: 250.0),
+ const SizedBox(width: 40.0, height: 250.0),
+ const SizedBox(width: 50.0, height: 250.0),
+ const SizedBox(width: 60.0, height: 250.0),
],
),
),
@@ -397,12 +397,12 @@
spacing: 12.0,
runSpacing: 8.0,
children: <Widget>[
- new SizedBox(width: 10.0, height: 250.0),
- new SizedBox(width: 20.0, height: 250.0),
- new SizedBox(width: 30.0, height: 250.0),
- new SizedBox(width: 40.0, height: 250.0),
- new SizedBox(width: 50.0, height: 250.0),
- new SizedBox(width: 60.0, height: 250.0),
+ const SizedBox(width: 10.0, height: 250.0),
+ const SizedBox(width: 20.0, height: 250.0),
+ const SizedBox(width: 30.0, height: 250.0),
+ const SizedBox(width: 40.0, height: 250.0),
+ const SizedBox(width: 50.0, height: 250.0),
+ const SizedBox(width: 60.0, height: 250.0),
],
),
),
@@ -421,7 +421,7 @@
testWidgets('Visual overflow generates a clip', (WidgetTester tester) async {
await tester.pumpWidget(new Wrap(
children: <Widget>[
- new SizedBox(width: 500.0, height: 500.0),
+ const SizedBox(width: 500.0, height: 500.0),
],
));
@@ -429,8 +429,8 @@
await tester.pumpWidget(new Wrap(
children: <Widget>[
- new SizedBox(width: 500.0, height: 500.0),
- new SizedBox(width: 500.0, height: 500.0),
+ const SizedBox(width: 500.0, height: 500.0),
+ const SizedBox(width: 500.0, height: 500.0),
],
));
@@ -444,10 +444,10 @@
spacing: 10.0,
runSpacing: 15.0,
children: <Widget>[
- new SizedBox(width: 200.0, height: 300.0),
- new SizedBox(width: 200.0, height: 300.0),
- new SizedBox(width: 200.0, height: 300.0),
- new SizedBox(width: 200.0, height: 300.0),
+ const SizedBox(width: 200.0, height: 300.0),
+ const SizedBox(width: 200.0, height: 300.0),
+ const SizedBox(width: 200.0, height: 300.0),
+ const SizedBox(width: 200.0, height: 300.0),
new SizedBox(
width: 200.0,
height: 300.0,
@@ -484,10 +484,10 @@
direction: Axis.vertical,
runSpacing: 7.0,
children: <Widget>[
- new SizedBox(width: 500.0, height: 400.0),
- new SizedBox(width: 500.0, height: 400.0),
- new SizedBox(width: 500.0, height: 400.0),
- new SizedBox(width: 500.0, height: 400.0),
+ const SizedBox(width: 500.0, height: 400.0),
+ const SizedBox(width: 500.0, height: 400.0),
+ const SizedBox(width: 500.0, height: 400.0),
+ const SizedBox(width: 500.0, height: 400.0),
],
));
@@ -509,7 +509,7 @@
),
child: new Wrap(
children: <Widget>[
- new Text('X'),
+ const Text('X'),
],
),
),
diff --git a/packages/flutter_markdown/example/demo.dart b/packages/flutter_markdown/example/demo.dart
index ceb9e48..3a99dd6 100644
--- a/packages/flutter_markdown/example/demo.dart
+++ b/packages/flutter_markdown/example/demo.dart
@@ -30,7 +30,7 @@
runApp(new MaterialApp(
title: "Markdown Demo",
home: new Scaffold(
- appBar: new AppBar(title: new Text('Markdown Demo')),
+ appBar: new AppBar(title: const Text('Markdown Demo')),
body: new Markdown(data: _kMarkdownData)
)
));
diff --git a/packages/flutter_markdown/lib/src/builder.dart b/packages/flutter_markdown/lib/src/builder.dart
index 1621963..7b91ba0 100644
--- a/packages/flutter_markdown/lib/src/builder.dart
+++ b/packages/flutter_markdown/lib/src/builder.dart
@@ -214,7 +214,7 @@
Widget _buildBullet(String listTag) {
if (listTag == 'ul')
- return new Text('•', textAlign: TextAlign.center);
+ return const Text('•', textAlign: TextAlign.center);
final int index = _blocks.last.nextListIndex;
return new Padding(
diff --git a/packages/flutter_markdown/lib/src/style_sheet.dart b/packages/flutter_markdown/lib/src/style_sheet.dart
index ed6eecd..f8c0f38 100644
--- a/packages/flutter_markdown/lib/src/style_sheet.dart
+++ b/packages/flutter_markdown/lib/src/style_sheet.dart
@@ -46,7 +46,7 @@
/// Creates a [MarkdownStyleSheet] from the [TextStyle]s in the provided [ThemeData].
factory MarkdownStyleSheet.fromTheme(ThemeData theme) {
return new MarkdownStyleSheet(
- a: new TextStyle(color: Colors.blue),
+ a: const TextStyle(color: Colors.blue),
p: theme.textTheme.body1,
code: new TextStyle(
color: Colors.grey.shade700,
@@ -83,7 +83,7 @@
/// [MarkdownStyle.fromTheme].
factory MarkdownStyleSheet.largeFromTheme(ThemeData theme) {
return new MarkdownStyleSheet(
- a: new TextStyle(color: Colors.blue),
+ a: const TextStyle(color: Colors.blue),
p: theme.textTheme.body1,
code: new TextStyle(
color: Colors.grey.shade700,
diff --git a/packages/flutter_test/lib/src/binding.dart b/packages/flutter_test/lib/src/binding.dart
index 0de01e0..7bb8ae7 100644
--- a/packages/flutter_test/lib/src/binding.dart
+++ b/packages/flutter_test/lib/src/binding.dart
@@ -244,15 +244,15 @@
fontSize: 40.0
);
- static final Widget _kPreTestMessage = new Center(
- child: new Text(
+ static final Widget _kPreTestMessage = const Center(
+ child: const Text(
'Test starting...',
style: _kMessageStyle
)
);
- static final Widget _kPostTestMessage = new Center(
- child: new Text(
+ static final Widget _kPostTestMessage = const Center(
+ child: const Text(
'Test finished.',
style: _kMessageStyle
)
diff --git a/packages/flutter_test/test/widget_tester_test.dart b/packages/flutter_test/test/widget_tester_test.dart
index f1c9ded..e3c061b 100644
--- a/packages/flutter_test/test/widget_tester_test.dart
+++ b/packages/flutter_test/test/widget_tester_test.dart
@@ -8,7 +8,7 @@
void main() {
group('findsOneWidget', () {
testWidgets('finds exactly one widget', (WidgetTester tester) async {
- await tester.pumpWidget(new Text('foo'));
+ await tester.pumpWidget(const Text('foo'));
expect(find.text('foo'), findsOneWidget);
});
@@ -34,7 +34,7 @@
});
testWidgets('fails with a descriptive message', (WidgetTester tester) async {
- await tester.pumpWidget(new Text('foo'));
+ await tester.pumpWidget(const Text('foo'));
TestFailure failure;
try {
@@ -52,7 +52,7 @@
});
testWidgets('fails with a descriptive message when skipping', (WidgetTester tester) async {
- await tester.pumpWidget(new Text('foo'));
+ await tester.pumpWidget(const Text('foo'));
TestFailure failure;
try {
@@ -70,7 +70,7 @@
});
testWidgets('pumping', (WidgetTester tester) async {
- await tester.pumpWidget(new Text('foo'));
+ await tester.pumpWidget(const Text('foo'));
int count;
final AnimationController test = new AnimationController(
@@ -106,7 +106,7 @@
group('find.byElementPredicate', () {
testWidgets('fails with a custom description in the message', (WidgetTester tester) async {
- await tester.pumpWidget(new Text('foo'));
+ await tester.pumpWidget(const Text('foo'));
final String customDescription = 'custom description';
TestFailure failure;
@@ -123,7 +123,7 @@
group('find.byWidgetPredicate', () {
testWidgets('fails with a custom description in the message', (WidgetTester tester) async {
- await tester.pumpWidget(new Text('foo'));
+ await tester.pumpWidget(const Text('foo'));
final String customDescription = 'custom description';
TestFailure failure;
@@ -141,7 +141,7 @@
group('find.descendant', () {
testWidgets('finds one descendant', (WidgetTester tester) async {
await tester.pumpWidget(new Row(children: <Widget>[
- new Column(children: <Text>[new Text('foo'), new Text('bar')])
+ new Column(children: <Text>[const Text('foo'), const Text('bar')])
]));
expect(find.descendant(
@@ -152,8 +152,8 @@
testWidgets('finds two descendants with different ancestors', (WidgetTester tester) async {
await tester.pumpWidget(new Row(children: <Widget>[
- new Column(children: <Text>[new Text('foo'), new Text('bar')]),
- new Column(children: <Text>[new Text('foo'), new Text('bar')]),
+ new Column(children: <Text>[const Text('foo'), const Text('bar')]),
+ new Column(children: <Text>[const Text('foo'), const Text('bar')]),
]));
expect(find.descendant(
@@ -164,8 +164,8 @@
testWidgets('fails with a descriptive message', (WidgetTester tester) async {
await tester.pumpWidget(new Row(children: <Widget>[
- new Column(children: <Text>[new Text('foo')]),
- new Text('bar')
+ new Column(children: <Text>[const Text('foo')]),
+ const Text('bar')
]));
TestFailure failure;
diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart
index 8eb52e5..0a08b1b 100644
--- a/packages/flutter_tools/lib/src/android/android_device.dart
+++ b/packages/flutter_tools/lib/src/android/android_device.dart
@@ -616,7 +616,7 @@
_timeOrigin = null;
runCommand(device.adbCommandForDevice(args)).then<Null>((Process process) {
_process = process;
- final Utf8Decoder decoder = new Utf8Decoder(allowMalformed: true);
+ final Utf8Decoder decoder = const Utf8Decoder(allowMalformed: true);
_process.stdout.transform(decoder).transform(const LineSplitter()).listen(_onLine);
_process.stderr.transform(decoder).transform(const LineSplitter()).listen(_onLine);
_process.exitCode.whenComplete(() {
diff --git a/packages/flutter_tools/lib/src/base/io.dart b/packages/flutter_tools/lib/src/base/io.dart
index be1b46a..d28fc67 100644
--- a/packages/flutter_tools/lib/src/base/io.dart
+++ b/packages/flutter_tools/lib/src/base/io.dart
@@ -138,7 +138,7 @@
@override
Stream<ProcessSignal> watch() {
if (platform.isWindows)
- return new Stream<ProcessSignal>.empty();
+ return const Stream<ProcessSignal>.empty();
return super.watch();
}
}
diff --git a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
index 711eba0..3984567 100644
--- a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+++ b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
@@ -19,7 +19,7 @@
Stream<String> _logLines;
@override
Stream<String> get logLines {
- _logLines ??= new Stream<String>.empty();
+ _logLines ??= const Stream<String>.empty();
return _logLines;
}