diff --git a/dev/devicelab/bin/tasks/named_isolates_test.dart b/dev/devicelab/bin/tasks/named_isolates_test.dart index 0373f7db37..c0ca4c1774 100644 --- a/dev/devicelab/bin/tasks/named_isolates_test.dart +++ b/dev/devicelab/bin/tasks/named_isolates_test.dart @@ -32,7 +32,7 @@ void main() { section('Verify all the debug isolate names are set'); runProcess.stdin.write('l'); await Future.wait(>[firstNameFound.future, secondNameFound.future]) - .timeout(Duration(seconds: 1), onTimeout: () => throw 'Isolate names not found.'); + .timeout(const Duration(seconds: 1), onTimeout: () => throw 'Isolate names not found.'); await _quitRunner(runProcess); section('Attach to the second debug isolate'); diff --git a/examples/flutter_gallery/lib/demo/cupertino/cupertino_picker_demo.dart b/examples/flutter_gallery/lib/demo/cupertino/cupertino_picker_demo.dart index 3309061609..c37a365999 100644 --- a/examples/flutter_gallery/lib/demo/cupertino/cupertino_picker_demo.dart +++ b/examples/flutter_gallery/lib/demo/cupertino/cupertino_picker_demo.dart @@ -21,7 +21,7 @@ class CupertinoPickerDemo extends StatefulWidget { class _CupertinoPickerDemoState extends State { int _selectedColorIndex = 0; - Duration timer = Duration(); + Duration timer = const Duration(); // Value that is shown in the date picker in date mode. DateTime date = DateTime.now(); @@ -276,4 +276,4 @@ class _CupertinoPickerDemoState extends State { ), ); } -} \ No newline at end of file +} diff --git a/packages/flutter/test/widgets/gesture_detector_test.dart b/packages/flutter/test/widgets/gesture_detector_test.dart index 2b4f46933a..1107aab1f6 100644 --- a/packages/flutter/test/widgets/gesture_detector_test.dart +++ b/packages/flutter/test/widgets/gesture_detector_test.dart @@ -340,7 +340,7 @@ void main() { await gesture.up(); } - await longPress(kLongPressTimeout + Duration(seconds: 1)); // To make sure the time for long press has occured + await longPress(kLongPressTimeout + const Duration(seconds: 1)); // To make sure the time for long press has occurred expect(longPressUp, 1); }); } diff --git a/packages/flutter_tools/test/devfs_test.dart b/packages/flutter_tools/test/devfs_test.dart index 8aebeb03a6..e1502ec324 100644 --- a/packages/flutter_tools/test/devfs_test.dart +++ b/packages/flutter_tools/test/devfs_test.dart @@ -71,7 +71,7 @@ void main() { file.parent.createSync(recursive: true); file.writeAsBytesSync([1, 2, 3]); - final DateTime fiveSecondsAgo = DateTime.now().subtract(Duration(seconds:5)); + final DateTime fiveSecondsAgo = DateTime.now().subtract(const Duration(seconds:5)); expect(content.isModifiedAfter(fiveSecondsAgo), isTrue); expect(content.isModifiedAfter(fiveSecondsAgo), isTrue); expect(content.isModifiedAfter(null), isTrue);