Skip to content

Commit 64db621

Browse files
Remove new keyword in a few files (#104438)
1 parent a939d9d commit 64db621

File tree

16 files changed

+47
-47
lines changed

16 files changed

+47
-47
lines changed

dev/benchmarks/microbenchmarks/lib/common.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ double _doProbability({required double mean, required double stddev, required do
5454
5555
/// Example:
5656
///
57-
/// BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
57+
/// BenchmarkResultPrinter printer = BenchmarkResultPrinter();
5858
/// printer.add(
5959
/// description: 'Average frame time',
6060
/// value: averageFrameTime,

packages/flutter/lib/src/painting/text_style.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import 'text_painter.dart';
1414
const String _kDefaultDebugLabel = 'unknown';
1515

1616
const String _kColorForegroundWarning = 'Cannot provide both a color and a foreground\n'
17-
'The color argument is just a shorthand for "foreground: new Paint()..color = color".';
17+
'The color argument is just a shorthand for "foreground: Paint()..color = color".';
1818

1919
const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor and a background\n'
20-
'The backgroundColor argument is just a shorthand for "background: new Paint()..color = color".';
20+
'The backgroundColor argument is just a shorthand for "background: Paint()..color = color".';
2121

2222
// The default font size if none is specified. This should be kept in
2323
// sync with the default values in text_painter.dart, as well as the

packages/flutter/lib/src/widgets/platform_view.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ class AndroidView extends StatefulWidget {
144144
/// child: AndroidView(
145145
/// viewType: 'webview',
146146
/// gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
147-
/// new Factory<OneSequenceGestureRecognizer>(
148-
/// () => new EagerGestureRecognizer(),
147+
/// Factory<OneSequenceGestureRecognizer>(
148+
/// () => EagerGestureRecognizer(),
149149
/// ),
150150
/// ].toSet(),
151151
/// ),
@@ -284,8 +284,8 @@ class UiKitView extends StatefulWidget {
284284
/// child: UiKitView(
285285
/// viewType: 'webview',
286286
/// gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
287-
/// new Factory<OneSequenceGestureRecognizer>(
288-
/// () => new EagerGestureRecognizer(),
287+
/// Factory<OneSequenceGestureRecognizer>(
288+
/// () => EagerGestureRecognizer(),
289289
/// ),
290290
/// ].toSet(),
291291
/// ),
@@ -994,8 +994,8 @@ class PlatformViewSurface extends LeafRenderObjectWidget {
994994
/// height: 100.0,
995995
/// child: PlatformViewSurface(
996996
/// gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
997-
/// new Factory<OneSequenceGestureRecognizer>(
998-
/// () => new EagerGestureRecognizer(),
997+
/// Factory<OneSequenceGestureRecognizer>(
998+
/// () => EagerGestureRecognizer(),
999999
/// ),
10001000
/// ].toSet(),
10011001
/// ),

packages/flutter/lib/src/widgets/preferred_size.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ abstract class PreferredSizeWidget implements Widget {
3232
/// In many cases it's only necessary to define one preferred dimension.
3333
/// For example the [Scaffold] only depends on its app bar's preferred
3434
/// height. In that case implementations of this method can just return
35-
/// `new Size.fromHeight(myAppBarHeight)`.
35+
/// `Size.fromHeight(myAppBarHeight)`.
3636
Size get preferredSize;
3737
}
3838

packages/flutter/lib/src/widgets/sliver.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ typedef ChildIndexGetter = int? Function(Key key);
295295
/// {@end-tool}
296296
///
297297
/// In certain cases, only a subset of child widgets should be annotated
298-
/// with a semantic index. For example, in [new ListView.separated()] the
298+
/// with a semantic index. For example, in [ListView.separated()] the
299299
/// separators do not have an index associated with them. This is done by
300300
/// providing a `semanticIndexCallback` which returns null for separators
301301
/// indexes and rounds the non-separator indexes down by half.
@@ -541,7 +541,7 @@ class SliverChildBuilderDelegate extends SliverChildDelegate {
541541
/// second delegate should offset its children by 10.
542542
///
543543
/// In certain cases, only a subset of child widgets should be annotated
544-
/// with a semantic index. For example, in [new ListView.separated()] the
544+
/// with a semantic index. For example, in [ListView.separated()] the
545545
/// separators do not have an index associated with them. This is done by
546546
/// providing a `semanticIndexCallback` which returns null for separators
547547
/// indexes and rounds the non-separator indexes down by half.

packages/flutter/test/painting/colors_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void main() {
102102
within<HSVColor>(distance: _doubleColorPrecision, from: hsvColor),
103103
);
104104
}
105-
// output.add(new HSVColor.fromAHSV(1.0, 0.0, 1.0, value).toColor());
105+
// output.add(HSVColor.fromAHSV(1.0, 0.0, 1.0, value).toColor());
106106
}
107107
final List<Color> expectedColors = <Color>[
108108
const Color(0xff000000),

packages/flutter_driver/lib/driver_extension.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
///
2121
/// main() {
2222
/// enableFlutterDriverExtension();
23-
/// runApp(new ExampleApp());
23+
/// runApp(ExampleApp());
2424
/// }
2525
library flutter_driver_extension;
2626

packages/flutter_driver/lib/src/common/enum_util.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/// Example:
1313
///
1414
/// enum Vote { yea, nay }
15-
/// final index = new EnumIndex(Vote.values);
15+
/// final index = EnumIndex(Vote.values);
1616
/// index.lookupBySimpleName('yea'); // returns Vote.yea
1717
/// index.toSimpleName(Vote.nay); // returns 'nay'
1818
class EnumIndex<E> {

packages/flutter_localizations/lib/src/cupertino_localizations.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import 'widgets_localizations.dart';
3232
/// app supports with [CupertinoApp.supportedLocales]:
3333
///
3434
/// ```dart
35-
/// new CupertinoApp(
35+
/// CupertinoApp(
3636
/// localizationsDelegates: GlobalCupertinoLocalizations.delegates,
3737
/// supportedLocales: [
3838
/// const Locale('en', 'US'), // American English
@@ -438,7 +438,7 @@ abstract class GlobalCupertinoLocalizations implements CupertinoLocalizations {
438438
/// app supports with [CupertinoApp.supportedLocales]:
439439
///
440440
/// ```dart
441-
/// new CupertinoApp(
441+
/// CupertinoApp(
442442
/// localizationsDelegates: GlobalCupertinoLocalizations.delegates,
443443
/// supportedLocales: [
444444
/// const Locale('en', 'US'), // English

packages/flutter_localizations/lib/src/material_localizations.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import 'widgets_localizations.dart';
3030
/// app supports with [MaterialApp.supportedLocales]:
3131
///
3232
/// ```dart
33-
/// new MaterialApp(
33+
/// MaterialApp(
3434
/// localizationsDelegates: GlobalMaterialLocalizations.delegates,
3535
/// supportedLocales: [
3636
/// const Locale('en', 'US'), // American English
@@ -682,7 +682,7 @@ abstract class GlobalMaterialLocalizations implements MaterialLocalizations {
682682
/// app supports with [MaterialApp.supportedLocales]:
683683
///
684684
/// ```dart
685-
/// new MaterialApp(
685+
/// MaterialApp(
686686
/// localizationsDelegates: GlobalMaterialLocalizations.delegates,
687687
/// supportedLocales: [
688688
/// const Locale('en', 'US'), // English

0 commit comments

Comments
 (0)