diff --git a/dev/benchmarks/microbenchmarks/lib/common.dart b/dev/benchmarks/microbenchmarks/lib/common.dart index a26e123436a5..fb6aef0eec3a 100644 --- a/dev/benchmarks/microbenchmarks/lib/common.dart +++ b/dev/benchmarks/microbenchmarks/lib/common.dart @@ -54,7 +54,7 @@ double _doProbability({required double mean, required double stddev, required do /// Example: /// -/// BenchmarkResultPrinter printer = new BenchmarkResultPrinter(); +/// BenchmarkResultPrinter printer = BenchmarkResultPrinter(); /// printer.add( /// description: 'Average frame time', /// value: averageFrameTime, diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index c8ce94d321c5..9a7468ff86d1 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -14,10 +14,10 @@ import 'text_painter.dart'; const String _kDefaultDebugLabel = 'unknown'; const String _kColorForegroundWarning = 'Cannot provide both a color and a foreground\n' - 'The color argument is just a shorthand for "foreground: new Paint()..color = color".'; + 'The color argument is just a shorthand for "foreground: Paint()..color = color".'; const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor and a background\n' - 'The backgroundColor argument is just a shorthand for "background: new Paint()..color = color".'; + 'The backgroundColor argument is just a shorthand for "background: Paint()..color = color".'; // The default font size if none is specified. This should be kept in // sync with the default values in text_painter.dart, as well as the diff --git a/packages/flutter/lib/src/widgets/platform_view.dart b/packages/flutter/lib/src/widgets/platform_view.dart index 7f8d8c852693..ee74078db10c 100644 --- a/packages/flutter/lib/src/widgets/platform_view.dart +++ b/packages/flutter/lib/src/widgets/platform_view.dart @@ -144,8 +144,8 @@ class AndroidView extends StatefulWidget { /// child: AndroidView( /// viewType: 'webview', /// gestureRecognizers: >[ - /// new Factory( - /// () => new EagerGestureRecognizer(), + /// Factory( + /// () => EagerGestureRecognizer(), /// ), /// ].toSet(), /// ), @@ -284,8 +284,8 @@ class UiKitView extends StatefulWidget { /// child: UiKitView( /// viewType: 'webview', /// gestureRecognizers: >[ - /// new Factory( - /// () => new EagerGestureRecognizer(), + /// Factory( + /// () => EagerGestureRecognizer(), /// ), /// ].toSet(), /// ), @@ -994,8 +994,8 @@ class PlatformViewSurface extends LeafRenderObjectWidget { /// height: 100.0, /// child: PlatformViewSurface( /// gestureRecognizers: >[ - /// new Factory( - /// () => new EagerGestureRecognizer(), + /// Factory( + /// () => EagerGestureRecognizer(), /// ), /// ].toSet(), /// ), diff --git a/packages/flutter/lib/src/widgets/preferred_size.dart b/packages/flutter/lib/src/widgets/preferred_size.dart index cee815c104a0..6714339411a3 100644 --- a/packages/flutter/lib/src/widgets/preferred_size.dart +++ b/packages/flutter/lib/src/widgets/preferred_size.dart @@ -32,7 +32,7 @@ abstract class PreferredSizeWidget implements Widget { /// In many cases it's only necessary to define one preferred dimension. /// For example the [Scaffold] only depends on its app bar's preferred /// height. In that case implementations of this method can just return - /// `new Size.fromHeight(myAppBarHeight)`. + /// `Size.fromHeight(myAppBarHeight)`. Size get preferredSize; } diff --git a/packages/flutter/lib/src/widgets/sliver.dart b/packages/flutter/lib/src/widgets/sliver.dart index f5de802d7ac6..2d4579aee633 100644 --- a/packages/flutter/lib/src/widgets/sliver.dart +++ b/packages/flutter/lib/src/widgets/sliver.dart @@ -295,7 +295,7 @@ typedef ChildIndexGetter = int? Function(Key key); /// {@end-tool} /// /// In certain cases, only a subset of child widgets should be annotated -/// with a semantic index. For example, in [new ListView.separated()] the +/// with a semantic index. For example, in [ListView.separated()] the /// separators do not have an index associated with them. This is done by /// providing a `semanticIndexCallback` which returns null for separators /// indexes and rounds the non-separator indexes down by half. @@ -541,7 +541,7 @@ class SliverChildBuilderDelegate extends SliverChildDelegate { /// second delegate should offset its children by 10. /// /// In certain cases, only a subset of child widgets should be annotated -/// with a semantic index. For example, in [new ListView.separated()] the +/// with a semantic index. For example, in [ListView.separated()] the /// separators do not have an index associated with them. This is done by /// providing a `semanticIndexCallback` which returns null for separators /// indexes and rounds the non-separator indexes down by half. diff --git a/packages/flutter/test/painting/colors_test.dart b/packages/flutter/test/painting/colors_test.dart index 8ea450d61e53..72c10fde8956 100644 --- a/packages/flutter/test/painting/colors_test.dart +++ b/packages/flutter/test/painting/colors_test.dart @@ -102,7 +102,7 @@ void main() { within(distance: _doubleColorPrecision, from: hsvColor), ); } - // output.add(new HSVColor.fromAHSV(1.0, 0.0, 1.0, value).toColor()); + // output.add(HSVColor.fromAHSV(1.0, 0.0, 1.0, value).toColor()); } final List expectedColors = [ const Color(0xff000000), diff --git a/packages/flutter_driver/lib/driver_extension.dart b/packages/flutter_driver/lib/driver_extension.dart index fce9ad8bec44..b83126db9efb 100644 --- a/packages/flutter_driver/lib/driver_extension.dart +++ b/packages/flutter_driver/lib/driver_extension.dart @@ -20,7 +20,7 @@ /// /// main() { /// enableFlutterDriverExtension(); -/// runApp(new ExampleApp()); +/// runApp(ExampleApp()); /// } library flutter_driver_extension; diff --git a/packages/flutter_driver/lib/src/common/enum_util.dart b/packages/flutter_driver/lib/src/common/enum_util.dart index 0f54221b1a76..d8aa00a8b548 100644 --- a/packages/flutter_driver/lib/src/common/enum_util.dart +++ b/packages/flutter_driver/lib/src/common/enum_util.dart @@ -12,7 +12,7 @@ /// Example: /// /// enum Vote { yea, nay } -/// final index = new EnumIndex(Vote.values); +/// final index = EnumIndex(Vote.values); /// index.lookupBySimpleName('yea'); // returns Vote.yea /// index.toSimpleName(Vote.nay); // returns 'nay' class EnumIndex { diff --git a/packages/flutter_localizations/lib/src/cupertino_localizations.dart b/packages/flutter_localizations/lib/src/cupertino_localizations.dart index d171ecd196d5..a07ddb9998f9 100644 --- a/packages/flutter_localizations/lib/src/cupertino_localizations.dart +++ b/packages/flutter_localizations/lib/src/cupertino_localizations.dart @@ -32,7 +32,7 @@ import 'widgets_localizations.dart'; /// app supports with [CupertinoApp.supportedLocales]: /// /// ```dart -/// new CupertinoApp( +/// CupertinoApp( /// localizationsDelegates: GlobalCupertinoLocalizations.delegates, /// supportedLocales: [ /// const Locale('en', 'US'), // American English @@ -438,7 +438,7 @@ abstract class GlobalCupertinoLocalizations implements CupertinoLocalizations { /// app supports with [CupertinoApp.supportedLocales]: /// /// ```dart - /// new CupertinoApp( + /// CupertinoApp( /// localizationsDelegates: GlobalCupertinoLocalizations.delegates, /// supportedLocales: [ /// const Locale('en', 'US'), // English diff --git a/packages/flutter_localizations/lib/src/material_localizations.dart b/packages/flutter_localizations/lib/src/material_localizations.dart index d19d0d0664f6..737dec45a1ed 100644 --- a/packages/flutter_localizations/lib/src/material_localizations.dart +++ b/packages/flutter_localizations/lib/src/material_localizations.dart @@ -30,7 +30,7 @@ import 'widgets_localizations.dart'; /// app supports with [MaterialApp.supportedLocales]: /// /// ```dart -/// new MaterialApp( +/// MaterialApp( /// localizationsDelegates: GlobalMaterialLocalizations.delegates, /// supportedLocales: [ /// const Locale('en', 'US'), // American English @@ -682,7 +682,7 @@ abstract class GlobalMaterialLocalizations implements MaterialLocalizations { /// app supports with [MaterialApp.supportedLocales]: /// /// ```dart - /// new MaterialApp( + /// MaterialApp( /// localizationsDelegates: GlobalMaterialLocalizations.delegates, /// supportedLocales: [ /// const Locale('en', 'US'), // English diff --git a/packages/flutter_test/lib/src/nonconst.dart b/packages/flutter_test/lib/src/nonconst.dart index 6002ae44f633..c3b9d34660fd 100644 --- a/packages/flutter_test/lib/src/nonconst.dart +++ b/packages/flutter_test/lib/src/nonconst.dart @@ -13,7 +13,7 @@ /// /// main () { /// // prevent prefer_const_constructors lint -/// new A(nonconst(null)); +/// A(nonconst(null)); /// /// // prevent prefer_const_declarations lint /// final int $null = nonconst(null); diff --git a/packages/flutter_tools/test/integration.shard/test_data/basic_project.dart b/packages/flutter_tools/test/integration.shard/test_data/basic_project.dart index 7f740435203b..12a77fed9c86 100644 --- a/packages/flutter_tools/test/integration.shard/test_data/basic_project.dart +++ b/packages/flutter_tools/test/integration.shard/test_data/basic_project.dart @@ -25,7 +25,7 @@ class BasicProject extends Project { Future main() async { while (true) { - runApp(new MyApp()); + runApp(MyApp()); await Future.delayed(const Duration(milliseconds: 50)); } } @@ -34,9 +34,9 @@ class BasicProject extends Project { @override Widget build(BuildContext context) { topLevelFunction(); - return new MaterialApp( // BUILD BREAKPOINT + return MaterialApp( // BUILD BREAKPOINT title: 'Flutter Demo', - home: new Container(), + home: Container(), ); } } @@ -136,7 +136,7 @@ class BasicProjectWithTimelineTraces extends Project { Future main() async { while (true) { - runApp(new MyApp()); + runApp(MyApp()); await Future.delayed(const Duration(milliseconds: 50)); Timeline.instantSync('main'); } @@ -146,9 +146,9 @@ class BasicProjectWithTimelineTraces extends Project { @override Widget build(BuildContext context) { topLevelFunction(); - return new MaterialApp( // BUILD BREAKPOINT + return MaterialApp( // BUILD BREAKPOINT title: 'Flutter Demo', - home: new Container(), + home: Container(), ); } } @@ -208,7 +208,7 @@ class BasicProjectWithUnaryMain extends Project { import 'package:flutter/material.dart'; Future main(List args) async { while (true) { - runApp(new MyApp()); + runApp(MyApp()); await Future.delayed(const Duration(milliseconds: 50)); } } @@ -216,9 +216,9 @@ class BasicProjectWithUnaryMain extends Project { @override Widget build(BuildContext context) { topLevelFunction(); - return new MaterialApp( // BUILD BREAKPOINT + return MaterialApp( // BUILD BREAKPOINT title: 'Flutter Demo', - home: new Container(), + home: Container(), ); } } diff --git a/packages/flutter_tools/test/integration.shard/test_data/deferred_components_project.dart b/packages/flutter_tools/test/integration.shard/test_data/deferred_components_project.dart index 27040a411551..b5ea7c6ea3e6 100644 --- a/packages/flutter_tools/test/integration.shard/test_data/deferred_components_project.dart +++ b/packages/flutter_tools/test/integration.shard/test_data/deferred_components_project.dart @@ -45,7 +45,7 @@ class DeferredComponentsProject extends Project { libFuture = DeferredLibrary.loadLibrary(); libFuture?.whenComplete(() => deferredText = 'complete ${DeferredLibrary.add(10, 42)}'); } - runApp(new MyApp()); + runApp(MyApp()); await Future.delayed(const Duration(milliseconds: 50)); } } @@ -54,9 +54,9 @@ class DeferredComponentsProject extends Project { @override Widget build(BuildContext context) { topLevelFunction(); - return new MaterialApp( // BUILD BREAKPOINT + return MaterialApp( // BUILD BREAKPOINT title: 'Flutter Demo', - home: new Container(), + home: Container(), ); } } diff --git a/packages/flutter_tools/test/integration.shard/test_data/multidex_project.dart b/packages/flutter_tools/test/integration.shard/test_data/multidex_project.dart index 96e4ff420817..2b0fc25b2893 100644 --- a/packages/flutter_tools/test/integration.shard/test_data/multidex_project.dart +++ b/packages/flutter_tools/test/integration.shard/test_data/multidex_project.dart @@ -77,9 +77,9 @@ class MultidexProject extends Project { class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { - return new MaterialApp( + return MaterialApp( title: 'Flutter Demo', - home: new Container(), + home: Container(), ); } } diff --git a/packages/flutter_tools/test/integration.shard/test_data/project_with_early_error.dart b/packages/flutter_tools/test/integration.shard/test_data/project_with_early_error.dart index 10dc33e2bf21..7578d6559c70 100644 --- a/packages/flutter_tools/test/integration.shard/test_data/project_with_early_error.dart +++ b/packages/flutter_tools/test/integration.shard/test_data/project_with_early_error.dart @@ -25,7 +25,7 @@ class ProjectWithEarlyError extends Project { Future main() async { while (true) { - runApp(new MyApp()); + runApp(MyApp()); await Future.delayed(const Duration(milliseconds: 50)); } } diff --git a/packages/flutter_tools/test/integration.shard/test_data/stepping_project.dart b/packages/flutter_tools/test/integration.shard/test_data/stepping_project.dart index f9161dc5bdef..d3a2bec2ca02 100644 --- a/packages/flutter_tools/test/integration.shard/test_data/stepping_project.dart +++ b/packages/flutter_tools/test/integration.shard/test_data/stepping_project.dart @@ -21,7 +21,7 @@ class SteppingProject extends Project { import 'package:flutter/material.dart'; - void main() => runApp(new MyApp()); + void main() => runApp(MyApp()); class MyApp extends StatefulWidget { @override @@ -37,17 +37,17 @@ class SteppingProject extends Project { Future doAsyncStuff() async { print("test"); // BREAKPOINT - await new Future.value(true); // STEP 1 // STEP 2 - await new Future.microtask(() => true); // STEP 3 // STEP 4 - await new Future.delayed(const Duration(milliseconds: 1)); // STEP 5 // STEP 6 + await Future.value(true); // STEP 1 // STEP 2 + await Future.microtask(() => true); // STEP 3 // STEP 4 + await Future.delayed(const Duration(milliseconds: 1)); // STEP 5 // STEP 6 print("done!"); // STEP 7 } // STEP 8 @override Widget build(BuildContext context) { - return new MaterialApp( + return MaterialApp( title: 'Flutter Demo', - home: new Container(), + home: Container(), ); } } @@ -77,7 +77,7 @@ class WebSteppingProject extends Project { import 'package:flutter/material.dart'; - void main() => runApp(new MyApp()); + void main() => runApp(MyApp()); class MyApp extends StatefulWidget { @override @@ -93,17 +93,17 @@ class WebSteppingProject extends Project { Future doAsyncStuff() async { print("test"); // BREAKPOINT - await new Future.value(true); // STEP 1 - await new Future.microtask(() => true); // STEP 2 - await new Future.delayed(const Duration(milliseconds: 1)); // STEP 3 + await Future.value(true); // STEP 1 + await Future.microtask(() => true); // STEP 2 + await Future.delayed(const Duration(milliseconds: 1)); // STEP 3 print("done!"); // STEP 4 } // STEP 5 @override Widget build(BuildContext context) { - return new MaterialApp( + return MaterialApp( title: 'Flutter Demo', - home: new Container(), + home: Container(), ); } }