Eliminate use of Dart new keyword in doc comments (flutter/engine#32823)

We made the Dart 'new' keyword optional years ago, but appears we missed
removing it in a few doc comments.
This commit is contained in:
Chris Bracken
2022-04-20 17:08:08 -07:00
committed by GitHub
parent a970f9766a
commit 191c992268
3 changed files with 13 additions and 13 deletions

View File

@@ -4265,10 +4265,10 @@ class Canvas extends NativeFieldWrapperClass1 {
/// void paint(Canvas canvas, Size size) {
/// Rect rect = Offset.zero & size;
/// canvas.save();
/// canvas.clipRRect(new RRect.fromRectXY(rect, 100.0, 100.0));
/// canvas.clipRRect(RRect.fromRectXY(rect, 100.0, 100.0));
/// canvas.saveLayer(rect, Paint());
/// canvas.drawPaint(new Paint()..color = Colors.red);
/// canvas.drawPaint(new Paint()..color = Colors.white);
/// canvas.drawPaint(Paint()..color = Colors.red);
/// canvas.drawPaint(Paint()..color = Colors.white);
/// canvas.restore();
/// canvas.restore();
/// }
@@ -4284,9 +4284,9 @@ class Canvas extends NativeFieldWrapperClass1 {
/// // (this example renders poorly, prefer the example above)
/// Rect rect = Offset.zero & size;
/// canvas.save();
/// canvas.clipRRect(new RRect.fromRectXY(rect, 100.0, 100.0));
/// canvas.drawPaint(new Paint()..color = Colors.red);
/// canvas.drawPaint(new Paint()..color = Colors.white);
/// canvas.clipRRect(RRect.fromRectXY(rect, 100.0, 100.0));
/// canvas.drawPaint(Paint()..color = Colors.red);
/// canvas.drawPaint(Paint()..color = Colors.white);
/// canvas.restore();
/// }
/// ```
@@ -4298,12 +4298,12 @@ class Canvas extends NativeFieldWrapperClass1 {
/// ```dart
/// void paint(Canvas canvas, Size size) {
/// canvas.save();
/// canvas.clipRRect(new RRect.fromRectXY(Offset.zero & (size / 2.0), 50.0, 50.0));
/// canvas.drawPaint(new Paint()..color = Colors.white);
/// canvas.clipRRect(RRect.fromRectXY(Offset.zero & (size / 2.0), 50.0, 50.0));
/// canvas.drawPaint(Paint()..color = Colors.white);
/// canvas.restore();
/// canvas.save();
/// canvas.clipRRect(new RRect.fromRectXY(size.center(Offset.zero) & (size / 2.0), 50.0, 50.0));
/// canvas.drawPaint(new Paint()..color = Colors.white);
/// canvas.clipRRect(RRect.fromRectXY(size.center(Offset.zero) & (size / 2.0), 50.0, 50.0));
/// canvas.drawPaint(Paint()..color = Colors.white);
/// canvas.restore();
/// }
/// ```
@@ -5686,7 +5686,7 @@ typedef _Callbacker<T> = String? Function(_Callback<T?> callback);
/// typedef IntCallback = void Function(int result);
///
/// String _doSomethingAndCallback(IntCallback callback) {
/// Timer(new Duration(seconds: 1), () { callback(1); });
/// Timer(Duration(seconds: 1), () { callback(1); });
/// }
///
/// Future<int> doSomething() {

View File

@@ -364,7 +364,7 @@ class EngineTextStyle implements ui.TextStyle {
}) : assert(
color == null || foreground == null,
'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".'),
isFontFamilyProvided = fontFamily != null,
fontFamily = fontFamily ?? '';

View File

@@ -38,7 +38,7 @@ typedef Callbacker<T> = String? Function(Callback<T> callback);
/// typedef IntCallback = void Function(int result);
///
/// String _doSomethingAndCallback(IntCallback callback) {
/// new Timer(new Duration(seconds: 1), () { callback(1); });
/// Timer(const Duration(seconds: 1), () { callback(1); });
/// }
///
/// Future<int> doSomething() {