Skip to content

Commit b12caba

Browse files
authored
Use const constructors where possible (flutter#486)
1 parent b76b0e7 commit b12caba

File tree

12 files changed

+20
-19
lines changed

12 files changed

+20
-19
lines changed

packages/cloud_firestore/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class MyHomePage extends StatelessWidget {
7373
floatingActionButton: new FloatingActionButton(
7474
onPressed: _addMessage,
7575
tooltip: 'Increment',
76-
child: new Icon(Icons.add),
76+
child: const Icon(Icons.add),
7777
),
7878
);
7979
}

packages/cloud_firestore/test/cloud_firestore_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void main() {
134134
test('runTransaction', () async {
135135
final Map<String, dynamic> result = await firestore.runTransaction(
136136
(Transaction tx) async {},
137-
timeout: new Duration(seconds: 3));
137+
timeout: const Duration(seconds: 3));
138138

139139
expect(log, <Matcher>[
140140
isMethodCall('Firestore#runTransaction', arguments: <String, dynamic>{

packages/firebase_analytics/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class _MyHomePageState extends State<MyHomePage> {
316316
],
317317
),
318318
floatingActionButton: new FloatingActionButton(
319-
child: new Icon(Icons.tab),
319+
child: const Icon(Icons.tab),
320320
onPressed: () {
321321
Navigator.of(context).push(new MaterialPageRoute<TabsPage>(
322322
settings: const RouteSettings(name: TabsPage.routeName),

packages/firebase_database/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class _MyHomePageState extends State<MyHomePage> {
171171
floatingActionButton: new FloatingActionButton(
172172
onPressed: _increment,
173173
tooltip: 'Increment',
174-
child: new Icon(Icons.add),
174+
child: const Icon(Icons.add),
175175
),
176176
);
177177
}

packages/firebase_messaging/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class _PushMessagingExampleState extends State<PushMessagingExample> {
179179
"status": "out of stock",
180180
}),
181181
tooltip: 'Simulate Message',
182-
child: new Icon(Icons.message),
182+
child: const Icon(Icons.message),
183183
),
184184
body: new Material(
185185
child: new Column(

packages/firebase_storage/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class _MyHomePageState extends State<MyHomePage> {
7373
floatingActionButton: new FloatingActionButton(
7474
onPressed: _uploadFile,
7575
tooltip: 'Upload',
76-
child: new Icon(Icons.file_upload),
76+
child: const Icon(Icons.file_upload),
7777
),
7878
);
7979
}

packages/google_mobile_maps/example/lib/animate_camera.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import 'package:google_mobile_maps/google_mobile_maps.dart';
88
import 'page.dart';
99

1010
class AnimateCameraPage extends Page {
11-
AnimateCameraPage() : super(new Icon(Icons.map), "Camera control", "Animate");
11+
AnimateCameraPage()
12+
: super(const Icon(Icons.map), "Camera control", "Animate");
1213

1314
final GoogleMapsOverlayController controller =
1415
new GoogleMapsOverlayController.fromSize(300.0, 200.0);

packages/google_mobile_maps/example/lib/move_camera.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:google_mobile_maps/google_mobile_maps.dart';
88
import 'page.dart';
99

1010
class MoveCameraPage extends Page {
11-
MoveCameraPage() : super(new Icon(Icons.map), "Camera control", "Move");
11+
MoveCameraPage() : super(const Icon(Icons.map), "Camera control", "Move");
1212

1313
final GoogleMapsOverlayController controller =
1414
new GoogleMapsOverlayController.fromSize(300.0, 200.0);

packages/google_mobile_maps/example/lib/place_marker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'package:google_mobile_maps/google_mobile_maps.dart';
1010
import 'page.dart';
1111

1212
class PlaceMarkerPage extends Page {
13-
PlaceMarkerPage() : super(new Icon(Icons.place), "Place marker", "Single");
13+
PlaceMarkerPage() : super(const Icon(Icons.place), "Place marker", "Single");
1414

1515
final GoogleMapsOverlayController controller =
1616
new GoogleMapsOverlayController.fromSize(300.0, 200.0)

packages/image_picker/example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ class _MyHomePageState extends State<MyHomePage> {
6767
new FloatingActionButton(
6868
onPressed: () => _onImageButtonPressed(ImageSource.gallery),
6969
tooltip: 'Pick Image from gallery',
70-
child: new Icon(Icons.photo_library),
70+
child: const Icon(Icons.photo_library),
7171
),
7272
new Padding(
7373
padding: const EdgeInsets.only(top: 16.0),
7474
child: new FloatingActionButton(
7575
onPressed: () => _onImageButtonPressed(ImageSource.camera),
7676
tooltip: 'Take a Photo',
77-
child: new Icon(Icons.camera_alt),
77+
child: const Icon(Icons.camera_alt),
7878
),
7979
),
8080
],

0 commit comments

Comments
 (0)