lint unnecessary_new on samples (#21539)
* lint unnecessary_new on samples
* fix tests
diff --git a/dev/bots/analyze-sample-code.dart b/dev/bots/analyze-sample-code.dart
index a3087b7..8662d33 100644
--- a/dev/bots/analyze-sample-code.dart
+++ b/dev/bots/analyze-sample-code.dart
@@ -218,6 +218,7 @@
linter:
rules:
- unnecessary_const
+ - unnecessary_new
''');
print('Found $sampleCodeSections sample code sections.');
final Process process = await Process.start(
@@ -314,18 +315,20 @@
exit(exitCode);
}
+final RegExp _constructorRegExp = new RegExp(r'[A-Z][a-zA-Z0-9<>.]*\(');
+
int _expressionId = 0;
void processBlock(Line line, List<String> block, List<Section> sections) {
if (block.isEmpty)
throw '$line: Empty ```dart block in sample code.';
- if (block.first.startsWith('new ') || block.first.startsWith('const ')) {
+ if (block.first.startsWith('new ') || block.first.startsWith('const ') || block.first.startsWith(_constructorRegExp)) {
_expressionId += 1;
sections.add(new Section(line, 'dynamic expression$_expressionId = ', block.toList(), ';'));
} else if (block.first.startsWith('await ')) {
_expressionId += 1;
sections.add(new Section(line, 'Future<Null> expression$_expressionId() async { ', block.toList(), ' }'));
- } else if (block.first.startsWith('class ')) {
+ } else if (block.first.startsWith('class ') || block.first.startsWith('enum ')) {
sections.add(new Section(line, null, block.toList(), null));
} else {
final List<String> buffer = <String>[];
diff --git a/dev/bots/test/analyze-sample-code_test.dart b/dev/bots/test/analyze-sample-code_test.dart
index 0774eea..8eb1f11 100644
--- a/dev/bots/test/analyze-sample-code_test.dart
+++ b/dev/bots/test/analyze-sample-code_test.dart
@@ -30,8 +30,10 @@
"$directory/main.dart:5:8: Unused import: 'dart:ui'",
"$directory/main.dart:6:8: Unused import: 'package:flutter_test/flutter_test.dart'",
"$directory/main.dart:9:8: Target of URI doesn't exist: 'package:flutter/known_broken_documentation.dart'",
+ 'test/analyze-sample-code-test-input/known_broken_documentation.dart:27:5: Unnecessary new keyword (unnecessary_new)',
"test/analyze-sample-code-test-input/known_broken_documentation.dart:27:9: Undefined class 'Opacity' (undefined_class)",
"test/analyze-sample-code-test-input/known_broken_documentation.dart:29:20: Undefined class 'Text' (undefined_class)",
+ 'test/analyze-sample-code-test-input/known_broken_documentation.dart:39:5: Unnecessary new keyword (unnecessary_new)',
"test/analyze-sample-code-test-input/known_broken_documentation.dart:39:9: Undefined class 'Opacity' (undefined_class)",
"test/analyze-sample-code-test-input/known_broken_documentation.dart:41:20: Undefined class 'Text' (undefined_class)",
'test/analyze-sample-code-test-input/known_broken_documentation.dart:42:5: unexpected comma at end of sample code',
diff --git a/packages/flutter/lib/src/animation/animations.dart b/packages/flutter/lib/src/animation/animations.dart
index 203f9af..78c3c70 100644
--- a/packages/flutter/lib/src/animation/animations.dart
+++ b/packages/flutter/lib/src/animation/animations.dart
@@ -318,11 +318,10 @@
/// linear animation produced by an [AnimationController]:
///
/// ``` dart
-/// final AnimationController controller =
-/// new AnimationController(duration: const Duration(milliseconds: 500));
-/// final CurvedAnimation animation =
-/// new CurvedAnimation(parent: controller, curve: Curves.ease);
+/// final AnimationController controller = AnimationController(duration: const Duration(milliseconds: 500));
+/// final CurvedAnimation animation = CurvedAnimation(parent: controller, curve: Curves.ease);
///```
+///
/// Depending on the given curve, the output of the [CurvedAnimation] could have
/// a wider range than its input. For example, elastic curves such as
/// [Curves.elasticIn] will significantly overshoot or undershoot the default
diff --git a/packages/flutter/lib/src/animation/tween.dart b/packages/flutter/lib/src/animation/tween.dart
index 9b5ae11..02e74af 100644
--- a/packages/flutter/lib/src/animation/tween.dart
+++ b/packages/flutter/lib/src/animation/tween.dart
@@ -97,7 +97,7 @@
/// `_animation`:
///
/// ```dart
-/// Animation<Offset> _animation = new Tween<Offset>(
+/// Animation<Offset> _animation = Tween<Offset>(
/// begin: const Offset(100.0, 50.0),
/// end: const Offset(200.0, 300.0),
/// ).animate(_controller);
diff --git a/packages/flutter/lib/src/animation/tween_sequence.dart b/packages/flutter/lib/src/animation/tween_sequence.dart
index c1f8fd0..ce079b8 100644
--- a/packages/flutter/lib/src/animation/tween_sequence.dart
+++ b/packages/flutter/lib/src/animation/tween_sequence.dart
@@ -16,21 +16,21 @@
/// animation, remain at 10.0 for the next 20%, and then return to
/// 10.0 for the final 40%:
///
-/// ```
-/// final Animation<double> = new TweenSequence(
+/// ```dart
+/// final Animation<double> = TweenSequence(
/// <TweenSequenceItem<double>>[
-/// new TweenSequenceItem<double>(
-/// tween: new Tween<double>(begin: 5.0, end: 10.0)
-/// .chain(new CurveTween(curve: Curves.ease)),
+/// TweenSequenceItem<double>(
+/// tween: Tween<double>(begin: 5.0, end: 10.0)
+/// .chain(CurveTween(curve: Curves.ease)),
/// weight: 40.0,
/// ),
-/// new TweenSequenceItem<double>(
-/// tween: new ConstantTween<double>(10.0),
+/// TweenSequenceItem<double>(
+/// tween: ConstantTween<double>(10.0),
/// weight: 20.0,
/// ),
-/// new TweenSequenceItem<double>(
-/// tween: new Tween<double>(begin: 10.0, end: 5.0)
-/// .chain(new CurveTween(curve: Curves.ease)),
+/// TweenSequenceItem<double>(
+/// tween: Tween<double>(begin: 10.0, end: 5.0)
+/// .chain(CurveTween(curve: Curves.ease)),
/// weight: 40.0,
/// ),
/// ],
@@ -102,9 +102,10 @@
///
/// The value of this item can be "curved" by chaining it to a [CurveTween].
/// For example to create a tween that eases from 0.0 to 10.0:
- /// ```
- /// new Tween<double>(begin: 0.0, end: 10.0)
- /// .chain(new CurveTween(curve: Curves.ease))
+ ///
+ /// ```dart
+ /// Tween<double>(begin: 0.0, end: 10.0)
+ /// .chain(CurveTween(curve: Curves.ease))
/// ```
final Animatable<T> tween;
diff --git a/packages/flutter/lib/src/cupertino/segmented_control.dart b/packages/flutter/lib/src/cupertino/segmented_control.dart
index 551c0b9..7b9a880 100644
--- a/packages/flutter/lib/src/cupertino/segmented_control.dart
+++ b/packages/flutter/lib/src/cupertino/segmented_control.dart
@@ -130,7 +130,7 @@
/// ```dart
/// class SegmentedControlExample extends StatefulWidget {
/// @override
- /// State createState() => new SegmentedControlExampleState();
+ /// State createState() => SegmentedControlExampleState();
/// }
///
/// class SegmentedControlExampleState extends State<SegmentedControlExample> {
@@ -143,8 +143,8 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new Container(
- /// child: new CupertinoSegmentedControl<int>(
+ /// return Container(
+ /// child: CupertinoSegmentedControl<int>(
/// children: children,
/// onValueChanged: (int newValue) {
/// setState(() {
diff --git a/packages/flutter/lib/src/cupertino/slider.dart b/packages/flutter/lib/src/cupertino/slider.dart
index 90fd190..62b54f8 100644
--- a/packages/flutter/lib/src/cupertino/slider.dart
+++ b/packages/flutter/lib/src/cupertino/slider.dart
@@ -83,7 +83,7 @@
/// gets rebuilt; for example:
///
/// ```dart
- /// new CupertinoSlider(
+ /// CupertinoSlider(
/// value: _cupertinoSliderValue.toDouble(),
/// min: 1.0,
/// max: 10.0,
@@ -116,7 +116,7 @@
/// ## Sample code
///
/// ```dart
- /// new CupertinoSlider(
+ /// CupertinoSlider(
/// value: _cupertinoSliderValue.toDouble(),
/// min: 1.0,
/// max: 10.0,
@@ -147,7 +147,7 @@
/// ## Sample code
///
/// ```dart
- /// new CupertinoSlider(
+ /// CupertinoSlider(
/// value: _cupertinoSliderValue.toDouble(),
/// min: 1.0,
/// max: 10.0,
diff --git a/packages/flutter/lib/src/cupertino/switch.dart b/packages/flutter/lib/src/cupertino/switch.dart
index bad32ec..69cc68c 100644
--- a/packages/flutter/lib/src/cupertino/switch.dart
+++ b/packages/flutter/lib/src/cupertino/switch.dart
@@ -29,10 +29,10 @@
/// for accessibility tools.
///
/// ```dart
-/// new MergeSemantics(
-/// child: new ListTile(
-/// title: new Text('Lights'),
-/// trailing: new CupertinoSwitch(
+/// MergeSemantics(
+/// child: ListTile(
+/// title: Text('Lights'),
+/// trailing: CupertinoSwitch(
/// value: _lights,
/// onChanged: (bool value) { setState(() { _lights = value; }); },
/// ),
@@ -70,7 +70,7 @@
/// gets rebuilt; for example:
///
/// ```dart
- /// new CupertinoSwitch(
+ /// CupertinoSwitch(
/// value: _giveVerse,
/// onChanged: (bool newValue) {
/// setState(() {
diff --git a/packages/flutter/lib/src/cupertino/tab_scaffold.dart b/packages/flutter/lib/src/cupertino/tab_scaffold.dart
index 793d091..7f80de0 100644
--- a/packages/flutter/lib/src/cupertino/tab_scaffold.dart
+++ b/packages/flutter/lib/src/cupertino/tab_scaffold.dart
@@ -27,32 +27,32 @@
/// A sample code implementing a typical iOS information architecture with tabs.
///
/// ```dart
-/// new CupertinoTabScaffold(
-/// tabBar: new CupertinoTabBar(
+/// CupertinoTabScaffold(
+/// tabBar: CupertinoTabBar(
/// items: <BottomNavigationBarItem> [
/// // ...
/// ],
/// ),
/// tabBuilder: (BuildContext context, int index) {
-/// return new CupertinoTabView(
+/// return CupertinoTabView(
/// builder: (BuildContext context) {
-/// return new CupertinoPageScaffold(
-/// navigationBar: new CupertinoNavigationBar(
-/// middle: new Text('Page 1 of tab $index'),
+/// return CupertinoPageScaffold(
+/// navigationBar: CupertinoNavigationBar(
+/// middle: Text('Page 1 of tab $index'),
/// ),
-/// child: new Center(
-/// child: new CupertinoButton(
+/// child: Center(
+/// child: CupertinoButton(
/// child: const Text('Next page'),
/// onPressed: () {
/// Navigator.of(context).push(
-/// new CupertinoPageRoute<Null>(
+/// CupertinoPageRoute<Null>(
/// builder: (BuildContext context) {
-/// return new CupertinoPageScaffold(
-/// navigationBar: new CupertinoNavigationBar(
-/// middle: new Text('Page 2 of tab $index'),
+/// return CupertinoPageScaffold(
+/// navigationBar: CupertinoNavigationBar(
+/// middle: Text('Page 2 of tab $index'),
/// ),
-/// child: new Center(
-/// child: new CupertinoButton(
+/// child: Center(
+/// child: CupertinoButton(
/// child: const Text('Back'),
/// onPressed: () { Navigator.of(context).pop(); },
/// ),
diff --git a/packages/flutter/lib/src/foundation/basic_types.dart b/packages/flutter/lib/src/foundation/basic_types.dart
index 990586d..7c8b162 100644
--- a/packages/flutter/lib/src/foundation/basic_types.dart
+++ b/packages/flutter/lib/src/foundation/basic_types.dart
@@ -183,7 +183,7 @@
/// yield index;
/// }
///
- /// Iterable<int> i = new CachingIterable<int>(range(1, 5).iterator);
+ /// Iterable<int> i = CachingIterable<int>(range(1, 5).iterator);
/// print(i.length); // walks the list
/// print(i.length); // efficient
/// ```
diff --git a/packages/flutter/lib/src/foundation/diagnostics.dart b/packages/flutter/lib/src/foundation/diagnostics.dart
index 2123c7f..d599833 100644
--- a/packages/flutter/lib/src/foundation/diagnostics.dart
+++ b/packages/flutter/lib/src/foundation/diagnostics.dart
@@ -1015,17 +1015,17 @@
/// of an actual property of the object:
///
/// ```dart
-/// new MessageProperty('table size', '$columns\u00D7$rows')
+/// MessageProperty('table size', '$columns\u00D7$rows')
/// ```
/// ```dart
-/// new MessageProperty('usefulness ratio', 'no metrics collected yet (never painted)')
+/// MessageProperty('usefulness ratio', 'no metrics collected yet (never painted)')
/// ```
///
/// On the other hand, [StringProperty] is better suited when the property has a
/// concrete value that is a string:
///
/// ```dart
-/// new StringProperty('name', _name)
+/// StringProperty('name', _name)
/// ```
///
/// See also:
@@ -1322,7 +1322,7 @@
/// ## Sample code
///
/// ```dart
-/// new FlagProperty(
+/// FlagProperty(
/// 'visible',
/// value: true,
/// ifFalse: 'hidden',
@@ -1334,7 +1334,7 @@
/// property value.
///
/// ```dart
-/// new FlagProperty(
+/// FlagProperty(
/// 'inherit',
/// value: inherit,
/// ifTrue: '<all styles inherited>',
@@ -2162,12 +2162,12 @@
/// * Specify `showName` and `showSeparator` in rare cases where the string
/// output would look clumsy if they were not set.
/// ```dart
- /// new DiagnosticsProperty<Object>('child(3, 4)', null, ifNull: 'is null', showSeparator: false).toString()
+ /// DiagnosticsProperty<Object>('child(3, 4)', null, ifNull: 'is null', showSeparator: false).toString()
/// ```
/// Shows using `showSeparator` to get output `child(3, 4) is null` which
/// is more polished than `child(3, 4): is null`.
/// ```dart
- /// new DiagnosticsProperty<IconData>('icon', icon, ifNull: '<empty>', showName: false)).toString()
+ /// DiagnosticsProperty<IconData>('icon', icon, ifNull: '<empty>', showName: false)).toString()
/// ```
/// Shows using `showName` to omit the property name as in this context the
/// property name does not add useful information.
@@ -2227,25 +2227,25 @@
///
/// // Omit the property name 'message' when displaying this String property
/// // as it would just add visual noise.
- /// properties.add(new StringProperty('message', message, showName: false));
+ /// properties.add(StringProperty('message', message, showName: false));
///
- /// properties.add(new DoubleProperty('stepWidth', stepWidth));
+ /// properties.add(DoubleProperty('stepWidth', stepWidth));
///
/// // A scale of 1.0 does nothing so should be hidden.
- /// properties.add(new DoubleProperty('scale', scale, defaultValue: 1.0));
+ /// properties.add(DoubleProperty('scale', scale, defaultValue: 1.0));
///
/// // If the hitTestExtent matches the paintExtent, it is just set to its
/// // default value so is not relevant.
- /// properties.add(new DoubleProperty('hitTestExtent', hitTestExtent, defaultValue: paintExtent));
+ /// properties.add(DoubleProperty('hitTestExtent', hitTestExtent, defaultValue: paintExtent));
///
/// // maxWidth of double.infinity indicates the width is unconstrained and
/// // so maxWidth has no impact.,
- /// properties.add(new DoubleProperty('maxWidth', maxWidth, defaultValue: double.infinity));
+ /// properties.add(DoubleProperty('maxWidth', maxWidth, defaultValue: double.infinity));
///
/// // Progress is a value between 0 and 1 or null. Showing it as a
/// // percentage makes the meaning clear enough that the name can be
/// // hidden.
- /// properties.add(new PercentProperty(
+ /// properties.add(PercentProperty(
/// 'progress',
/// progress,
/// showName: false,
@@ -2253,16 +2253,16 @@
/// ));
///
/// // Most text fields have maxLines set to 1.
- /// properties.add(new IntProperty('maxLines', maxLines, defaultValue: 1));
+ /// properties.add(IntProperty('maxLines', maxLines, defaultValue: 1));
///
/// // Specify the unit as otherwise it would be unclear that time is in
/// // milliseconds.
- /// properties.add(new IntProperty('duration', duration.inMilliseconds, unit: 'ms'));
+ /// properties.add(IntProperty('duration', duration.inMilliseconds, unit: 'ms'));
///
/// // Tooltip is used instead of unit for this case as a unit should be a
/// // terse description appropriate to display directly after a number
/// // without a space.
- /// properties.add(new DoubleProperty(
+ /// properties.add(DoubleProperty(
/// 'device pixel ratio',
/// ui.window.devicePixelRatio,
/// tooltip: 'physical pixels per logical pixel',
@@ -2270,12 +2270,12 @@
///
/// // Displaying the depth value would be distracting. Instead only display
/// // if the depth value is missing.
- /// properties.add(new ObjectFlagProperty<int>('depth', depth, ifNull: 'no depth'));
+ /// properties.add(ObjectFlagProperty<int>('depth', depth, ifNull: 'no depth'));
///
/// // bool flag that is only shown when the value is true.
- /// properties.add(new FlagProperty('using primary controller', value: primary));
+ /// properties.add(FlagProperty('using primary controller', value: primary));
///
- /// properties.add(new FlagProperty(
+ /// properties.add(FlagProperty(
/// 'isCurrent',
/// value: isCurrent,
/// ifTrue: 'active',
@@ -2283,20 +2283,20 @@
/// showName: false,
/// ));
///
- /// properties.add(new DiagnosticsProperty<bool>('keepAlive', keepAlive));
+ /// properties.add(DiagnosticsProperty<bool>('keepAlive', keepAlive));
///
/// // FlagProperty could have also been used in this case.
/// // This option results in the text "obscureText: true" instead
/// // of "obscureText" which is a bit more verbose but a bit clearer.
- /// properties.add(new DiagnosticsProperty<bool>('obscureText', obscureText, defaultValue: false));
+ /// properties.add(DiagnosticsProperty<bool>('obscureText', obscureText, defaultValue: false));
///
- /// properties.add(new EnumProperty<TextAlign>('textAlign', textAlign, defaultValue: null));
- /// properties.add(new EnumProperty<ImageRepeat>('repeat', repeat, defaultValue: ImageRepeat.noRepeat));
+ /// properties.add(EnumProperty<TextAlign>('textAlign', textAlign, defaultValue: null));
+ /// properties.add(EnumProperty<ImageRepeat>('repeat', repeat, defaultValue: ImageRepeat.noRepeat));
///
/// // Warn users when the widget is missing but do not show the value.
- /// properties.add(new ObjectFlagProperty<Widget>('widget', widget, ifNull: 'no widget'));
+ /// properties.add(ObjectFlagProperty<Widget>('widget', widget, ifNull: 'no widget'));
///
- /// properties.add(new IterableProperty<BoxShadow>(
+ /// properties.add(IterableProperty<BoxShadow>(
/// 'boxShadow',
/// boxShadow,
/// defaultValue: null,
@@ -2304,7 +2304,7 @@
/// ));
///
/// // Getting the value of size throws an exception unless hasSize is true.
- /// properties.add(new DiagnosticsProperty<Size>.lazy(
+ /// properties.add(DiagnosticsProperty<Size>.lazy(
/// 'size',
/// () => size,
/// description: '${ hasSize ? size : "MISSING" }',
@@ -2314,7 +2314,7 @@
/// // good terse description, write a DiagnosticsProperty subclass as in
/// // the case of TransformProperty which displays a nice debugging view
/// // of a Matrix4 that represents a transform.
- /// properties.add(new TransformProperty('transform', transform));
+ /// properties.add(TransformProperty('transform', transform));
///
/// // If the value class has a good `toString` method, use
/// // DiagnosticsProperty<YourValueType>. Specifying the value type ensures
@@ -2322,11 +2322,11 @@
/// // provide the right UI affordances. For example, in this case even
/// // if color is null, a debugging tool still knows the value is a Color
/// // and can display relevant color related UI.
- /// properties.add(new DiagnosticsProperty<Color>('color', color));
+ /// properties.add(DiagnosticsProperty<Color>('color', color));
///
/// // Use a custom description to generate a more terse summary than the
/// // `toString` method on the map class.
- /// properties.add(new DiagnosticsProperty<Map<Listenable, VoidCallback>>(
+ /// properties.add(DiagnosticsProperty<Map<Listenable, VoidCallback>>(
/// 'handles',
/// handles,
/// description: handles != null ?
diff --git a/packages/flutter/lib/src/foundation/licenses.dart b/packages/flutter/lib/src/foundation/licenses.dart
index cbacdf4..316307c 100644
--- a/packages/flutter/lib/src/foundation/licenses.dart
+++ b/packages/flutter/lib/src/foundation/licenses.dart
@@ -70,7 +70,7 @@
/// ```dart
/// void initMyLibrary() {
/// LicenseRegistry.addLicense(() async* {
-/// yield new LicenseEntryWithLineBreaks(<String>['my_library'], '''
+/// yield LicenseEntryWithLineBreaks(<String>['my_library'], '''
/// Copyright 2016 The Sample Authors. All rights reserved.
///
/// Redistribution and use in source and binary forms, with or without
diff --git a/packages/flutter/lib/src/material/animated_icons/animated_icons.dart b/packages/flutter/lib/src/material/animated_icons/animated_icons.dart
index 6e3d27c..e86bacc 100644
--- a/packages/flutter/lib/src/material/animated_icons/animated_icons.dart
+++ b/packages/flutter/lib/src/material/animated_icons/animated_icons.dart
@@ -19,7 +19,7 @@
/// ### Sample code
///
/// ```dart
-/// new AnimatedIcon(
+/// AnimatedIcon(
/// icon: AnimatedIcons.menu_arrow,
/// progress: controller,
/// semanticLabel: 'Show menu',
diff --git a/packages/flutter/lib/src/material/app.dart b/packages/flutter/lib/src/material/app.dart
index b2eb132..cfcdc91 100644
--- a/packages/flutter/lib/src/material/app.dart
+++ b/packages/flutter/lib/src/material/app.dart
@@ -336,7 +336,7 @@
/// const FooLocalizationsDelegate();
/// @override
/// Future<FooLocalizations> load(Locale locale) {
- /// return new SynchronousFuture(new FooLocalizations(locale));
+ /// return SynchronousFuture(FooLocalizations(locale));
/// }
/// @override
/// bool shouldReload(FooLocalizationsDelegate old) => false;
@@ -350,7 +350,7 @@
/// [localizationsDelegates] list.
///
/// ```dart
- /// new MaterialApp(
+ /// MaterialApp(
/// localizationsDelegates: [
/// const FooLocalizationsDelegate(),
/// ],
diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart
index c99af2c..89ef37b 100644
--- a/packages/flutter/lib/src/material/app_bar.dart
+++ b/packages/flutter/lib/src/material/app_bar.dart
@@ -91,21 +91,21 @@
/// ## Sample code
///
/// ```dart
-/// new AppBar(
-/// title: new Text('My Fancy Dress'),
+/// AppBar(
+/// title: Text('My Fancy Dress'),
/// actions: <Widget>[
-/// new IconButton(
-/// icon: new Icon(Icons.playlist_play),
+/// IconButton(
+/// icon: Icon(Icons.playlist_play),
/// tooltip: 'Air it',
/// onPressed: _airDress,
/// ),
-/// new IconButton(
-/// icon: new Icon(Icons.playlist_add),
+/// IconButton(
+/// icon: Icon(Icons.playlist_add),
/// tooltip: 'Restitch it',
/// onPressed: _restitchDress,
/// ),
-/// new IconButton(
-/// icon: new Icon(Icons.playlist_add_check),
+/// IconButton(
+/// icon: Icon(Icons.playlist_add_check),
/// tooltip: 'Repair it',
/// onPressed: _repairDress,
/// ),
@@ -191,12 +191,12 @@
/// ## Sample code
///
/// ```dart
- /// new Scaffold(
- /// appBar: new AppBar(
- /// title: new Text('Hello World'),
+ /// Scaffold(
+ /// appBar: AppBar(
+ /// title: Text('Hello World'),
/// actions: <Widget>[
- /// new IconButton(
- /// icon: new Icon(Icons.shopping_cart),
+ /// IconButton(
+ /// icon: Icon(Icons.shopping_cart),
/// tooltip: 'Open shopping cart',
/// onPressed: () {
/// // ...
@@ -693,13 +693,13 @@
/// [CustomScrollView.slivers] list:
///
/// ```dart
-/// new SliverAppBar(
+/// SliverAppBar(
/// expandedHeight: 150.0,
/// flexibleSpace: const FlexibleSpaceBar(
/// title: Text('Available seats'),
/// ),
/// actions: <Widget>[
-/// new IconButton(
+/// IconButton(
/// icon: const Icon(Icons.add_circle),
/// tooltip: 'Add new entry',
/// onPressed: () { /* ... */ },
@@ -788,15 +788,15 @@
/// ## Sample code
///
/// ```dart
- /// new Scaffold(
- /// body: new CustomScrollView(
+ /// Scaffold(
+ /// body: CustomScrollView(
/// primary: true,
/// slivers: <Widget>[
- /// new SliverAppBar(
- /// title: new Text('Hello World'),
+ /// SliverAppBar(
+ /// title: Text('Hello World'),
/// actions: <Widget>[
- /// new IconButton(
- /// icon: new Icon(Icons.shopping_cart),
+ /// IconButton(
+ /// icon: Icon(Icons.shopping_cart),
/// tooltip: 'Open shopping cart',
/// onPressed: () {
/// // handle the press
diff --git a/packages/flutter/lib/src/material/bottom_app_bar.dart b/packages/flutter/lib/src/material/bottom_app_bar.dart
index f84f8af..cb8c91a 100644
--- a/packages/flutter/lib/src/material/bottom_app_bar.dart
+++ b/packages/flutter/lib/src/material/bottom_app_bar.dart
@@ -22,12 +22,12 @@
/// ## Sample code
///
/// ```dart
-/// new Scaffold(
-/// bottomNavigationBar: new BottomAppBar(
+/// Scaffold(
+/// bottomNavigationBar: BottomAppBar(
/// color: Colors.white,
/// child: bottomAppBarContents,
/// ),
-/// floatingActionButton: new FloatingActionButton(onPressed: null),
+/// floatingActionButton: FloatingActionButton(onPressed: null),
/// )
/// ```
///
diff --git a/packages/flutter/lib/src/material/button.dart b/packages/flutter/lib/src/material/button.dart
index 9a75ac1..712bea2 100644
--- a/packages/flutter/lib/src/material/button.dart
+++ b/packages/flutter/lib/src/material/button.dart
@@ -293,11 +293,11 @@
/// Typically, a material design color will be used, as follows:
///
/// ```dart
- /// new MaterialButton(
- /// color: Colors.blue[500],
- /// onPressed: _handleTap,
- /// child: new Text('DEMO'),
- /// ),
+ /// MaterialButton(
+ /// color: Colors.blue[500],
+ /// onPressed: _handleTap,
+ /// child: Text('DEMO'),
+ /// ),
/// ```
final Color color;
diff --git a/packages/flutter/lib/src/material/button_theme.dart b/packages/flutter/lib/src/material/button_theme.dart
index 42a9247..6ae76f2 100644
--- a/packages/flutter/lib/src/material/button_theme.dart
+++ b/packages/flutter/lib/src/material/button_theme.dart
@@ -190,9 +190,9 @@
/// Simply a convenience that returns [minWidth] and [height] as a
/// [BoxConstraints] object:
/// ```dart
- /// return new BoxConstraints(
+ /// return BoxConstraints(
/// minWidth: minWidth,
- /// minHeight: height,
+ /// minHeight: height,
/// );
/// ```
BoxConstraints get constraints {
diff --git a/packages/flutter/lib/src/material/card.dart b/packages/flutter/lib/src/material/card.dart
index 688f6f0..cce955a 100644
--- a/packages/flutter/lib/src/material/card.dart
+++ b/packages/flutter/lib/src/material/card.dart
@@ -17,8 +17,8 @@
/// Here is an example of using a [Card] widget.
///
/// ```dart
-/// new Card(
-/// child: new Column(
+/// Card(
+/// child: Column(
/// mainAxisSize: MainAxisSize.min,
/// children: <Widget>[
/// const ListTile(
@@ -26,14 +26,14 @@
/// title: Text('The Enchanted Nightingale'),
/// subtitle: Text('Music by Julie Gable. Lyrics by Sidney Stein.'),
/// ),
-/// new ButtonTheme.bar( // make buttons use the appropriate styles for cards
-/// child: new ButtonBar(
+/// ButtonTheme.bar( // make buttons use the appropriate styles for cards
+/// child: ButtonBar(
/// children: <Widget>[
-/// new FlatButton(
+/// FlatButton(
/// child: const Text('BUY TICKETS'),
/// onPressed: () { /* ... */ },
/// ),
-/// new FlatButton(
+/// FlatButton(
/// child: const Text('LISTEN'),
/// onPressed: () { /* ... */ },
/// ),
diff --git a/packages/flutter/lib/src/material/checkbox.dart b/packages/flutter/lib/src/material/checkbox.dart
index 5c3fe5c..ca116ad 100644
--- a/packages/flutter/lib/src/material/checkbox.dart
+++ b/packages/flutter/lib/src/material/checkbox.dart
@@ -87,7 +87,7 @@
/// gets rebuilt; for example:
///
/// ```dart
- /// new Checkbox(
+ /// Checkbox(
/// value: _throwShotAway,
/// onChanged: (bool newValue) {
/// setState(() {
diff --git a/packages/flutter/lib/src/material/checkbox_list_tile.dart b/packages/flutter/lib/src/material/checkbox_list_tile.dart
index 9c1c9fe..fdb6ae5 100644
--- a/packages/flutter/lib/src/material/checkbox_list_tile.dart
+++ b/packages/flutter/lib/src/material/checkbox_list_tile.dart
@@ -40,7 +40,7 @@
/// (including the animation of the checkbox itself getting checked!).
///
/// ```dart
-/// new CheckboxListTile(
+/// CheckboxListTile(
/// title: const Text('Animate Slowly'),
/// value: timeDilation != 1.0,
/// onChanged: (bool value) {
@@ -113,14 +113,14 @@
/// gets rebuilt; for example:
///
/// ```dart
- /// new CheckboxListTile(
+ /// CheckboxListTile(
/// value: _throwShotAway,
/// onChanged: (bool newValue) {
/// setState(() {
/// _throwShotAway = newValue;
/// });
/// },
- /// title: new Text('Throw away your shot'),
+ /// title: Text('Throw away your shot'),
/// )
/// ```
final ValueChanged<bool> onChanged;
diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart
index f23d2f9..741cca2 100644
--- a/packages/flutter/lib/src/material/chip.dart
+++ b/packages/flutter/lib/src/material/chip.dart
@@ -156,7 +156,7 @@
///
/// class CastList extends StatefulWidget {
/// @override
- /// State createState() => new CastListState();
+ /// State createState() => CastListState();
/// }
///
/// class CastListState extends State<CastList> {
@@ -169,11 +169,11 @@
///
/// Iterable<Widget> get actorWidgets sync* {
/// for (Actor actor in _cast) {
- /// yield new Padding(
+ /// yield Padding(
/// padding: const EdgeInsets.all(4.0),
- /// child: new Chip(
- /// avatar: new CircleAvatar(child: new Text(actor.initials)),
- /// label: new Text(actor.name),
+ /// child: Chip(
+ /// avatar: CircleAvatar(child: Text(actor.initials)),
+ /// label: Text(actor.name),
/// onDeleted: () {
/// setState(() {
/// _cast.removeWhere((Actor entry) {
@@ -188,7 +188,7 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new Wrap(
+ /// return Wrap(
/// children: actorWidgets.toList(),
/// );
/// }
@@ -253,7 +253,7 @@
/// ```dart
/// class Wood extends StatefulWidget {
/// @override
- /// State<StatefulWidget> createState() => new WoodState();
+ /// State<StatefulWidget> createState() => WoodState();
/// }
///
/// class WoodState extends State<Wood> {
@@ -261,7 +261,7 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new InputChip(
+ /// return InputChip(
/// label: const Text('Use Chisel'),
/// selected: _useChisel,
/// onSelected: (bool newValue) {
@@ -369,7 +369,7 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new InputChip(
+ /// return InputChip(
/// label: const Text('Apply Hammer'),
/// onPressed: startHammering,
/// );
@@ -397,12 +397,12 @@
/// ## Sample code
///
/// ```dart
-/// new Chip(
-/// avatar: new CircleAvatar(
+/// Chip(
+/// avatar: CircleAvatar(
/// backgroundColor: Colors.grey.shade800,
-/// child: new Text('AB'),
+/// child: Text('AB'),
/// ),
-/// label: new Text('Aaron Burr'),
+/// label: Text('Aaron Burr'),
/// )
/// ```
///
@@ -513,12 +513,12 @@
/// ## Sample code
///
/// ```dart
-/// new InputChip(
-/// avatar: new CircleAvatar(
+/// InputChip(
+/// avatar: CircleAvatar(
/// backgroundColor: Colors.grey.shade800,
-/// child: new Text('AB'),
+/// child: Text('AB'),
/// ),
-/// label: new Text('Aaron Burr'),
+/// label: Text('Aaron Burr'),
/// onPressed: () {
/// print('I am the one thing in life.');
/// }
@@ -661,7 +661,7 @@
/// ```dart
/// class MyThreeOptions extends StatefulWidget {
/// @override
-/// _MyThreeOptionsState createState() => new _MyThreeOptionsState();
+/// _MyThreeOptionsState createState() => _MyThreeOptionsState();
/// }
///
/// class _MyThreeOptionsState extends State<MyThreeOptions> {
@@ -669,12 +669,12 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new Wrap(
-/// children: new List<Widget>.generate(
+/// return Wrap(
+/// children: List<Widget>.generate(
/// 3,
/// (int index) {
-/// return new ChoiceChip(
-/// label: new Text('Item $index'),
+/// return ChoiceChip(
+/// label: Text('Item $index'),
/// selected: _value == index,
/// onSelected: (bool selected) {
/// _value = selected ? index : null;
@@ -807,7 +807,7 @@
///
/// class CastFilter extends StatefulWidget {
/// @override
-/// State createState() => new CastFilterState();
+/// State createState() => CastFilterState();
/// }
///
/// class CastFilterState extends State<CastFilter> {
@@ -821,11 +821,11 @@
///
/// Iterable<Widget> get actorWidgets sync* {
/// for (ActorFilterEntry actor in _cast) {
-/// yield new Padding(
+/// yield Padding(
/// padding: const EdgeInsets.all(4.0),
-/// child: new FilterChip(
-/// avatar: new CircleAvatar(child: new Text(actor.initials)),
-/// label: new Text(actor.name),
+/// child: FilterChip(
+/// avatar: CircleAvatar(child: Text(actor.initials)),
+/// label: Text(actor.name),
/// selected: _filters.contains(actor.name),
/// onSelected: (bool value) {
/// setState(() {
@@ -848,10 +848,10 @@
/// return Column(
/// mainAxisAlignment: MainAxisAlignment.center,
/// children: <Widget>[
-/// new Wrap(
+/// Wrap(
/// children: actorWidgets.toList(),
/// ),
-/// new Text('Look for: ${_filters.join(', ')}'),
+/// Text('Look for: ${_filters.join(', ')}'),
/// ],
/// );
/// }
@@ -977,12 +977,12 @@
/// ## Sample code
///
/// ```dart
-/// new ActionChip(
-/// avatar: new CircleAvatar(
+/// ActionChip(
+/// avatar: CircleAvatar(
/// backgroundColor: Colors.grey.shade800,
-/// child: new Text('AB'),
+/// child: Text('AB'),
/// ),
-/// label: new Text('Aaron Burr'),
+/// label: Text('Aaron Burr'),
/// onPressed: () {
/// print("If you stand for nothing, Burr, what’ll you fall for?");
/// }
diff --git a/packages/flutter/lib/src/material/chip_theme.dart b/packages/flutter/lib/src/material/chip_theme.dart
index 445486a..1eb8558 100644
--- a/packages/flutter/lib/src/material/chip_theme.dart
+++ b/packages/flutter/lib/src/material/chip_theme.dart
@@ -66,9 +66,9 @@
/// class Spaceship extends StatelessWidget {
/// @override
/// Widget build(BuildContext context) {
- /// return new ChipTheme(
+ /// return ChipTheme(
/// data: ChipTheme.of(context).copyWith(backgroundColor: Colors.red),
- /// child: new ActionChip(
+ /// child: ActionChip(
/// label: const Text('Launch'),
/// onPressed: () { print('We have liftoff!'); },
/// ),
@@ -116,7 +116,7 @@
/// ```dart
/// class CarColor extends StatefulWidget {
/// @override
-/// State createState() => new _CarColorState();
+/// State createState() => _CarColorState();
/// }
///
/// class _CarColorState extends State<CarColor> {
@@ -124,10 +124,10 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new ChipTheme(
+/// return ChipTheme(
/// data: ChipTheme.of(context).copyWith(backgroundColor: Colors.lightBlue),
-/// child: new ChoiceChip(
-/// label: new Text('Light Blue'),
+/// child: ChoiceChip(
+/// label: Text('Light Blue'),
/// onSelected: (bool value) {
/// setState(() {
/// _color = value ? Colors.lightBlue : Colors.red;
diff --git a/packages/flutter/lib/src/material/circle_avatar.dart b/packages/flutter/lib/src/material/circle_avatar.dart
index 7a9ba00..5d90762 100644
--- a/packages/flutter/lib/src/material/circle_avatar.dart
+++ b/packages/flutter/lib/src/material/circle_avatar.dart
@@ -23,8 +23,8 @@
/// [backgroundImage] property:
///
/// ```dart
-/// new CircleAvatar(
-/// backgroundImage: new NetworkImage(userAvatarUrl),
+/// CircleAvatar(
+/// backgroundImage: NetworkImage(userAvatarUrl),
/// )
/// ```
///
@@ -34,9 +34,9 @@
/// provided using a [Text] widget as the [child] and a [backgroundColor]:
///
/// ```dart
-/// new CircleAvatar(
+/// CircleAvatar(
/// backgroundColor: Colors.brown.shade800,
-/// child: new Text('AH'),
+/// child: Text('AH'),
/// )
/// ```
///
diff --git a/packages/flutter/lib/src/material/colors.dart b/packages/flutter/lib/src/material/colors.dart
index dcf3909..5bd7af1 100644
--- a/packages/flutter/lib/src/material/colors.dart
+++ b/packages/flutter/lib/src/material/colors.dart
@@ -116,7 +116,7 @@
/// Each [ColorSwatch] constant is a color and can used directly. For example:
///
/// ```dart
-/// new Container(
+/// Container(
/// color: Colors.blue, // same as Colors.blue[500] or Colors.blue.shade500
/// )
/// ```
@@ -398,7 +398,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.red[400],
/// )
@@ -441,7 +441,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.redAccent[400],
/// )
@@ -478,7 +478,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.pink[400],
/// )
@@ -521,7 +521,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.pinkAccent[400],
/// )
@@ -558,7 +558,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.purple[400],
/// )
@@ -601,7 +601,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.purpleAccent[400],
/// )
@@ -638,7 +638,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.deepPurple[400],
/// )
@@ -681,7 +681,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.deepPurpleAccent[400],
/// )
@@ -718,7 +718,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.indigo[400],
/// )
@@ -761,7 +761,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.indigoAccent[400],
/// )
@@ -800,7 +800,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.blue[400],
/// )
@@ -843,7 +843,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.blueAccent[400],
/// )
@@ -880,7 +880,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.lightBlue[400],
/// )
@@ -923,7 +923,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.lightBlueAccent[400],
/// )
@@ -962,7 +962,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.cyan[400],
/// )
@@ -1005,7 +1005,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.cyanAccent[400],
/// )
@@ -1042,7 +1042,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.teal[400],
/// )
@@ -1085,7 +1085,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.tealAccent[400],
/// )
@@ -1125,7 +1125,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.green[400],
/// )
@@ -1171,7 +1171,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.greenAccent[400],
/// )
@@ -1208,7 +1208,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.lightGreen[400],
/// )
@@ -1251,7 +1251,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.lightGreenAccent[400],
/// )
@@ -1288,7 +1288,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.lime[400],
/// )
@@ -1331,7 +1331,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.limeAccent[400],
/// )
@@ -1368,7 +1368,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.yellow[400],
/// )
@@ -1411,7 +1411,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.yellowAccent[400],
/// )
@@ -1448,7 +1448,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.amber[400],
/// )
@@ -1491,7 +1491,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.amberAccent[400],
/// )
@@ -1530,7 +1530,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.orange[400],
/// )
@@ -1573,7 +1573,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.orangeAccent[400],
/// )
@@ -1612,7 +1612,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.deepOrange[400],
/// )
@@ -1655,7 +1655,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.deepOrangeAccent[400],
/// )
@@ -1691,7 +1691,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.brown[400],
/// )
@@ -1737,7 +1737,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.grey[400],
/// )
@@ -1784,7 +1784,7 @@
/// ## Sample code
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// Icons.widgets,
/// color: Colors.blueGrey[400],
/// )
diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart
index 9c93960..de2dc55 100644
--- a/packages/flutter/lib/src/material/dialog.dart
+++ b/packages/flutter/lib/src/material/dialog.dart
@@ -121,19 +121,19 @@
/// context: context,
/// barrierDismissible: false, // user must tap button!
/// builder: (BuildContext context) {
-/// return new AlertDialog(
-/// title: new Text('Rewind and remember'),
-/// content: new SingleChildScrollView(
-/// child: new ListBody(
+/// return AlertDialog(
+/// title: Text('Rewind and remember'),
+/// content: SingleChildScrollView(
+/// child: ListBody(
/// children: <Widget>[
-/// new Text('You will never be satisfied.'),
-/// new Text('You\’re like me. I’m never satisfied.'),
+/// Text('You will never be satisfied.'),
+/// Text('You\’re like me. I’m never satisfied.'),
/// ],
/// ),
/// ),
/// actions: <Widget>[
-/// new FlatButton(
-/// child: new Text('Regret'),
+/// FlatButton(
+/// child: Text('Regret'),
/// onPressed: () {
/// Navigator.of(context).pop();
/// },
@@ -309,7 +309,7 @@
/// ## Sample code
///
/// ```dart
-/// new SimpleDialogOption(
+/// SimpleDialogOption(
/// onPressed: () { Navigator.pop(context, Department.treasury); },
/// child: const Text('Treasury department'),
/// )
@@ -388,14 +388,14 @@
/// switch (await showDialog<Department>(
/// context: context,
/// builder: (BuildContext context) {
-/// return new SimpleDialog(
+/// return SimpleDialog(
/// title: const Text('Select assignment'),
/// children: <Widget>[
-/// new SimpleDialogOption(
+/// SimpleDialogOption(
/// onPressed: () { Navigator.pop(context, Department.treasury); },
/// child: const Text('Treasury department'),
/// ),
-/// new SimpleDialogOption(
+/// SimpleDialogOption(
/// onPressed: () { Navigator.pop(context, Department.state); },
/// child: const Text('State department'),
/// ),
diff --git a/packages/flutter/lib/src/material/divider.dart b/packages/flutter/lib/src/material/divider.dart
index f6ddaa6..05dda8d 100644
--- a/packages/flutter/lib/src/material/divider.dart
+++ b/packages/flutter/lib/src/material/divider.dart
@@ -55,7 +55,7 @@
/// ## Sample code
///
/// ```dart
- /// new Divider(
+ /// Divider(
/// color: Colors.deepOrange,
/// )
/// ```
@@ -75,9 +75,9 @@
/// scrollable section from the rest of the interface.
///
/// ```dart
- /// new DecoratedBox(
- /// decoration: new BoxDecoration(
- /// border: new Border(
+ /// DecoratedBox(
+ /// decoration: BoxDecoration(
+ /// border: Border(
/// top: Divider.createBorderSide(context),
/// bottom: Divider.createBorderSide(context),
/// ),
diff --git a/packages/flutter/lib/src/material/drawer.dart b/packages/flutter/lib/src/material/drawer.dart
index 4849cbd..4263711 100644
--- a/packages/flutter/lib/src/material/drawer.dart
+++ b/packages/flutter/lib/src/material/drawer.dart
@@ -56,9 +56,9 @@
/// a drawer item might close the drawer when tapped:
///
/// ```dart
-/// new ListTile(
-/// leading: new Icon(Icons.change_history),
-/// title: new Text('Change history'),
+/// ListTile(
+/// leading: Icon(Icons.change_history),
+/// title: Text('Change history'),
/// onTap: () {
/// // change app state...
/// Navigator.pop(context); // close the drawer
diff --git a/packages/flutter/lib/src/material/feedback.dart b/packages/flutter/lib/src/material/feedback.dart
index d7dc105..eeca730 100644
--- a/packages/flutter/lib/src/material/feedback.dart
+++ b/packages/flutter/lib/src/material/feedback.dart
@@ -36,7 +36,7 @@
/// class WidgetWithWrappedHandler extends StatelessWidget {
/// @override
/// Widget build(BuildContext context) {
-/// return new GestureDetector(
+/// return GestureDetector(
/// onTap: Feedback.wrapForTap(_onTapHandler, context),
/// onLongPress: Feedback.wrapForLongPress(_onLongPressHandler, context),
/// child: const Text('X'),
@@ -60,7 +60,7 @@
/// class WidgetWithExplicitCall extends StatelessWidget {
/// @override
/// Widget build(BuildContext context) {
-/// return new GestureDetector(
+/// return GestureDetector(
/// onTap: () {
/// // Do some work (e.g. check if the tap is valid)
/// Feedback.forTap(context);
diff --git a/packages/flutter/lib/src/material/floating_action_button_location.dart b/packages/flutter/lib/src/material/floating_action_button_location.dart
index 8dfbc15..64a32ec 100644
--- a/packages/flutter/lib/src/material/floating_action_button_location.dart
+++ b/packages/flutter/lib/src/material/floating_action_button_location.dart
@@ -270,7 +270,7 @@
/// @override
/// Animation<double> getScaleAnimation({@required Animation<double> parent}) {
/// // The animations will cross at value 0, and the train will return to 1.0.
- /// return new TrainHoppingAnimation(
+ /// return TrainHoppingAnimation(
/// Tween<double>(begin: 1.0, end: -1.0).animate(parent),
/// Tween<double>(begin: -1.0, end: 1.0).animate(parent),
/// );
@@ -289,10 +289,10 @@
/// [FloatingActionButton] through a full circle:
///
/// ```dart
- /// @override
- /// Animation<double> getRotationAnimation({@required Animation<double> parent}) {
- /// return new Tween<double>(begin: 0.0, end: 1.0).animate(parent);
- /// }
+ /// @override
+ /// Animation<double> getRotationAnimation({@required Animation<double> parent}) {
+ /// return Tween<double>(begin: 0.0, end: 1.0).animate(parent);
+ /// }
/// ```
Animation<double> getRotationAnimation({@required Animation<double> parent});
diff --git a/packages/flutter/lib/src/material/icon_button.dart b/packages/flutter/lib/src/material/icon_button.dart
index 3278256..912dc83 100644
--- a/packages/flutter/lib/src/material/icon_button.dart
+++ b/packages/flutter/lib/src/material/icon_button.dart
@@ -40,8 +40,8 @@
/// ## Sample code
///
/// ```dart
-/// new IconButton(
-/// icon: new Icon(Icons.volume_up),
+/// IconButton(
+/// icon: Icon(Icons.volume_up),
/// tooltip: 'Increase volume by 10%',
/// onPressed: () { setState(() { _volume *= 1.1; }); },
/// )
@@ -137,11 +137,11 @@
/// See also [disabledColor].
///
/// ```dart
- /// new IconButton(
- /// color: Colors.blue,
- /// onPressed: _handleTap,
- /// icon: Icons.widgets,
- /// ),
+ /// IconButton(
+ /// color: Colors.blue,
+ /// onPressed: _handleTap,
+ /// icon: Icons.widgets,
+ /// ),
/// ```
final Color color;
diff --git a/packages/flutter/lib/src/material/ink_decoration.dart b/packages/flutter/lib/src/material/ink_decoration.dart
index f58b1b9..d204903 100644
--- a/packages/flutter/lib/src/material/ink_decoration.dart
+++ b/packages/flutter/lib/src/material/ink_decoration.dart
@@ -50,17 +50,17 @@
/// on it using [Ink], while still having ink effects over the yellow rectangle:
///
/// ```dart
-/// new Material(
+/// Material(
/// color: Colors.teal[900],
-/// child: new Center(
-/// child: new Ink(
+/// child: Center(
+/// child: Ink(
/// color: Colors.yellow,
/// width: 200.0,
/// height: 100.0,
-/// child: new InkWell(
+/// child: InkWell(
/// onTap: () { /* ... */ },
-/// child: new Center(
-/// child: new Text('YELLOW'),
+/// child: Center(
+/// child: Text('YELLOW'),
/// )
/// ),
/// ),
@@ -72,21 +72,21 @@
/// widget with an [InkWell] above it:
///
/// ```dart
-/// new Material(
+/// Material(
/// color: Colors.grey[800],
-/// child: new Center(
-/// child: new Ink.image(
-/// image: new AssetImage('cat.jpeg'),
+/// child: Center(
+/// child: Ink.image(
+/// image: AssetImage('cat.jpeg'),
/// fit: BoxFit.cover,
/// width: 300.0,
/// height: 200.0,
-/// child: new InkWell(
+/// child: InkWell(
/// onTap: () { /* ... */ },
-/// child: new Align(
+/// child: Align(
/// alignment: Alignment.topLeft,
-/// child: new Padding(
+/// child: Padding(
/// padding: const EdgeInsets.all(10.0),
-/// child: new Text('KITTEN', style: new TextStyle(fontWeight: FontWeight.w900, color: Colors.white)),
+/// child: Text('KITTEN', style: TextStyle(fontWeight: FontWeight.w900, color: Colors.white)),
/// ),
/// )
/// ),
diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart
index 98d3e30..ec1aba3 100644
--- a/packages/flutter/lib/src/material/input_decorator.dart
+++ b/packages/flutter/lib/src/material/input_decorator.dart
@@ -2119,7 +2119,7 @@
/// To pad the leading edge of the prefix icon:
///
/// ```dart
- /// prefixIcon: new Padding(
+ /// prefixIcon: Padding(
/// padding: const EdgeInsetsDirectional.only(start: 12.0),
/// child: myIcon, // icon is 48px widget.
/// )
@@ -2166,7 +2166,7 @@
/// To pad the trailing edge of the suffix icon:
///
/// ```dart
- /// suffixIcon: new Padding(
+ /// suffixIcon: Padding(
/// padding: const EdgeInsetsDirectional.only(end: 12.0),
/// child: myIcon, // icon is 48px widget.
/// )
diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart
index 8fa7828..9c817c8 100644
--- a/packages/flutter/lib/src/material/list_tile.dart
+++ b/packages/flutter/lib/src/material/list_tile.dart
@@ -175,7 +175,7 @@
/// Here is a simple tile with an icon and some text.
///
/// ```dart
-/// new ListTile(
+/// ListTile(
/// leading: const Icon(Icons.event_seat),
/// title: const Text('The seat for the narrator'),
/// )
@@ -188,7 +188,7 @@
/// ```dart
/// int _act = 1;
/// // ...
-/// new ListTile(
+/// ListTile(
/// leading: const Icon(Icons.flight_land),
/// title: const Text('Trix\'s airplane'),
/// subtitle: _act != 2 ? const Text('The airplane is only in Act II.') : null,
diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart
index ac54202..e58dbe5 100644
--- a/packages/flutter/lib/src/material/popup_menu.dart
+++ b/packages/flutter/lib/src/material/popup_menu.dart
@@ -291,7 +291,7 @@
/// shows a divider placed between the two menu items.)
///
/// ```dart
-/// new PopupMenuButton<Commands>(
+/// PopupMenuButton<Commands>(
/// onSelected: (Commands result) {
/// switch (result) {
/// case Commands.heroAndScholar:
@@ -304,7 +304,7 @@
/// }
/// },
/// itemBuilder: (BuildContext context) => <PopupMenuEntry<Commands>>[
-/// new CheckedPopupMenuItem<Commands>(
+/// CheckedPopupMenuItem<Commands>(
/// checked: _heroAndScholar,
/// value: Commands.heroAndScholar,
/// child: const Text('Hero and scholar'),
@@ -774,7 +774,7 @@
///
/// // This menu button widget updates a _selection field (of type WhyFarther,
/// // not shown here).
-/// new PopupMenuButton<WhyFarther>(
+/// PopupMenuButton<WhyFarther>(
/// onSelected: (WhyFarther result) { setState(() { _selection = result; }); },
/// itemBuilder: (BuildContext context) => <PopupMenuEntry<WhyFarther>>[
/// const PopupMenuItem<WhyFarther>(
diff --git a/packages/flutter/lib/src/material/radio.dart b/packages/flutter/lib/src/material/radio.dart
index ec13e4b..a492f82 100644
--- a/packages/flutter/lib/src/material/radio.dart
+++ b/packages/flutter/lib/src/material/radio.dart
@@ -81,7 +81,7 @@
/// gets rebuilt; for example:
///
/// ```dart
- /// new Radio<SingingCharacter>(
+ /// Radio<SingingCharacter>(
/// value: SingingCharacter.lafayette,
/// groupValue: _character,
/// onChanged: (SingingCharacter newValue) {
diff --git a/packages/flutter/lib/src/material/radio_list_tile.dart b/packages/flutter/lib/src/material/radio_list_tile.dart
index 698e46f..2fee40c 100644
--- a/packages/flutter/lib/src/material/radio_list_tile.dart
+++ b/packages/flutter/lib/src/material/radio_list_tile.dart
@@ -50,15 +50,15 @@
/// SingingCharacter _character = SingingCharacter.lafayette;
///
/// // In the build function of that State:
-/// new Column(
+/// Column(
/// children: <Widget>[
-/// new RadioListTile<SingingCharacter>(
+/// RadioListTile<SingingCharacter>(
/// title: const Text('Lafayette'),
/// value: SingingCharacter.lafayette,
/// groupValue: _character,
/// onChanged: (SingingCharacter value) { setState(() { _character = value; }); },
/// ),
-/// new RadioListTile<SingingCharacter>(
+/// RadioListTile<SingingCharacter>(
/// title: const Text('Thomas Jefferson'),
/// value: SingingCharacter.jefferson,
/// groupValue: _character,
@@ -130,7 +130,7 @@
/// gets rebuilt; for example:
///
/// ```dart
- /// new RadioListTile<SingingCharacter>(
+ /// RadioListTile<SingingCharacter>(
/// title: const Text('Lafayette'),
/// value: SingingCharacter.lafayette,
/// groupValue: _character,
diff --git a/packages/flutter/lib/src/material/raised_button.dart b/packages/flutter/lib/src/material/raised_button.dart
index 7b06c05..553dcf8 100644
--- a/packages/flutter/lib/src/material/raised_button.dart
+++ b/packages/flutter/lib/src/material/raised_button.dart
@@ -170,10 +170,10 @@
/// for example:
///
/// ```dart
- /// new RaisedButton(
+ /// RaisedButton(
/// color: Colors.blue,
/// onPressed: _handleTap,
- /// child: new Text('DEMO'),
+ /// child: Text('DEMO'),
/// ),
/// ```
///
diff --git a/packages/flutter/lib/src/material/refresh_indicator.dart b/packages/flutter/lib/src/material/refresh_indicator.dart
index eb3dbbf..2a9608e 100644
--- a/packages/flutter/lib/src/material/refresh_indicator.dart
+++ b/packages/flutter/lib/src/material/refresh_indicator.dart
@@ -58,7 +58,7 @@
/// settings its `physics` property to [AlwaysScrollableScrollPhysics]:
///
/// ```dart
-/// new ListView(
+/// ListView(
/// physics: const AlwaysScrollableScrollPhysics(),
/// children: ...
// )
diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart
index 8cffb0b..c3d16f8 100644
--- a/packages/flutter/lib/src/material/scaffold.dart
+++ b/packages/flutter/lib/src/material/scaffold.dart
@@ -850,11 +850,11 @@
/// ```dart
/// @override
/// Widget build(BuildContext context) {
- /// return new RaisedButton(
- /// child: new Text('SHOW A SNACKBAR'),
+ /// return RaisedButton(
+ /// child: Text('SHOW A SNACKBAR'),
/// onPressed: () {
- /// Scaffold.of(context).showSnackBar(new SnackBar(
- /// content: new Text('Hello!'),
+ /// Scaffold.of(context).showSnackBar(SnackBar(
+ /// content: Text('Hello!'),
/// ));
/// },
/// );
@@ -870,20 +870,20 @@
/// ```dart
/// @override
/// Widget build(BuildContext context) {
- /// return new Scaffold(
- /// appBar: new AppBar(
- /// title: new Text('Demo')
+ /// return Scaffold(
+ /// appBar: AppBar(
+ /// title: Text('Demo')
/// ),
- /// body: new Builder(
+ /// body: Builder(
/// // Create an inner BuildContext so that the onPressed methods
/// // can refer to the Scaffold with Scaffold.of().
/// builder: (BuildContext context) {
- /// return new Center(
- /// child: new RaisedButton(
- /// child: new Text('SHOW A SNACKBAR'),
+ /// return Center(
+ /// child: RaisedButton(
+ /// child: Text('SHOW A SNACKBAR'),
/// onPressed: () {
- /// Scaffold.of(context).showSnackBar(new SnackBar(
- /// content: new Text('Hello!'),
+ /// Scaffold.of(context).showSnackBar(SnackBar(
+ /// content: Text('Hello!'),
/// ));
/// },
/// ),
diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart
index 4ace398..a0fecac 100644
--- a/packages/flutter/lib/src/material/slider.dart
+++ b/packages/flutter/lib/src/material/slider.dart
@@ -148,7 +148,7 @@
/// ## Sample code
///
/// ```dart
- /// new Slider(
+ /// Slider(
/// value: _duelCommandment.toDouble(),
/// min: 1.0,
/// max: 10.0,
@@ -182,7 +182,7 @@
/// ## Sample code
///
/// ```dart
- /// new Slider(
+ /// Slider(
/// value: _duelCommandment.toDouble(),
/// min: 1.0,
/// max: 10.0,
@@ -214,7 +214,7 @@
/// ## Sample code
///
/// ```dart
- /// new Slider(
+ /// Slider(
/// value: _duelCommandment.toDouble(),
/// min: 1.0,
/// max: 10.0,
@@ -310,7 +310,7 @@
/// announce a value with a currency label.
///
/// ```dart
- /// new Slider(
+ /// Slider(
/// value: _dollars.toDouble(),
/// min: 20.0,
/// max: 330.0,
diff --git a/packages/flutter/lib/src/material/slider_theme.dart b/packages/flutter/lib/src/material/slider_theme.dart
index 0f0558f..eee54fb 100644
--- a/packages/flutter/lib/src/material/slider_theme.dart
+++ b/packages/flutter/lib/src/material/slider_theme.dart
@@ -53,7 +53,7 @@
/// ```dart
/// class Launch extends StatefulWidget {
/// @override
- /// State createState() => new LaunchState();
+ /// State createState() => LaunchState();
/// }
///
/// class LaunchState extends State<Launch> {
@@ -61,9 +61,9 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new SliderTheme(
+ /// return SliderTheme(
/// data: SliderTheme.of(context).copyWith(activeTrackColor: const Color(0xff804040)),
- /// child: new Slider(
+ /// child: Slider(
/// onChanged: (double value) { setState(() { _rocketThrust = value; }); },
/// value: _rocketThrust,
/// ),
@@ -160,7 +160,7 @@
/// ```dart
/// class Blissful extends StatefulWidget {
/// @override
- /// State createState() => new BlissfulState();
+ /// State createState() => BlissfulState();
/// }
///
/// class BlissfulState extends State<Blissful> {
@@ -168,9 +168,9 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new SliderTheme(
+ /// return SliderTheme(
/// data: SliderTheme.of(context).copyWith(activeTrackColor: const Color(0xff404080)),
- /// child: new Slider(
+ /// child: Slider(
/// onChanged: (double value) { setState(() { _bliss = value; }); },
/// value: _bliss,
/// ),
diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart
index 406a883..2e75a51 100644
--- a/packages/flutter/lib/src/material/snack_bar.dart
+++ b/packages/flutter/lib/src/material/snack_bar.dart
@@ -38,7 +38,7 @@
///
/// ```dart
/// Scaffold.of(context).showSnackBar(
-/// new SnackBar( ... )
+/// SnackBar( ... )
/// ).closed.then((SnackBarClosedReason reason) {
/// ...
/// });
diff --git a/packages/flutter/lib/src/material/switch.dart b/packages/flutter/lib/src/material/switch.dart
index d89b238..12ddb95 100644
--- a/packages/flutter/lib/src/material/switch.dart
+++ b/packages/flutter/lib/src/material/switch.dart
@@ -85,7 +85,7 @@
/// gets rebuilt; for example:
///
/// ```dart
- /// new Switch(
+ /// Switch(
/// value: _giveVerse,
/// onChanged: (bool newValue) {
/// setState(() {
diff --git a/packages/flutter/lib/src/material/switch_list_tile.dart b/packages/flutter/lib/src/material/switch_list_tile.dart
index 151234c..67866aa 100644
--- a/packages/flutter/lib/src/material/switch_list_tile.dart
+++ b/packages/flutter/lib/src/material/switch_list_tile.dart
@@ -41,7 +41,7 @@
/// member field called `_lights`.
///
/// ```dart
-/// new SwitchListTile(
+/// SwitchListTile(
/// title: const Text('Lights'),
/// value: _lights,
/// onChanged: (bool value) { setState(() { _lights = value; }); },
@@ -106,14 +106,14 @@
/// gets rebuilt; for example:
///
/// ```dart
- /// new SwitchListTile(
+ /// SwitchListTile(
/// value: _lights,
/// onChanged: (bool newValue) {
/// setState(() {
/// _lights = newValue;
/// });
/// },
- /// title: new Text('Lights'),
+ /// title: Text('Lights'),
/// )
/// ```
final ValueChanged<bool> onChanged;
diff --git a/packages/flutter/lib/src/material/tab_controller.dart b/packages/flutter/lib/src/material/tab_controller.dart
index 5a86473..1fed41f 100644
--- a/packages/flutter/lib/src/material/tab_controller.dart
+++ b/packages/flutter/lib/src/material/tab_controller.dart
@@ -27,13 +27,13 @@
/// class MyTabbedPage extends StatefulWidget {
/// const MyTabbedPage({ Key key }) : super(key: key);
/// @override
-/// _MyTabbedPageState createState() => new _MyTabbedPageState();
+/// _MyTabbedPageState createState() => _MyTabbedPageState();
/// }
///
/// class _MyTabbedPageState extends State<MyTabbedPage> with SingleTickerProviderStateMixin {
/// final List<Tab> myTabs = <Tab>[
-/// new Tab(text: 'LEFT'),
-/// new Tab(text: 'RIGHT'),
+/// Tab(text: 'LEFT'),
+/// Tab(text: 'RIGHT'),
/// ];
///
/// TabController _tabController;
@@ -41,7 +41,7 @@
/// @override
/// void initState() {
/// super.initState();
-/// _tabController = new TabController(vsync: this, length: myTabs.length);
+/// _tabController = TabController(vsync: this, length: myTabs.length);
/// }
///
/// @override
@@ -52,17 +52,17 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new Scaffold(
-/// appBar: new AppBar(
-/// bottom: new TabBar(
+/// return Scaffold(
+/// appBar: AppBar(
+/// bottom: TabBar(
/// controller: _tabController,
/// tabs: myTabs,
/// ),
/// ),
-/// body: new TabBarView(
+/// body: TabBarView(
/// controller: _tabController,
/// children: myTabs.map((Tab tab) {
-/// return new Center(child: new Text(tab.text));
+/// return Center(child: Text(tab.text));
/// }).toList(),
/// ),
/// );
@@ -216,23 +216,23 @@
/// ```dart
/// class MyDemo extends StatelessWidget {
/// final List<Tab> myTabs = <Tab>[
-/// new Tab(text: 'LEFT'),
-/// new Tab(text: 'RIGHT'),
+/// Tab(text: 'LEFT'),
+/// Tab(text: 'RIGHT'),
/// ];
///
/// @override
/// Widget build(BuildContext context) {
-/// return new DefaultTabController(
+/// return DefaultTabController(
/// length: myTabs.length,
-/// child: new Scaffold(
-/// appBar: new AppBar(
-/// bottom: new TabBar(
+/// child: Scaffold(
+/// appBar: AppBar(
+/// bottom: TabBar(
/// tabs: myTabs,
/// ),
/// ),
-/// body: new TabBarView(
+/// body: TabBarView(
/// children: myTabs.map((Tab tab) {
-/// return new Center(child: new Text(tab.text));
+/// return Center(child: Text(tab.text));
/// }).toList(),
/// ),
/// ),
diff --git a/packages/flutter/lib/src/material/theme.dart b/packages/flutter/lib/src/material/theme.dart
index cebb86b..6cbe614 100644
--- a/packages/flutter/lib/src/material/theme.dart
+++ b/packages/flutter/lib/src/material/theme.dart
@@ -89,7 +89,7 @@
/// ```dart
/// @override
/// Widget build(BuildContext context) {
- /// return new Text(
+ /// return Text(
/// 'Example',
/// style: Theme.of(context).textTheme.title,
/// );
@@ -106,14 +106,14 @@
/// ```dart
/// @override
/// Widget build(BuildContext context) {
- /// return new MaterialApp(
- /// theme: new ThemeData.light(),
- /// body: new Builder(
+ /// return MaterialApp(
+ /// theme: ThemeData.light(),
+ /// body: Builder(
/// // Create an inner BuildContext so that we can refer to
/// // the Theme with Theme.of().
/// builder: (BuildContext context) {
- /// return new Center(
- /// child: new Text(
+ /// return Center(
+ /// child: Text(
/// 'Example',
/// style: Theme.of(context).textTheme.title,
/// ),
diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart
index b6336ab..a21d001 100644
--- a/packages/flutter/lib/src/material/time_picker.dart
+++ b/packages/flutter/lib/src/material/time_picker.dart
@@ -1654,7 +1654,7 @@
///
/// ```dart
/// showTimePicker(
-/// initialTime: new TimeOfDay.now(),
+/// initialTime: TimeOfDay.now(),
/// context: context,
/// );
/// ```
diff --git a/packages/flutter/lib/src/material/typography.dart b/packages/flutter/lib/src/material/typography.dart
index 7f83412..1476be9 100644
--- a/packages/flutter/lib/src/material/typography.dart
+++ b/packages/flutter/lib/src/material/typography.dart
@@ -120,7 +120,7 @@
/// @override
/// Widget build(BuildContext context) {
/// final ThemeData theme = Theme.of(context);
- /// return new Theme(
+ /// return Theme(
/// data: theme.copyWith(
/// textTheme: theme.textTheme.copyWith(
/// title: theme.textTheme.title.copyWith(
@@ -204,9 +204,9 @@
/// // set the title, but everything else would be null. This isn't very
/// // useful, so merge it with the existing theme to keep all of the
/// // preexisting definitions for the other styles.
- /// TextTheme partialTheme = new TextTheme(title: new TextStyle(color: titleColor));
+ /// TextTheme partialTheme = TextTheme(title: TextStyle(color: titleColor));
/// theme = theme.copyWith(textTheme: theme.textTheme.merge(partialTheme));
- /// return new Theme(data: theme, child: child);
+ /// return Theme(data: theme, child: child);
/// }
/// }
/// ```
diff --git a/packages/flutter/lib/src/painting/borders.dart b/packages/flutter/lib/src/painting/borders.dart
index 42162ff..d1b4311 100644
--- a/packages/flutter/lib/src/painting/borders.dart
+++ b/packages/flutter/lib/src/painting/borders.dart
@@ -34,15 +34,15 @@
/// it that is a darker shade of blue.
///
/// ```dart
-/// new Container(
-/// padding: new EdgeInsets.all(8.0),
-/// decoration: new BoxDecoration(
-/// border: new Border(
-/// top: new BorderSide(width: 16.0, color: Colors.lightBlue.shade50),
-/// bottom: new BorderSide(width: 16.0, color: Colors.lightBlue.shade900),
+/// Container(
+/// padding: EdgeInsets.all(8.0),
+/// decoration: BoxDecoration(
+/// border: Border(
+/// top: BorderSide(width: 16.0, color: Colors.lightBlue.shade50),
+/// bottom: BorderSide(width: 16.0, color: Colors.lightBlue.shade900),
/// ),
/// ),
-/// child: new Text('Flutter in the sky', textAlign: TextAlign.center),
+/// child: Text('Flutter in the sky', textAlign: TextAlign.center),
/// )
/// ```
///
diff --git a/packages/flutter/lib/src/painting/box_border.dart b/packages/flutter/lib/src/painting/box_border.dart
index 0435603..6814b9d 100644
--- a/packages/flutter/lib/src/painting/box_border.dart
+++ b/packages/flutter/lib/src/painting/box_border.dart
@@ -251,19 +251,19 @@
/// All four borders the same, two-pixel wide solid white:
///
/// ```dart
-/// new Border.all(width: 2.0, color: const Color(0xFFFFFFFF))
+/// Border.all(width: 2.0, color: const Color(0xFFFFFFFF))
/// ```
///
/// The border for a material design divider:
///
/// ```dart
-/// new Border(bottom: new BorderSide(color: Theme.of(context).dividerColor))
+/// Border(bottom: BorderSide(color: Theme.of(context).dividerColor))
/// ```
///
/// A 1990s-era "OK" button:
///
/// ```dart
-/// new Container(
+/// Container(
/// decoration: const BoxDecoration(
/// border: Border(
/// top: BorderSide(width: 1.0, color: Color(0xFFFFFFFFFF)),
@@ -272,7 +272,7 @@
/// bottom: BorderSide(width: 1.0, color: Color(0xFFFF000000)),
/// ),
/// ),
-/// child: new Container(
+/// child: Container(
/// padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 2.0),
/// decoration: const BoxDecoration(
/// border: Border(
diff --git a/packages/flutter/lib/src/painting/box_decoration.dart b/packages/flutter/lib/src/painting/box_decoration.dart
index dc1d586..f4f7e61 100644
--- a/packages/flutter/lib/src/painting/box_decoration.dart
+++ b/packages/flutter/lib/src/painting/box_decoration.dart
@@ -38,14 +38,14 @@
/// draw an image with a border:
///
/// ```dart
-/// new Container(
-/// decoration: new BoxDecoration(
+/// Container(
+/// decoration: BoxDecoration(
/// color: const Color(0xff7c94b6),
-/// image: new DecorationImage(
-/// image: new ExactAssetImage('images/flowers.jpeg'),
+/// image: DecorationImage(
+/// image: ExactAssetImage('images/flowers.jpeg'),
/// fit: BoxFit.cover,
/// ),
-/// border: new Border.all(
+/// border: Border.all(
/// color: Colors.black,
/// width: 8.0,
/// ),
diff --git a/packages/flutter/lib/src/painting/box_fit.dart b/packages/flutter/lib/src/painting/box_fit.dart
index fd74821..a0638c0 100644
--- a/packages/flutter/lib/src/painting/box_fit.dart
+++ b/packages/flutter/lib/src/painting/box_fit.dart
@@ -110,7 +110,7 @@
///
/// ```dart
/// void paintImage(ui.Image image, Rect outputRect, Canvas canvas, Paint paint, BoxFit fit) {
-/// final Size imageSize = new Size(image.width.toDouble(), image.height.toDouble());
+/// final Size imageSize = Size(image.width.toDouble(), image.height.toDouble());
/// final FittedSizes sizes = applyBoxFit(fit, imageSize, outputRect.size);
/// final Rect inputSubrect = Alignment.center.inscribe(sizes.source, Offset.zero & imageSize);
/// final Rect outputSubrect = Alignment.center.inscribe(sizes.destination, outputRect);
diff --git a/packages/flutter/lib/src/painting/gradient.dart b/packages/flutter/lib/src/painting/gradient.dart
index b6b1a69..b8b6c5b 100644
--- a/packages/flutter/lib/src/painting/gradient.dart
+++ b/packages/flutter/lib/src/painting/gradient.dart
@@ -242,11 +242,11 @@
/// a [Container] display a [BoxDecoration] with a [LinearGradient].
///
/// ```dart
-/// new Container(
-/// decoration: new BoxDecoration(
-/// gradient: new LinearGradient(
+/// Container(
+/// decoration: BoxDecoration(
+/// gradient: LinearGradient(
/// begin: Alignment.topLeft,
-/// end: new Alignment(0.8, 0.0), // 10% of the width, so there are ten blinds.
+/// end: Alignment(0.8, 0.0), // 10% of the width, so there are ten blinds.
/// colors: [const Color(0xFFFFFFEE), const Color(0xFF999999)], // whitish to gray
/// tileMode: TileMode.repeated, // repeats the gradient over the canvas
/// ),
@@ -476,7 +476,7 @@
///
/// ```dart
/// void paintSky(Canvas canvas, Rect rect) {
-/// var gradient = new RadialGradient(
+/// var gradient = RadialGradient(
/// center: const Alignment(0.7, -0.6), // near the top right
/// radius: 0.2,
/// colors: [
@@ -486,7 +486,7 @@
/// stops: [0.4, 1.0],
/// );
/// // rect is the area we are painting over
-/// var paint = new Paint()
+/// var paint = Paint()
/// ..shader = gradient.createShader(rect);
/// canvas.drawRect(rect, paint);
/// }
@@ -733,9 +733,9 @@
/// This sample draws a different color in each quadrant.
///
/// ```dart
-/// new Container(
-/// decoration: new BoxDecoration(
-/// gradient: new SweepGradient(
+/// Container(
+/// decoration: BoxDecoration(
+/// gradient: SweepGradient(
/// center: FractionalOffset.center,
/// startAngle: 0.0,
/// endAngle: math.pi * 2,
diff --git a/packages/flutter/lib/src/painting/image_provider.dart b/packages/flutter/lib/src/painting/image_provider.dart
index 66a7f91..88b7508 100644
--- a/packages/flutter/lib/src/painting/image_provider.dart
+++ b/packages/flutter/lib/src/painting/image_provider.dart
@@ -187,7 +187,7 @@
/// final ImageProvider imageProvider;
///
/// @override
-/// _MyImageState createState() => new _MyImageState();
+/// _MyImageState createState() => _MyImageState();
/// }
///
/// class _MyImageState extends State<MyImage> {
@@ -237,7 +237,7 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new RawImage(
+/// return RawImage(
/// image: _imageInfo?.image, // this is a dart:ui Image object
/// scale: _imageInfo?.scale ?? 1.0,
/// );
@@ -310,11 +310,11 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new Image.network(url);
+ /// return Image.network(url);
/// }
///
/// void evictImage() {
- /// final NetworkImage provider = new NetworkImage(url);
+ /// final NetworkImage provider = NetworkImage(url);
/// provider.evict().then<void>((bool success) {
/// if (success)
/// debugPrint('removed image!');
@@ -659,7 +659,7 @@
/// Then, to fetch the image and associate it with scale `1.5`, use
///
/// ```dart
-/// new AssetImage('icons/heart.png', scale: 1.5)
+/// AssetImage('icons/heart.png', scale: 1.5)
/// ```
///
///## Assets in packages
@@ -669,7 +669,7 @@
/// `my_icons`. Then to fetch the image, use:
///
/// ```dart
-/// new AssetImage('icons/heart.png', scale: 1.5, package: 'my_icons')
+/// AssetImage('icons/heart.png', scale: 1.5, package: 'my_icons')
/// ```
///
/// Assets used by the package itself should also be fetched using the [package]
diff --git a/packages/flutter/lib/src/painting/image_resolution.dart b/packages/flutter/lib/src/painting/image_resolution.dart
index 48b3e5b..4691c77 100644
--- a/packages/flutter/lib/src/painting/image_resolution.dart
+++ b/packages/flutter/lib/src/painting/image_resolution.dart
@@ -76,7 +76,7 @@
///
/// Then, to fetch the image, use
/// ```dart
-/// new AssetImage('icons/heart.png')
+/// AssetImage('icons/heart.png')
/// ```
///
/// ## Assets in packages
@@ -86,7 +86,7 @@
/// `my_icons`. Then to fetch the image, use:
///
/// ```dart
-/// new AssetImage('icons/heart.png', package: 'my_icons')
+/// AssetImage('icons/heart.png', package: 'my_icons')
/// ```
///
/// Assets used by the package itself should also be fetched using the [package]
diff --git a/packages/flutter/lib/src/painting/shape_decoration.dart b/packages/flutter/lib/src/painting/shape_decoration.dart
index 433a88f..7211d34 100644
--- a/packages/flutter/lib/src/painting/shape_decoration.dart
+++ b/packages/flutter/lib/src/painting/shape_decoration.dart
@@ -30,16 +30,16 @@
/// "RGB" inside it:
///
/// ```dart
-/// new Container(
-/// decoration: new ShapeDecoration(
+/// Container(
+/// decoration: ShapeDecoration(
/// color: Colors.white,
-/// shape: new Border.all(
+/// shape: Border.all(
/// color: Colors.red,
/// width: 8.0,
-/// ) + new Border.all(
+/// ) + Border.all(
/// color: Colors.green,
/// width: 8.0,
-/// ) + new Border.all(
+/// ) + Border.all(
/// color: Colors.blue,
/// width: 8.0,
/// ),
diff --git a/packages/flutter/lib/src/painting/text_span.dart b/packages/flutter/lib/src/painting/text_span.dart
index 6b8c79f..c5a5b75 100644
--- a/packages/flutter/lib/src/painting/text_span.dart
+++ b/packages/flutter/lib/src/painting/text_span.dart
@@ -32,9 +32,9 @@
/// The text "Hello world!", in black:
///
/// ```dart
-/// new TextSpan(
+/// TextSpan(
/// text: 'Hello world!',
-/// style: new TextStyle(color: Colors.black),
+/// style: TextStyle(color: Colors.black),
/// )
/// ```
///
@@ -104,7 +104,7 @@
/// ```dart
/// class BuzzingText extends StatefulWidget {
/// @override
- /// _BuzzingTextState createState() => new _BuzzingTextState();
+ /// _BuzzingTextState createState() => _BuzzingTextState();
/// }
///
/// class _BuzzingTextState extends State<BuzzingText> {
@@ -113,7 +113,7 @@
/// @override
/// void initState() {
/// super.initState();
- /// _longPressRecognizer = new LongPressGestureRecognizer()
+ /// _longPressRecognizer = LongPressGestureRecognizer()
/// ..onLongPress = _handlePress;
/// }
///
@@ -129,21 +129,21 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new RichText(
- /// text: new TextSpan(
+ /// return RichText(
+ /// text: TextSpan(
/// text: 'Can you ',
- /// style: new TextStyle(color: Colors.black),
+ /// style: TextStyle(color: Colors.black),
/// children: <TextSpan>[
- /// new TextSpan(
+ /// TextSpan(
/// text: 'find the',
- /// style: new TextStyle(
+ /// style: TextStyle(
/// color: Colors.green,
/// decoration: TextDecoration.underline,
/// decorationStyle: TextDecorationStyle.wavy,
/// ),
/// recognizer: _longPressRecognizer,
/// ),
- /// new TextSpan(
+ /// TextSpan(
/// text: ' secret?',
/// ),
/// ],
diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart
index 6134c1b..4af9eb9 100644
--- a/packages/flutter/lib/src/painting/text_style.dart
+++ b/packages/flutter/lib/src/painting/text_style.dart
@@ -24,9 +24,9 @@
/// [Text] widget.
///
/// ```dart
-/// new Text(
+/// Text(
/// 'No, we need bold strokes. We need this plan.',
-/// style: new TextStyle(fontWeight: FontWeight.bold),
+/// style: TextStyle(fontWeight: FontWeight.bold),
/// )
/// ```
///
@@ -36,9 +36,9 @@
/// override which is implicitly mixed with the ambient [DefaultTextStyle].
///
/// ```dart
-/// new Text(
+/// Text(
/// 'Welcome to the present, we\'re running a real nation.',
-/// style: new TextStyle(fontStyle: FontStyle.italic),
+/// style: TextStyle(fontStyle: FontStyle.italic),
/// )
/// ```
///
@@ -52,24 +52,24 @@
/// implicitly mixed with the parent [TextSpan]'s [TextSpan.style].
///
/// If [color] is specified, [foreground] must be null and vice versa. [color] is
-/// treated as a shorthand for `new Paint()..color = color`.
+/// treated as a shorthand for `Paint()..color = color`.
///
/// ```dart
-/// new RichText(
-/// text: new TextSpan(
+/// RichText(
+/// text: TextSpan(
/// style: DefaultTextStyle.of(context).style,
/// children: <TextSpan>[
-/// new TextSpan(
+/// TextSpan(
/// text: 'You don\'t have the votes.\n',
-/// style: new TextStyle(color: Colors.black.withOpacity(0.6)),
+/// style: TextStyle(color: Colors.black.withOpacity(0.6)),
/// ),
-/// new TextSpan(
+/// TextSpan(
/// text: 'You don\'t have the votes!\n',
-/// style: new TextStyle(color: Colors.black.withOpacity(0.8)),
+/// style: TextStyle(color: Colors.black.withOpacity(0.8)),
/// ),
-/// new TextSpan(
+/// TextSpan(
/// text: 'You\'re gonna need congressional approval and you don\'t have the votes!\n',
-/// style: new TextStyle(color: Colors.black.withOpacity(1.0)),
+/// style: TextStyle(color: Colors.black.withOpacity(1.0)),
/// ),
/// ],
/// ),
@@ -82,7 +82,7 @@
/// obtain a [TextStyle] that doubles the default font size.
///
/// ```dart
-/// new Text(
+/// Text(
/// 'These are wise words, enterprising men quote \'em.',
/// style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 2.0),
/// )
@@ -94,9 +94,9 @@
/// height is set to 100 logical pixels, so that the text is very spaced out.
///
/// ```dart
-/// new Text(
+/// Text(
/// 'Don\'t act surprised, you guys, cuz I wrote \'em!',
-/// style: new TextStyle(height: 100.0),
+/// style: TextStyle(height: 100.0),
/// )
/// ```
///
@@ -109,20 +109,20 @@
/// does not automatically use the ambient [DefaultTextStyle].)
///
/// ```dart
-/// new RichText(
-/// text: new TextSpan(
+/// RichText(
+/// text: TextSpan(
/// text: 'Don\'t tax the South ',
/// children: <TextSpan>[
-/// new TextSpan(
+/// TextSpan(
/// text: 'cuz',
-/// style: new TextStyle(
+/// style: TextStyle(
/// color: Colors.black,
/// decoration: TextDecoration.underline,
/// decorationColor: Colors.red,
/// decorationStyle: TextDecorationStyle.wavy,
/// ),
/// ),
-/// new TextSpan(
+/// TextSpan(
/// text: ' we got it made in the shade',
/// ),
/// ],
@@ -262,7 +262,7 @@
/// The color to use when painting the text.
///
/// If [foreground] is specified, this value must be null. The [color] property
- /// is shorthand for `new Paint()..color = color`.
+ /// is shorthand for `Paint()..color = color`.
///
/// In [merge], [apply], and [lerp], conflicts between [color] and [foreground]
/// specification are resolved in [foreground]'s favor - i.e. if [foreground] is
@@ -333,7 +333,7 @@
/// updates all the way through the framework.
///
/// If [color] is specified, this value must be null. The [color] property
- /// is shorthand for `new Paint()..color = color`.
+ /// is shorthand for `Paint()..color = color`.
///
/// In [merge], [apply], and [lerp], conflicts between [color] and [foreground]
/// specification are resolved in [foreground]'s favor - i.e. if [foreground] is
diff --git a/packages/flutter/lib/src/physics/gravity_simulation.dart b/packages/flutter/lib/src/physics/gravity_simulation.dart
index 2873d65..e67c00d 100644
--- a/packages/flutter/lib/src/physics/gravity_simulation.dart
+++ b/packages/flutter/lib/src/physics/gravity_simulation.dart
@@ -16,7 +16,7 @@
///
/// ```dart
/// void _startFall() {
-/// _controller.animateWith(new GravitySimulation(
+/// _controller.animateWith(GravitySimulation(
/// 10.0, // acceleration, pixels per second per second
/// 0.0, // starting position, pixels
/// 300.0, // ending position, pixels
diff --git a/packages/flutter/lib/src/rendering/custom_layout.dart b/packages/flutter/lib/src/rendering/custom_layout.dart
index 201af4c..6d02dda 100644
--- a/packages/flutter/lib/src/rendering/custom_layout.dart
+++ b/packages/flutter/lib/src/rendering/custom_layout.dart
@@ -65,13 +65,13 @@
/// Size leaderSize = Size.zero;
///
/// if (hasChild(_Slot.leader)) {
-/// leaderSize = layoutChild(_Slot.leader, new BoxConstraints.loose(size));
+/// leaderSize = layoutChild(_Slot.leader, BoxConstraints.loose(size));
/// positionChild(_Slot.leader, Offset.zero);
/// }
///
/// if (hasChild(_Slot.follower)) {
-/// layoutChild(_Slot.follower, new BoxConstraints.tight(leaderSize));
-/// positionChild(_Slot.follower, new Offset(size.width - leaderSize.width,
+/// layoutChild(_Slot.follower, BoxConstraints.tight(leaderSize));
+/// positionChild(_Slot.follower, Offset(size.width - leaderSize.width,
/// size.height - leaderSize.height));
/// }
/// }
diff --git a/packages/flutter/lib/src/rendering/custom_paint.dart b/packages/flutter/lib/src/rendering/custom_paint.dart
index bf8ef59..55a3a6c 100644
--- a/packages/flutter/lib/src/rendering/custom_paint.dart
+++ b/packages/flutter/lib/src/rendering/custom_paint.dart
@@ -72,7 +72,7 @@
/// @override
/// void paint(Canvas canvas, Size size) {
/// var rect = Offset.zero & size;
-/// var gradient = new RadialGradient(
+/// var gradient = RadialGradient(
/// center: const Alignment(0.7, -0.6),
/// radius: 0.2,
/// colors: [const Color(0xFFFFFF00), const Color(0xFF0099FF)],
@@ -80,7 +80,7 @@
/// );
/// canvas.drawRect(
/// rect,
-/// new Paint()..shader = gradient.createShader(rect),
+/// Paint()..shader = gradient.createShader(rect),
/// );
/// }
///
@@ -93,11 +93,11 @@
/// // touch.
/// var rect = Offset.zero & size;
/// var width = size.shortestSide * 0.4;
-/// rect = const Alignment(0.8, -0.9).inscribe(new Size(width, width), rect);
+/// rect = const Alignment(0.8, -0.9).inscribe(Size(width, width), rect);
/// return [
-/// new CustomPainterSemantics(
+/// CustomPainterSemantics(
/// rect: rect,
-/// properties: new SemanticsProperties(
+/// properties: SemanticsProperties(
/// label: 'Sun',
/// textDirection: TextDirection.ltr,
/// ),
diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart
index 086f2a3..148f960 100644
--- a/packages/flutter/lib/src/rendering/proxy_box.dart
+++ b/packages/flutter/lib/src/rendering/proxy_box.dart
@@ -2586,11 +2586,11 @@
/// PngHome({Key key}) : super(key: key);
///
/// @override
- /// _PngHomeState createState() => new _PngHomeState();
+ /// _PngHomeState createState() => _PngHomeState();
/// }
///
/// class _PngHomeState extends State<PngHome> {
- /// GlobalKey globalKey = new GlobalKey();
+ /// GlobalKey globalKey = GlobalKey();
///
/// Future<void> _capturePng() async {
/// RenderRepaintBoundary boundary = globalKey.currentContext.findRenderObject();
diff --git a/packages/flutter/lib/src/services/platform_channel.dart b/packages/flutter/lib/src/services/platform_channel.dart
index 98c89fb..6c4484a 100644
--- a/packages/flutter/lib/src/services/platform_channel.dart
+++ b/packages/flutter/lib/src/services/platform_channel.dart
@@ -184,7 +184,7 @@
/// final String artist;
///
/// static Song fromJson(dynamic json) {
- /// return new Song(json['id'], json['title'], json['artist']);
+ /// return Song(json['id'], json['title'], json['artist']);
/// }
/// }
/// ```
@@ -200,7 +200,7 @@
/// break;
/// case "getSongs":
/// final List<MusicApi.Track> tracks = MusicApi.getTracks();
- /// final List<Object> json = new ArrayList<>(tracks.size());
+ /// final List<Object> json = ArrayList<>(tracks.size());
/// for (MusicApi.Track track : tracks) {
/// json.add(track.toJson()); // Map<String, Object> entries
/// }
diff --git a/packages/flutter/lib/src/widgets/animated_cross_fade.dart b/packages/flutter/lib/src/widgets/animated_cross_fade.dart
index d89bfbf..507350b 100644
--- a/packages/flutter/lib/src/widgets/animated_cross_fade.dart
+++ b/packages/flutter/lib/src/widgets/animated_cross_fade.dart
@@ -39,17 +39,17 @@
///
/// ```dart
/// Widget defaultLayoutBuilder(Widget topChild, Key topChildKey, Widget bottomChild, Key bottomChildKey) {
-/// return new Stack(
+/// return Stack(
/// fit: StackFit.loose,
/// children: <Widget>[
-/// new Positioned(
+/// Positioned(
/// key: bottomChildKey,
/// left: 0.0,
/// top: 0.0,
/// right: 0.0,
/// child: bottomChild,
/// ),
-/// new Positioned(
+/// Positioned(
/// key: topChildKey,
/// child: topChild,
/// )
@@ -87,7 +87,7 @@
/// over three seconds.
///
/// ```dart
-/// new AnimatedCrossFade(
+/// AnimatedCrossFade(
/// duration: const Duration(seconds: 3),
/// firstChild: const FlutterLogo(style: FlutterLogoStyle.horizontal, size: 100.0),
/// secondChild: const FlutterLogo(style: FlutterLogoStyle.stacked, size: 100.0),
diff --git a/packages/flutter/lib/src/widgets/animated_list.dart b/packages/flutter/lib/src/widgets/animated_list.dart
index a5e5e9e..efeeb69 100644
--- a/packages/flutter/lib/src/widgets/animated_list.dart
+++ b/packages/flutter/lib/src/widgets/animated_list.dart
@@ -196,9 +196,9 @@
/// can refer to the [AnimatedList]'s state with a global key:
///
/// ```dart
-/// GlobalKey<AnimatedListState> listKey = new GlobalKey<AnimatedListState>();
+/// GlobalKey<AnimatedListState> listKey = GlobalKey<AnimatedListState>();
/// ...
-/// new AnimatedList(key: listKey, ...);
+/// AnimatedList(key: listKey, ...);
/// ...
/// listKey.currentState.insert(123);
/// ```
diff --git a/packages/flutter/lib/src/widgets/animated_switcher.dart b/packages/flutter/lib/src/widgets/animated_switcher.dart
index 4d96c48..136fad5 100644
--- a/packages/flutter/lib/src/widgets/animated_switcher.dart
+++ b/packages/flutter/lib/src/widgets/animated_switcher.dart
@@ -79,7 +79,7 @@
/// const ClickCounter({Key key}) : super(key: key);
///
/// @override
-/// _ClickCounterState createState() => new _ClickCounterState();
+/// _ClickCounterState createState() => _ClickCounterState();
/// }
///
/// class _ClickCounterState extends State<ClickCounter> {
@@ -87,26 +87,26 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new MaterialApp(
-/// home: new Material(
+/// return MaterialApp(
+/// home: Material(
/// child: Column(
/// mainAxisAlignment: MainAxisAlignment.center,
/// children: <Widget>[
-/// new AnimatedSwitcher(
+/// AnimatedSwitcher(
/// duration: const Duration(milliseconds: 500),
/// transitionBuilder: (Widget child, Animation<double> animation) {
-/// return new ScaleTransition(child: child, scale: animation);
+/// return ScaleTransition(child: child, scale: animation);
/// },
-/// child: new Text(
+/// child: Text(
/// '$_count',
/// // This key causes the AnimatedSwitcher to interpret this as a "new"
/// // child each time the count changes, so that it will begin its animation
/// // when the count changes.
-/// key: new ValueKey<int>(_count),
+/// key: ValueKey<int>(_count),
/// style: Theme.of(context).textTheme.display1,
/// ),
/// ),
-/// new RaisedButton(
+/// RaisedButton(
/// child: const Text('Increment'),
/// onPressed: () {
/// setState(() {
diff --git a/packages/flutter/lib/src/widgets/async.dart b/packages/flutter/lib/src/widgets/async.dart
index 455241b..b73111c 100644
--- a/packages/flutter/lib/src/widgets/async.dart
+++ b/packages/flutter/lib/src/widgets/async.dart
@@ -348,16 +348,16 @@
/// set by a selector elsewhere in the UI.
///
/// ```dart
-/// new StreamBuilder<int>(
+/// StreamBuilder<int>(
/// stream: _lot?.bids, // a Stream<int> or null
/// builder: (BuildContext context, AsyncSnapshot<int> snapshot) {
/// if (snapshot.hasError)
-/// return new Text('Error: ${snapshot.error}');
+/// return Text('Error: ${snapshot.error}');
/// switch (snapshot.connectionState) {
-/// case ConnectionState.none: return new Text('Select lot');
-/// case ConnectionState.waiting: return new Text('Awaiting bids...');
-/// case ConnectionState.active: return new Text('\$${snapshot.data}');
-/// case ConnectionState.done: return new Text('\$${snapshot.data} (closed)');
+/// case ConnectionState.none: return Text('Select lot');
+/// case ConnectionState.waiting: return Text('Awaiting bids...');
+/// case ConnectionState.active: return Text('\$${snapshot.data}');
+/// case ConnectionState.done: return Text('\$${snapshot.data} (closed)');
/// }
/// return null; // unreachable
/// },
@@ -479,19 +479,19 @@
/// `_calculation` field is set by pressing a button elsewhere in the UI.
///
/// ```dart
-/// new FutureBuilder<String>(
+/// FutureBuilder<String>(
/// future: _calculation, // a previously-obtained Future<String> or null
/// builder: (BuildContext context, AsyncSnapshot<String> snapshot) {
/// switch (snapshot.connectionState) {
/// case ConnectionState.none:
-/// return new Text('Press button to start.');
+/// return Text('Press button to start.');
/// case ConnectionState.active:
/// case ConnectionState.waiting:
-/// return new Text('Awaiting result...');
+/// return Text('Awaiting result...');
/// case ConnectionState.done:
/// if (snapshot.hasError)
-/// return new Text('Error: ${snapshot.error}');
-/// return new Text('Result: ${snapshot.data}');
+/// return Text('Error: ${snapshot.error}');
+/// return Text('Result: ${snapshot.data}');
/// }
/// return null; // unreachable
/// },
diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart
index 0f9f224..bb6fbf7 100644
--- a/packages/flutter/lib/src/widgets/basic.dart
+++ b/packages/flutter/lib/src/widgets/basic.dart
@@ -134,7 +134,7 @@
/// hides it when it is false:
///
/// ```dart
-/// new Opacity(
+/// Opacity(
/// opacity: _visible ? 1.0 : 0.0,
/// child: const Text('Now you see me, now you don\'t!'),
/// )
@@ -230,9 +230,9 @@
/// This example makes the text look like it is on fire:
///
/// ```dart
-/// new ShaderMask(
+/// ShaderMask(
/// shaderCallback: (Rect bounds) {
-/// return new RadialGradient(
+/// return RadialGradient(
/// center: Alignment.topLeft,
/// radius: 1.0,
/// colors: <Color>[Colors.yellow, Colors.deepOrange.shade900],
@@ -362,10 +362,10 @@
/// text.
///
/// ```dart
-/// new CustomPaint(
-/// painter: new Sky(),
-/// child: new Center(
-/// child: new Text(
+/// CustomPaint(
+/// painter: Sky(),
+/// child: Center(
+/// child: Text(
/// 'Once upon a time...',
/// style: const TextStyle(
/// fontSize: 40.0,
@@ -476,11 +476,11 @@
/// the top half of an [Image]:
///
/// ```dart
-/// new ClipRect(
-/// child: new Align(
+/// ClipRect(
+/// child: Align(
/// alignment: Alignment.topCenter,
/// heightFactor: 0.5,
-/// child: new Image.network(userAvatarUrl),
+/// child: Image.network(userAvatarUrl),
/// ),
/// )
/// ```
@@ -870,12 +870,12 @@
/// top right corner pinned to its original position.
///
/// ```dart
-/// new Container(
+/// Container(
/// color: Colors.black,
-/// child: new Transform(
+/// child: Transform(
/// alignment: Alignment.topRight,
-/// transform: new Matrix4.skewY(0.3)..rotateZ(-math.pi / 12.0),
-/// child: new Container(
+/// transform: Matrix4.skewY(0.3)..rotateZ(-math.pi / 12.0),
+/// child: Container(
/// padding: const EdgeInsets.all(8.0),
/// color: const Color(0xFFE8581C),
/// child: const Text('Apartment for rent!'),
@@ -918,9 +918,9 @@
/// fifteen degrees.
///
/// ```dart
- /// new Transform.rotate(
+ /// Transform.rotate(
/// angle: -math.pi / 12.0,
- /// child: new Container(
+ /// child: Container(
/// padding: const EdgeInsets.all(8.0),
/// color: const Color(0xFFE8581C),
/// child: const Text('Apartment for rent!'),
@@ -946,9 +946,9 @@
/// This example shifts the silver-colored child down by fifteen pixels.
///
/// ```dart
- /// new Transform.translate(
+ /// Transform.translate(
/// offset: const Offset(0.0, 15.0),
- /// child: new Container(
+ /// child: Container(
/// padding: const EdgeInsets.all(8.0),
/// color: const Color(0xFF7F7F7F),
/// child: const Text('Quarter'),
@@ -979,9 +979,9 @@
/// is half the size it would otherwise be.
///
/// ```dart
- /// new Transform.scale(
+ /// Transform.scale(
/// scale: 0.5,
- /// child: new Container(
+ /// child: Container(
/// padding: const EdgeInsets.all(8.0),
/// color: const Color(0xFFE8581C),
/// child: const Text('Bad Ideas'),
@@ -1310,7 +1310,7 @@
/// to top, like an axis label on a graph:
///
/// ```dart
-/// new RotatedBox(
+/// RotatedBox(
/// quarterTurns: 3,
/// child: const Text('Hello World!'),
/// )
@@ -1358,8 +1358,8 @@
/// in each direction:
///
/// ```dart
-/// new Padding(
-/// padding: new EdgeInsets.all(8.0),
+/// Padding(
+/// padding: EdgeInsets.all(8.0),
/// child: const Card(child: Text('Hello World!')),
/// )
/// ```
@@ -1697,7 +1697,7 @@
/// exact size 200x300, parental constraints permitting:
///
/// ```dart
-/// new SizedBox(
+/// SizedBox(
/// width: 200.0,
/// height: 300.0,
/// child: const Card(child: Text('Hello World!')),
@@ -1804,7 +1804,7 @@
/// parent, by applying [BoxConstraints.expand] constraints:
///
/// ```dart
-/// new ConstrainedBox(
+/// ConstrainedBox(
/// constraints: const BoxConstraints.expand(),
/// child: const Card(child: Text('Hello World!')),
/// )
@@ -3529,16 +3529,16 @@
/// the third:
///
/// ```dart
-/// new Row(
+/// Row(
/// children: <Widget>[
-/// new Expanded(
-/// child: new Text('Deliver features faster', textAlign: TextAlign.center),
+/// Expanded(
+/// child: Text('Deliver features faster', textAlign: TextAlign.center),
/// ),
-/// new Expanded(
-/// child: new Text('Craft beautiful UIs', textAlign: TextAlign.center),
+/// Expanded(
+/// child: Text('Craft beautiful UIs', textAlign: TextAlign.center),
/// ),
-/// new Expanded(
-/// child: new FittedBox(
+/// Expanded(
+/// child: FittedBox(
/// fit: BoxFit.contain, // otherwise the logo will be tiny
/// child: const FlutterLogo(),
/// ),
@@ -3564,7 +3564,7 @@
/// Suppose, for instance, that you had this code:
///
/// ```dart
-/// new Row(
+/// Row(
/// children: <Widget>[
/// const FlutterLogo(),
/// const Text('Flutter\'s hot reload helps you quickly and easily experiment, build UIs, add features, and fix bug faster. Experience sub-second reload times, without losing state, on emulators, simulators, and hardware for iOS and Android.'),
@@ -3589,7 +3589,7 @@
/// row that the child should be given the remaining room:
///
/// ```dart
-/// new Row(
+/// Row(
/// children: <Widget>[
/// const FlutterLogo(),
/// const Expanded(
@@ -3711,12 +3711,12 @@
/// being made to fill all the remaining space.
///
/// ```dart
-/// new Column(
+/// Column(
/// children: <Widget>[
-/// new Text('Deliver features faster'),
-/// new Text('Craft beautiful UIs'),
-/// new Expanded(
-/// child: new FittedBox(
+/// Text('Deliver features faster'),
+/// Text('Craft beautiful UIs'),
+/// Expanded(
+/// child: FittedBox(
/// fit: BoxFit.contain, // otherwise the logo will be tiny
/// child: const FlutterLogo(),
/// ),
@@ -3732,17 +3732,17 @@
/// fit the children.
///
/// ```dart
-/// new Column(
+/// Column(
/// crossAxisAlignment: CrossAxisAlignment.start,
/// mainAxisSize: MainAxisSize.min,
/// children: <Widget>[
-/// new Text('We move under cover and we move as one'),
-/// new Text('Through the night, we have one shot to live another day'),
-/// new Text('We cannot let a stray gunshot give us away'),
-/// new Text('We will fight up close, seize the moment and stay in it'),
-/// new Text('It’s either that or meet the business end of a bayonet'),
-/// new Text('The code word is ‘Rochambeau,’ dig me?'),
-/// new Text('Rochambeau!', style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 2.0)),
+/// Text('We move under cover and we move as one'),
+/// Text('Through the night, we have one shot to live another day'),
+/// Text('We cannot let a stray gunshot give us away'),
+/// Text('We will fight up close, seize the moment and stay in it'),
+/// Text('It’s either that or meet the business end of a bayonet'),
+/// Text('The code word is ‘Rochambeau,’ dig me?'),
+/// Text('Rochambeau!', style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 2.0)),
/// ],
/// )
/// ```
@@ -4005,25 +4005,25 @@
/// that they flow across lines as necessary.
///
/// ```dart
-/// new Wrap(
+/// Wrap(
/// spacing: 8.0, // gap between adjacent chips
/// runSpacing: 4.0, // gap between lines
/// children: <Widget>[
-/// new Chip(
-/// avatar: new CircleAvatar(backgroundColor: Colors.blue.shade900, child: new Text('AH')),
-/// label: new Text('Hamilton'),
+/// Chip(
+/// avatar: CircleAvatar(backgroundColor: Colors.blue.shade900, child: Text('AH')),
+/// label: Text('Hamilton'),
/// ),
-/// new Chip(
-/// avatar: new CircleAvatar(backgroundColor: Colors.blue.shade900, child: new Text('ML')),
-/// label: new Text('Lafayette'),
+/// Chip(
+/// avatar: CircleAvatar(backgroundColor: Colors.blue.shade900, child: Text('ML')),
+/// label: Text('Lafayette'),
/// ),
-/// new Chip(
-/// avatar: new CircleAvatar(backgroundColor: Colors.blue.shade900, child: new Text('HM')),
-/// label: new Text('Mulligan'),
+/// Chip(
+/// avatar: CircleAvatar(backgroundColor: Colors.blue.shade900, child: Text('HM')),
+/// label: Text('Mulligan'),
/// ),
-/// new Chip(
-/// avatar: new CircleAvatar(backgroundColor: Colors.blue.shade900, child: new Text('JL')),
-/// label: new Text('Laurens'),
+/// Chip(
+/// avatar: CircleAvatar(backgroundColor: Colors.blue.shade900, child: Text('JL')),
+/// label: Text('Laurens'),
/// ),
/// ],
/// )
@@ -4329,13 +4329,13 @@
/// ## Sample code
///
/// ```dart
-/// new RichText(
-/// text: new TextSpan(
+/// RichText(
+/// text: TextSpan(
/// text: 'Hello ',
/// style: DefaultTextStyle.of(context).style,
/// children: <TextSpan>[
-/// new TextSpan(text: 'bold', style: new TextStyle(fontWeight: FontWeight.bold)),
-/// new TextSpan(text: ' world!'),
+/// TextSpan(text: 'bold', style: TextStyle(fontWeight: FontWeight.bold)),
+/// TextSpan(text: ' world!'),
/// ],
/// ),
/// )
@@ -4665,7 +4665,7 @@
/// @override
/// Future<ByteData> load(String key) async {
/// if (key == 'resources/test')
-/// return new ByteData.view(new Uint8List.fromList(utf8.encode('Hello World!')).buffer);
+/// return ByteData.view(Uint8List.fromList(utf8.encode('Hello World!')).buffer);
/// return null;
/// }
/// }
@@ -4676,10 +4676,10 @@
///
/// ```dart
/// await tester.pumpWidget(
-/// new MaterialApp(
-/// home: new DefaultAssetBundle(
-/// bundle: new TestAssetBundle(),
-/// child: new TestWidget(),
+/// MaterialApp(
+/// home: DefaultAssetBundle(
+/// bundle: TestAssetBundle(),
+/// child: TestWidget(),
/// ),
/// ),
/// );
diff --git a/packages/flutter/lib/src/widgets/binding.dart b/packages/flutter/lib/src/widgets/binding.dart
index 5140bfd..5b4d4b2 100644
--- a/packages/flutter/lib/src/widgets/binding.dart
+++ b/packages/flutter/lib/src/widgets/binding.dart
@@ -40,7 +40,7 @@
/// const AppLifecycleReactor({ Key key }) : super(key: key);
///
/// @override
-/// _AppLifecycleReactorState createState() => new _AppLifecycleReactorState();
+/// _AppLifecycleReactorState createState() => _AppLifecycleReactorState();
/// }
///
/// class _AppLifecycleReactorState extends State<AppLifecycleReactor> with WidgetsBindingObserver {
@@ -65,7 +65,7 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new Text('Last notification: $_notification');
+/// return Text('Last notification: $_notification');
/// }
/// }
/// ```
@@ -117,7 +117,7 @@
/// const MetricsReactor({ Key key }) : super(key: key);
///
/// @override
- /// _MetricsReactorState createState() => new _MetricsReactorState();
+ /// _MetricsReactorState createState() => _MetricsReactorState();
/// }
///
/// class _MetricsReactorState extends State<MetricsReactor> with WidgetsBindingObserver {
@@ -142,7 +142,7 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new Text('Current size: $_lastSize');
+ /// return Text('Current size: $_lastSize');
/// }
/// }
/// ```
@@ -172,7 +172,7 @@
/// const TextScaleFactorReactor({ Key key }) : super(key: key);
///
/// @override
- /// _TextScaleFactorReactorState createState() => new _TextScaleFactorReactorState();
+ /// _TextScaleFactorReactorState createState() => _TextScaleFactorReactorState();
/// }
///
/// class _TextScaleFactorReactorState extends State<TextScaleFactorReactor> with WidgetsBindingObserver {
@@ -197,7 +197,7 @@
///
/// @override
/// Widget build(BuildContext context) {
- /// return new Text('Current scale factor: $_lastTextScaleFactor');
+ /// return Text('Current scale factor: $_lastTextScaleFactor');
/// }
/// }
/// ```
diff --git a/packages/flutter/lib/src/widgets/container.dart b/packages/flutter/lib/src/widgets/container.dart
index e9b5572..83f71a4 100644
--- a/packages/flutter/lib/src/widgets/container.dart
+++ b/packages/flutter/lib/src/widgets/container.dart
@@ -22,9 +22,9 @@
/// This sample shows a radial gradient that draws a moon on a night sky:
///
/// ```dart
-/// new DecoratedBox(
-/// decoration: new BoxDecoration(
-/// gradient: new RadialGradient(
+/// DecoratedBox(
+/// decoration: BoxDecoration(
+/// gradient: RadialGradient(
/// center: const Alignment(-0.5, -0.6),
/// radius: 0.15,
/// colors: <Color>[
@@ -183,8 +183,8 @@
/// neighboring widgets:
///
/// ```dart
-/// new Center(
-/// child: new Container(
+/// Center(
+/// child: Container(
/// margin: const EdgeInsets.all(10.0),
/// color: const Color(0xFF00FF00),
/// width: 48.0,
@@ -203,21 +203,21 @@
/// entire contraption to complete the effect.
///
/// ```dart
-/// new Container(
-/// constraints: new BoxConstraints.expand(
+/// Container(
+/// constraints: BoxConstraints.expand(
/// height: Theme.of(context).textTheme.display1.fontSize * 1.1 + 200.0,
/// ),
/// padding: const EdgeInsets.all(8.0),
/// color: Colors.teal.shade700,
/// alignment: Alignment.center,
-/// child: new Text('Hello World', style: Theme.of(context).textTheme.display1.copyWith(color: Colors.white)),
-/// foregroundDecoration: new BoxDecoration(
-/// image: new DecorationImage(
-/// image: new NetworkImage('https://www.example.com/images/frame.png'),
-/// centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0),
+/// child: Text('Hello World', style: Theme.of(context).textTheme.display1.copyWith(color: Colors.white)),
+/// foregroundDecoration: BoxDecoration(
+/// image: DecorationImage(
+/// image: NetworkImage('https://www.example.com/images/frame.png'),
+/// centerSlice: Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0),
/// ),
/// ),
-/// transform: new Matrix4.rotationZ(0.1),
+/// transform: Matrix4.rotationZ(0.1),
/// )
/// ```
///
diff --git a/packages/flutter/lib/src/widgets/fade_in_image.dart b/packages/flutter/lib/src/widgets/fade_in_image.dart
index d6683ab..19cf709 100644
--- a/packages/flutter/lib/src/widgets/fade_in_image.dart
+++ b/packages/flutter/lib/src/widgets/fade_in_image.dart
@@ -52,10 +52,10 @@
/// ## Sample code
///
/// ```dart
-/// new FadeInImage(
+/// FadeInImage(
/// // here `bytes` is a Uint8List containing the bytes for the in-memory image
-/// placeholder: new MemoryImage(bytes),
-/// image: new NetworkImage('https://backend.example.com/image.png'),
+/// placeholder: MemoryImage(bytes),
+/// image: NetworkImage('https://backend.example.com/image.png'),
/// )
/// ```
class FadeInImage extends StatefulWidget {
diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart
index 12e2802..eabee87 100644
--- a/packages/flutter/lib/src/widgets/framework.dart
+++ b/packages/flutter/lib/src/widgets/framework.dart
@@ -508,7 +508,7 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new Container(color: const Color(0xFF2DBD3A));
+/// return Container(color: const Color(0xFF2DBD3A));
/// }
/// }
/// ```
@@ -531,7 +531,7 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new Container(color: color, child: child);
+/// return Container(color: color, child: child);
/// }
/// }
/// ```
@@ -714,13 +714,13 @@
/// const YellowBird({ Key key }) : super(key: key);
///
/// @override
-/// _YellowBirdState createState() => new _YellowBirdState();
+/// _YellowBirdState createState() => _YellowBirdState();
/// }
///
/// class _YellowBirdState extends State<YellowBird> {
/// @override
/// Widget build(BuildContext context) {
-/// return new Container(color: const Color(0xFFFFE306));
+/// return Container(color: const Color(0xFFFFE306));
/// }
/// }
/// ```
@@ -745,7 +745,7 @@
///
/// final Widget child;
///
-/// _BirdState createState() => new _BirdState();
+/// _BirdState createState() => _BirdState();
/// }
///
/// class _BirdState extends State<Bird> {
@@ -757,9 +757,9 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new Container(
+/// return Container(
/// color: widget.color,
-/// transform: new Matrix4.diagonal3Values(_size, _size, 1.0),
+/// transform: Matrix4.diagonal3Values(_size, _size, 1.0),
/// child: widget.child,
/// );
/// }
@@ -795,7 +795,7 @@
///
/// ```dart
/// @override
- /// _MyState createState() => new _MyState();
+ /// _MyState createState() => _MyState();
/// ```
///
/// The framework can call this method multiple times over the lifetime of
@@ -1082,7 +1082,7 @@
/// });
/// Directory directory = await getApplicationDocumentsDirectory();
/// final String dirName = directory.path;
- /// await new File('$dir/counter.txt').writeAsString('$_counter');
+ /// await File('$dir/counter.txt').writeAsString('$_counter');
/// return null;
/// }
/// ```
@@ -1790,16 +1790,16 @@
/// @override
/// Widget build(BuildContext context) {
/// // here, Scaffold.of(context) returns null
-/// return new Scaffold(
-/// appBar: new AppBar(title: new Text('Demo')),
-/// body: new Builder(
+/// return Scaffold(
+/// appBar: AppBar(title: Text('Demo')),
+/// body: Builder(
/// builder: (BuildContext context) {
-/// return new FlatButton(
-/// child: new Text('BUTTON'),
+/// return FlatButton(
+/// child: Text('BUTTON'),
/// onPressed: () {
/// // here, Scaffold.of(context) returns the locally created Scaffold
-/// Scaffold.of(context).showSnackBar(new SnackBar(
-/// content: new Text('Hello.')
+/// Scaffold.of(context).showSnackBar(SnackBar(
+/// content: Text('Hello.')
/// ));
/// }
/// );
diff --git a/packages/flutter/lib/src/widgets/gesture_detector.dart b/packages/flutter/lib/src/widgets/gesture_detector.dart
index 189e1fa..2e8268f 100644
--- a/packages/flutter/lib/src/widgets/gesture_detector.dart
+++ b/packages/flutter/lib/src/widgets/gesture_detector.dart
@@ -114,13 +114,13 @@
/// `_lights` field:
///
/// ```dart
-/// new GestureDetector(
+/// GestureDetector(
/// onTap: () {
/// setState(() { _lights = true; });
/// },
-/// child: new Container(
+/// child: Container(
/// color: Colors.yellow,
-/// child: new Text('TURN LIGHTS ON'),
+/// child: Text('TURN LIGHTS ON'),
/// ),
/// )
/// ```
@@ -450,10 +450,10 @@
/// then displayed as the child of the gesture detector.
///
/// ```dart
-/// new RawGestureDetector(
+/// RawGestureDetector(
/// gestures: <Type, GestureRecognizerFactory>{
-/// TapGestureRecognizer: new GestureRecognizerFactoryWithHandlers<TapGestureRecognizer>(
-/// () => new TapGestureRecognizer(),
+/// TapGestureRecognizer: GestureRecognizerFactoryWithHandlers<TapGestureRecognizer>(
+/// () => TapGestureRecognizer(),
/// (TapGestureRecognizer instance) {
/// instance
/// ..onTapDown = (TapDownDetails details) { setState(() { _last = 'down'; }); }
@@ -463,7 +463,7 @@
/// },
/// ),
/// },
-/// child: new Container(width: 300.0, height: 300.0, color: Colors.yellow, child: new Text(_last)),
+/// child: Container(width: 300.0, height: 300.0, color: Colors.yellow, child: Text(_last)),
/// )
/// ```
///
diff --git a/packages/flutter/lib/src/widgets/icon.dart b/packages/flutter/lib/src/widgets/icon.dart
index 03eed58..d876dba 100644
--- a/packages/flutter/lib/src/widgets/icon.dart
+++ b/packages/flutter/lib/src/widgets/icon.dart
@@ -79,7 +79,7 @@
/// Typically, a material design color will be used, as follows:
///
/// ```dart
- /// new Icon(
+ /// Icon(
/// icon: Icons.widgets,
/// color: Colors.blue.shade400,
/// ),
diff --git a/packages/flutter/lib/src/widgets/image.dart b/packages/flutter/lib/src/widgets/image.dart
index f645b3e..dc9d74a 100644
--- a/packages/flutter/lib/src/widgets/image.dart
+++ b/packages/flutter/lib/src/widgets/image.dart
@@ -286,7 +286,7 @@
/// render the `images/2x/cat.png` file:
///
/// ```dart
- /// new Image.asset('images/cat.png')
+ /// Image.asset('images/cat.png')
/// ```
///
/// This corresponds to the file that is in the project's `images/2x/`
@@ -311,7 +311,7 @@
/// Then to display the image, use:
///
/// ```dart
- /// new Image.asset('icons/heart.png', package: 'my_icons')
+ /// Image.asset('icons/heart.png', package: 'my_icons')
/// ```
///
/// Assets used by the package itself should also be displayed using the
diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart
index 7c86e4a..e1bbeec 100644
--- a/packages/flutter/lib/src/widgets/implicit_animations.dart
+++ b/packages/flutter/lib/src/widgets/implicit_animations.dart
@@ -1023,7 +1023,7 @@
/// ```dart
/// class LogoFade extends StatefulWidget {
/// @override
-/// createState() => new LogoFadeState();
+/// createState() => LogoFadeState();
/// }
///
/// class LogoFadeState extends State<LogoFade> {
@@ -1035,16 +1035,16 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new Column(
+/// return Column(
/// mainAxisAlignment: MainAxisAlignment.center,
/// children: [
-/// new AnimatedOpacity(
+/// AnimatedOpacity(
/// opacity: opacityLevel,
-/// duration: new Duration(seconds: 3),
-/// child: new FlutterLogo(),
+/// duration: Duration(seconds: 3),
+/// child: FlutterLogo(),
/// ),
-/// new RaisedButton(
-/// child: new Text('Fade Logo'),
+/// RaisedButton(
+/// child: Text('Fade Logo'),
/// onPressed: _changeOpacity,
/// ),
/// ],
diff --git a/packages/flutter/lib/src/widgets/localizations.dart b/packages/flutter/lib/src/widgets/localizations.dart
index 81a1f87..ecebc52 100644
--- a/packages/flutter/lib/src/widgets/localizations.dart
+++ b/packages/flutter/lib/src/widgets/localizations.dart
@@ -309,7 +309,7 @@
/// static Future<MyLocalizations> load(Locale locale) {
/// return initializeMessages(locale.toString())
/// .then((Null _) {
-/// return new MyLocalizations(locale);
+/// return MyLocalizations(locale);
/// });
/// }
///
@@ -354,7 +354,7 @@
///
/// ```dart
/// Widget build(BuildContext context) {
- /// return new Localizations.override(
+ /// return Localizations.override(
/// context: context,
/// locale: const Locale('en', 'US'),
/// child: myWidget,
diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart
index 65798a4..b720bee 100644
--- a/packages/flutter/lib/src/widgets/navigator.dart
+++ b/packages/flutter/lib/src/widgets/navigator.dart
@@ -388,7 +388,7 @@
///
/// ```dart
/// void main() {
-/// runApp(new MaterialApp(home: new MyAppHome()));
+/// runApp(MaterialApp(home: MyAppHome()));
/// }
/// ```
///
@@ -397,13 +397,13 @@
/// want to appear on the screen. For example:
///
/// ```dart
-/// Navigator.push(context, new MaterialPageRoute<void>(
+/// Navigator.push(context, MaterialPageRoute<void>(
/// builder: (BuildContext context) {
-/// return new Scaffold(
-/// appBar: new AppBar(title: new Text('My Page')),
-/// body: new Center(
-/// child: new FlatButton(
-/// child: new Text('POP'),
+/// return Scaffold(
+/// appBar: AppBar(title: Text('My Page')),
+/// body: Center(
+/// child: FlatButton(
+/// child: Text('POP'),
/// onPressed: () {
/// Navigator.pop(context);
/// },
@@ -445,12 +445,12 @@
///
/// ```dart
/// void main() {
-/// runApp(new MaterialApp(
-/// home: new MyAppHome(), // becomes the route named '/'
+/// runApp(MaterialApp(
+/// home: MyAppHome(), // becomes the route named '/'
/// routes: <String, WidgetBuilder> {
-/// '/a': (BuildContext context) => new MyPage(title: 'page A'),
-/// '/b': (BuildContext context) => new MyPage(title: 'page B'),
-/// '/c': (BuildContext context) => new MyPage(title: 'page C'),
+/// '/a': (BuildContext context) => MyPage(title: 'page A'),
+/// '/b': (BuildContext context) => MyPage(title: 'page B'),
+/// '/c': (BuildContext context) => MyPage(title: 'page C'),
/// },
/// ));
/// }
@@ -475,11 +475,11 @@
/// operation we could `await` the result of [Navigator.push]:
///
/// ```dart
-/// bool value = await Navigator.push(context, new MaterialPageRoute<bool>(
+/// bool value = await Navigator.push(context, MaterialPageRoute<bool>(
/// builder: (BuildContext context) {
-/// return new Center(
-/// child: new GestureDetector(
-/// child: new Text('OK'),
+/// return Center(
+/// child: GestureDetector(
+/// child: Text('OK'),
/// onTap: () { Navigator.pop(context, true); }
/// ),
/// );
@@ -527,16 +527,16 @@
/// screen because it specifies `opaque: false`, just as a popup route does.
///
/// ```dart
-/// Navigator.push(context, new PageRouteBuilder(
+/// Navigator.push(context, PageRouteBuilder(
/// opaque: false,
/// pageBuilder: (BuildContext context, _, __) {
-/// return new Center(child: new Text('My PageRoute'));
+/// return Center(child: Text('My PageRoute'));
/// },
/// transitionsBuilder: (___, Animation<double> animation, ____, Widget child) {
-/// return new FadeTransition(
+/// return FadeTransition(
/// opacity: animation,
-/// child: new RotationTransition(
-/// turns: new Tween<double>(begin: 0.5, end: 1.0).animate(animation),
+/// child: RotationTransition(
+/// turns: Tween<double>(begin: 0.5, end: 1.0).animate(animation),
/// child: child,
/// ),
/// );
@@ -588,13 +588,13 @@
/// class MyApp extends StatelessWidget {
/// @override
/// Widget build(BuildContext context) {
-/// return new MaterialApp(
+/// return MaterialApp(
/// // ...some parameters omitted...
/// // MaterialApp contains our top-level Navigator
/// initialRoute: '/',
/// routes: {
-/// '/': (BuildContext context) => new HomePage(),
-/// '/signup': (BuildContext context) => new SignUpPage(),
+/// '/': (BuildContext context) => HomePage(),
+/// '/signup': (BuildContext context) => SignUpPage(),
/// },
/// );
/// }
@@ -605,7 +605,7 @@
/// Widget build(BuildContext context) {
/// // SignUpPage builds its own Navigator which ends up being a nested
/// // Navigator in our app.
-/// return new Navigator(
+/// return Navigator(
/// initialRoute: 'signup/personal_info',
/// onGenerateRoute: (RouteSettings settings) {
/// WidgetBuilder builder;
@@ -613,12 +613,12 @@
/// case 'signup/personal_info':
/// // Assume CollectPersonalInfoPage collects personal info and then
/// // navigates to 'signup/choose_credentials'.
-/// builder = (BuildContext _) => new CollectPersonalInfoPage();
+/// builder = (BuildContext _) => CollectPersonalInfoPage();
/// break;
/// case 'signup/choose_credentials':
/// // Assume ChooseCredentialsPage collects new credentials and then
/// // invokes 'onSignupComplete()'.
-/// builder = (BuildContext _) => new ChooseCredentialsPage(
+/// builder = (BuildContext _) => ChooseCredentialsPage(
/// onSignupComplete: () {
/// // Referencing Navigator.of(context) from here refers to the
/// // top level Navigator because SignUpPage is above the
@@ -630,9 +630,9 @@
/// );
/// break;
/// default:
-/// throw new Exception('Invalid route: ${settings.name}');
+/// throw Exception('Invalid route: ${settings.name}');
/// }
-/// return new MaterialPageRoute(builder: builder, settings: settings);
+/// return MaterialPageRoute(builder: builder, settings: settings);
/// },
/// );
/// }
@@ -901,7 +901,7 @@
///
/// ```dart
/// void _openMyPage() {
- /// Navigator.push(context, new MaterialPageRoute(builder: (BuildContext context) => new MyPage()));
+ /// Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => MyPage()));
/// }
/// ```
@optionalTypeArgs
@@ -944,7 +944,7 @@
/// ```dart
/// void _completeLogin() {
/// Navigator.pushReplacement(
- /// context, new MaterialPageRoute(builder: (BuildContext context) => new MyHomePage()));
+ /// context, MaterialPageRoute(builder: (BuildContext context) => MyHomePage()));
/// }
/// ```
@optionalTypeArgs
@@ -995,7 +995,7 @@
/// void _finishAccountCreation() {
/// Navigator.pushAndRemoveUntil(
/// context,
- /// new MaterialPageRoute(builder: (BuildContext context) => new MyHomePage()),
+ /// MaterialPageRoute(builder: (BuildContext context) => MyHomePage()),
/// ModalRoute.withName('/'),
/// );
/// }
@@ -1523,7 +1523,7 @@
///
/// ```dart
/// void _openPage() {
- /// navigator.push(new MaterialPageRoute(builder: (BuildContext context) => new MyPage()));
+ /// navigator.push(MaterialPageRoute(builder: (BuildContext context) => MyPage()));
/// }
/// ```
@optionalTypeArgs
@@ -1562,7 +1562,7 @@
/// ```dart
/// void _doOpenPage() {
/// navigator.pushReplacement(
- /// new MaterialPageRoute(builder: (BuildContext context) => new MyHomePage()));
+ /// MaterialPageRoute(builder: (BuildContext context) => MyHomePage()));
/// }
/// ```
@optionalTypeArgs
@@ -1613,7 +1613,7 @@
/// ```dart
/// void _resetAndOpenPage() {
/// navigator.pushAndRemoveUntil(
- /// new MaterialPageRoute(builder: (BuildContext context) => new MyHomePage()),
+ /// MaterialPageRoute(builder: (BuildContext context) => MyHomePage()),
/// ModalRoute.withName('/'),
/// );
/// }
diff --git a/packages/flutter/lib/src/widgets/nested_scroll_view.dart b/packages/flutter/lib/src/widgets/nested_scroll_view.dart
index 3d93c16..3f373bb 100644
--- a/packages/flutter/lib/src/widgets/nested_scroll_view.dart
+++ b/packages/flutter/lib/src/widgets/nested_scroll_view.dart
@@ -75,13 +75,13 @@
/// data model being represented.
///
/// ```dart
-/// new DefaultTabController(
+/// DefaultTabController(
/// length: _tabs.length, // This is the number of tabs.
-/// child: new NestedScrollView(
+/// child: NestedScrollView(
/// headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
/// // These are the slivers that show up in the "outer" scroll view.
/// return <Widget>[
-/// new SliverOverlapAbsorber(
+/// SliverOverlapAbsorber(
/// // This widget takes the overlapping behavior of the SliverAppBar,
/// // and redirects it to the SliverOverlapInjector below. If it is
/// // missing, then it is possible for the nested "inner" scroll view
@@ -90,7 +90,7 @@
/// // This is not necessary if the "headerSliverBuilder" only builds
/// // widgets that do not overlap the next sliver.
/// handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
-/// child: new SliverAppBar(
+/// child: SliverAppBar(
/// title: const Text('Books'), // This is the title in the app bar.
/// pinned: true,
/// expandedHeight: 150.0,
@@ -103,26 +103,26 @@
/// // not actually aware of the precise position of the inner
/// // scroll views.
/// forceElevated: innerBoxIsScrolled,
-/// bottom: new TabBar(
+/// bottom: TabBar(
/// // These are the widgets to put in each tab in the tab bar.
-/// tabs: _tabs.map((String name) => new Tab(text: name)).toList(),
+/// tabs: _tabs.map((String name) => Tab(text: name)).toList(),
/// ),
/// ),
/// ),
/// ];
/// },
-/// body: new TabBarView(
+/// body: TabBarView(
/// // These are the contents of the tab views, below the tabs.
/// children: _tabs.map((String name) {
-/// return new SafeArea(
+/// return SafeArea(
/// top: false,
/// bottom: false,
-/// child: new Builder(
+/// child: Builder(
/// // This Builder is needed to provide a BuildContext that is "inside"
/// // the NestedScrollView, so that sliverOverlapAbsorberHandleFor() can
/// // find the NestedScrollView.
/// builder: (BuildContext context) {
-/// return new CustomScrollView(
+/// return CustomScrollView(
/// // The "controller" and "primary" members should be left
/// // unset, so that the NestedScrollView can control this
/// // inner scroll view.
@@ -131,29 +131,29 @@
/// // The PageStorageKey should be unique to this ScrollView;
/// // it allows the list to remember its scroll position when
/// // the tab view is not on the screen.
-/// key: new PageStorageKey<String>(name),
+/// key: PageStorageKey<String>(name),
/// slivers: <Widget>[
-/// new SliverOverlapInjector(
+/// SliverOverlapInjector(
/// // This is the flip side of the SliverOverlapAbsorber above.
/// handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
/// ),
-/// new SliverPadding(
+/// SliverPadding(
/// padding: const EdgeInsets.all(8.0),
/// // In this example, the inner scroll view has
/// // fixed-height list items, hence the use of
/// // SliverFixedExtentList. However, one could use any
/// // sliver widget here, e.g. SliverList or SliverGrid.
-/// sliver: new SliverFixedExtentList(
+/// sliver: SliverFixedExtentList(
/// // The items in this example are fixed to 48 pixels
/// // high. This matches the Material Design spec for
/// // ListTile widgets.
/// itemExtent: 48.0,
-/// delegate: new SliverChildBuilderDelegate(
+/// delegate: SliverChildBuilderDelegate(
/// (BuildContext context, int index) {
/// // This builder is called for each child.
/// // In this example, we just number each list item.
-/// return new ListTile(
-/// title: new Text('Item $index'),
+/// return ListTile(
+/// title: Text('Item $index'),
/// );
/// },
/// // The childCount of the SliverChildBuilderDelegate
diff --git a/packages/flutter/lib/src/widgets/page_storage.dart b/packages/flutter/lib/src/widgets/page_storage.dart
index 66058a6..ca5f331 100644
--- a/packages/flutter/lib/src/widgets/page_storage.dart
+++ b/packages/flutter/lib/src/widgets/page_storage.dart
@@ -22,10 +22,10 @@
/// tabs' string labels.
///
/// ```dart
-/// new TabBarView(
+/// TabBarView(
/// children: myTabs.map((Tab tab) {
-/// new MyScrollableTabView(
-/// key: new PageStorageKey<String>(tab.text), // like 'Tab 1'
+/// MyScrollableTabView(
+/// key: PageStorageKey<String>(tab.text), // like 'Tab 1'
/// tab: tab,
/// ),
/// }),
diff --git a/packages/flutter/lib/src/widgets/platform_view.dart b/packages/flutter/lib/src/widgets/platform_view.dart
index d52e539..800e880 100644
--- a/packages/flutter/lib/src/widgets/platform_view.dart
+++ b/packages/flutter/lib/src/widgets/platform_view.dart
@@ -37,7 +37,7 @@
///
/// ```java
/// public static void registerWith(Registrar registrar) {
-/// registrar.platformViewRegistry().registerViewFactory("webview", new WebViewFactory(registrar.messenger()));
+/// registrar.platformViewRegistry().registerViewFactory("webview", WebViewFactory(registrar.messenger()));
/// }
/// ```
///
diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart
index ced0c30..cbfb815 100644
--- a/packages/flutter/lib/src/widgets/routes.dart
+++ b/packages/flutter/lib/src/widgets/routes.dart
@@ -341,11 +341,11 @@
/// class App extends StatelessWidget {
/// @override
/// Widget build(BuildContext context) {
- /// return new MaterialApp(
+ /// return MaterialApp(
/// initialRoute: '/',
/// routes: {
- /// '/': (BuildContext context) => new HomePage(),
- /// '/second_page': (BuildContext context) => new SecondPage(),
+ /// '/': (BuildContext context) => HomePage(),
+ /// '/second_page': (BuildContext context) => SecondPage(),
/// },
/// );
/// }
@@ -355,21 +355,21 @@
/// HomePage();
///
/// @override
- /// _HomePageState createState() => new _HomePageState();
+ /// _HomePageState createState() => _HomePageState();
/// }
///
/// class _HomePageState extends State<HomePage> {
/// @override
/// Widget build(BuildContext context) {
- /// return new Scaffold(
- /// body: new Center(
+ /// return Scaffold(
+ /// body: Center(
/// child: Column(
/// mainAxisSize: MainAxisSize.min,
/// children: <Widget>[
- /// new Text('HomePage'),
+ /// Text('HomePage'),
/// // Press this button to open the SecondPage.
- /// new RaisedButton(
- /// child: new Text('Second Page >'),
+ /// RaisedButton(
+ /// child: Text('Second Page >'),
/// onPressed: () {
/// Navigator.pushNamed(context, '/second_page');
/// },
@@ -383,7 +383,7 @@
///
/// class SecondPage extends StatefulWidget {
/// @override
- /// _SecondPageState createState() => new _SecondPageState();
+ /// _SecondPageState createState() => _SecondPageState();
/// }
///
/// class _SecondPageState extends State<SecondPage> {
@@ -396,7 +396,7 @@
/// // rectangle.
/// setState(() => _showRectangle = true);
/// ModalRoute.of(context).addLocalHistoryEntry(
- /// new LocalHistoryEntry(
+ /// LocalHistoryEntry(
/// onRemove: () {
/// // Hide the red rectangle.
/// setState(() => _showRectangle = false);
@@ -408,24 +408,24 @@
/// @override
/// Widget build(BuildContext context) {
/// final localNavContent = _showRectangle
- /// ? new Container(
+ /// ? Container(
/// width: 100.0,
/// height: 100.0,
/// color: Colors.red,
/// )
- /// : new RaisedButton(
- /// child: new Text('Show Rectangle'),
+ /// : RaisedButton(
+ /// child: Text('Show Rectangle'),
/// onPressed: _navigateLocallyToShowRectangle,
/// );
///
- /// return new Scaffold(
+ /// return Scaffold(
/// body: Center(
- /// child: new Column(
+ /// child: Column(
/// mainAxisAlignment: MainAxisAlignment.center,
/// children: <Widget>[
/// localNavContent,
- /// new RaisedButton(
- /// child: new Text('< Back'),
+ /// RaisedButton(
+ /// child: Text('< Back'),
/// onPressed: () {
/// // Pop a route. If this is pressed while the red rectangle is
/// // visible then it will will pop our local history entry, which
@@ -751,16 +751,16 @@
/// route from the top of the screen back to the bottom.
///
/// ```dart
- /// new PageRouteBuilder(
+ /// PageRouteBuilder(
/// pageBuilder: (BuildContext context,
/// Animation<double> animation,
/// Animation<double> secondaryAnimation,
/// Widget child,
/// ) {
- /// return new Scaffold(
- /// appBar: new AppBar(title: new Text('Hello')),
- /// body: new Center(
- /// child: new Text('Hello World'),
+ /// return Scaffold(
+ /// appBar: AppBar(title: Text('Hello')),
+ /// body: Center(
+ /// child: Text('Hello World'),
/// ),
/// );
/// },
@@ -770,8 +770,8 @@
/// Animation<double> secondaryAnimation,
/// Widget child,
/// ) {
- /// return new SlideTransition(
- /// position: new Tween<Offset>(
+ /// return SlideTransition(
+ /// position: Tween<Offset>(
/// begin: const Offset(0.0, 1.0),
/// end: Offset.zero,
/// ).animate(animation),
@@ -807,13 +807,13 @@
/// Animation<double> secondaryAnimation,
/// Widget child,
/// ) {
- /// return new SlideTransition(
- /// position: new AlignmentTween(
+ /// return SlideTransition(
+ /// position: AlignmentTween(
/// begin: const Offset(0.0, 1.0),
/// end: Offset.zero,
/// ).animate(animation),
- /// child: new SlideTransition(
- /// position: new TweenOffset(
+ /// child: SlideTransition(
+ /// position: TweenOffset(
/// begin: Offset.zero,
/// end: const Offset(0.0, 1.0),
/// ).animate(secondaryAnimation),
@@ -1049,7 +1049,7 @@
///
/// ```dart
/// Widget build(BuildContext context) {
- /// return new WillPopScope(
+ /// return WillPopScope(
/// onWillPop: askTheUserIfTheyAreSure,
/// child: ...,
/// );
@@ -1271,16 +1271,16 @@
///
/// ```dart
/// // Register the RouteObserver as a navigation observer.
-/// final RouteObserver<PageRoute> routeObserver = new RouteObserver<PageRoute>();
+/// final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();
/// void main() {
-/// runApp(new MaterialApp(
-/// home: new Container(),
+/// runApp(MaterialApp(
+/// home: Container(),
/// navigatorObservers: [routeObserver],
/// ));
/// }
///
/// class RouteAwareWidget extends StatefulWidget {
-/// State<RouteAwareWidget> createState() => new RouteAwareWidgetState();
+/// State<RouteAwareWidget> createState() => RouteAwareWidgetState();
/// }
///
/// // Implement RouteAware in a widget's state and subscribe it to the RouteObserver.
@@ -1309,7 +1309,7 @@
/// }
///
/// @override
-/// Widget build(BuildContext context) => new Container();
+/// Widget build(BuildContext context) => Container();
///
/// }
/// ```
diff --git a/packages/flutter/lib/src/widgets/scroll_controller.dart b/packages/flutter/lib/src/widgets/scroll_controller.dart
index d87ab68..a20aa60 100644
--- a/packages/flutter/lib/src/widgets/scroll_controller.dart
+++ b/packages/flutter/lib/src/widgets/scroll_controller.dart
@@ -291,19 +291,19 @@
/// the different list lengths.
///
/// ```dart
-/// new PageView(
+/// PageView(
/// children: <Widget>[
-/// new ListView(
+/// ListView(
/// controller: _trackingScrollController,
-/// children: new List<Widget>.generate(100, (int i) => new Text('page 0 item $i')).toList(),
+/// children: List<Widget>.generate(100, (int i) => Text('page 0 item $i')).toList(),
/// ),
-/// new ListView(
+/// ListView(
/// controller: _trackingScrollController,
-/// children: new List<Widget>.generate(200, (int i) => new Text('page 1 item $i')).toList(),
+/// children: List<Widget>.generate(200, (int i) => Text('page 1 item $i')).toList(),
/// ),
-/// new ListView(
+/// ListView(
/// controller: _trackingScrollController,
-/// children: new List<Widget>.generate(300, (int i) => new Text('page 2 item $i')).toList(),
+/// children: List<Widget>.generate(300, (int i) => Text('page 2 item $i')).toList(),
/// ),
/// ],
/// )
diff --git a/packages/flutter/lib/src/widgets/scroll_physics.dart b/packages/flutter/lib/src/widgets/scroll_physics.dart
index d009205..8ba89fc 100644
--- a/packages/flutter/lib/src/widgets/scroll_physics.dart
+++ b/packages/flutter/lib/src/widgets/scroll_physics.dart
@@ -43,7 +43,7 @@
/// This method is typically used to define [applyTo] methods like:
/// ```dart
/// FooScrollPhysics applyTo(ScrollPhysics ancestor) {
- /// return new FooScrollPhysics(parent: buildParent(ancestor));
+ /// return FooScrollPhysics(parent: buildParent(ancestor));
/// }
/// ```
@protected
diff --git a/packages/flutter/lib/src/widgets/scroll_view.dart b/packages/flutter/lib/src/widgets/scroll_view.dart
index 3d60758..f73af56 100644
--- a/packages/flutter/lib/src/widgets/scroll_view.dart
+++ b/packages/flutter/lib/src/widgets/scroll_view.dart
@@ -274,7 +274,7 @@
/// bar, a grid, and an infinite list.
///
/// ```dart
-/// new CustomScrollView(
+/// CustomScrollView(
/// slivers: <Widget>[
/// const SliverAppBar(
/// pinned: true,
@@ -283,32 +283,32 @@
/// title: Text('Demo'),
/// ),
/// ),
-/// new SliverGrid(
-/// gridDelegate: new SliverGridDelegateWithMaxCrossAxisExtent(
+/// SliverGrid(
+/// gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
/// maxCrossAxisExtent: 200.0,
/// mainAxisSpacing: 10.0,
/// crossAxisSpacing: 10.0,
/// childAspectRatio: 4.0,
/// ),
-/// delegate: new SliverChildBuilderDelegate(
+/// delegate: SliverChildBuilderDelegate(
/// (BuildContext context, int index) {
-/// return new Container(
+/// return Container(
/// alignment: Alignment.center,
/// color: Colors.teal[100 * (index % 9)],
-/// child: new Text('grid item $index'),
+/// child: Text('grid item $index'),
/// );
/// },
/// childCount: 20,
/// ),
/// ),
-/// new SliverFixedExtentList(
+/// SliverFixedExtentList(
/// itemExtent: 50.0,
-/// delegate: new SliverChildBuilderDelegate(
+/// delegate: SliverChildBuilderDelegate(
/// (BuildContext context, int index) {
-/// return new Container(
+/// return Container(
/// alignment: Alignment.center,
/// color: Colors.lightBlue[100 * (index % 9)],
-/// child: new Text('list item $index'),
+/// child: Text('list item $index'),
/// );
/// },
/// ),
@@ -488,11 +488,11 @@
/// An infinite list of children:
///
/// ```dart
-/// new ListView.builder(
-/// padding: new EdgeInsets.all(8.0),
+/// ListView.builder(
+/// padding: EdgeInsets.all(8.0),
/// itemExtent: 20.0,
/// itemBuilder: (BuildContext context, int index) {
-/// return new Text('entry $index');
+/// return Text('entry $index');
/// },
/// )
/// ```
@@ -598,7 +598,7 @@
/// [CustomScrollView]:
///
/// ```dart
-/// new ListView(
+/// ListView(
/// shrinkWrap: true,
/// padding: const EdgeInsets.all(20.0),
/// children: <Widget>[
@@ -611,13 +611,13 @@
/// ```
///
/// ```dart
-/// new CustomScrollView(
+/// CustomScrollView(
/// shrinkWrap: true,
/// slivers: <Widget>[
-/// new SliverPadding(
+/// SliverPadding(
/// padding: const EdgeInsets.all(20.0),
-/// sliver: new SliverList(
-/// delegate: new SliverChildListDelegate(
+/// sliver: SliverList(
+/// delegate: SliverChildListDelegate(
/// <Widget>[
/// const Text('I\'m dedicating every day to you'),
/// const Text('Domestic life was never quite my style'),
@@ -774,12 +774,12 @@
/// are separated by [Divider]s.
///
/// ```dart
- /// new ListView.separated(
+ /// ListView.separated(
/// itemCount: 25,
- /// separatorBuilder: (BuildContext context, int index) => new Divider(),
+ /// separatorBuilder: (BuildContext context, int index) => Divider(),
/// itemBuilder: (BuildContext context, int index) {
- /// return new ListTile(
- /// title: new Text('item $index'),
+ /// return ListTile(
+ /// title: Text('item $index'),
/// );
/// },
/// )
@@ -970,7 +970,7 @@
/// [CustomScrollView]:
///
/// ```dart
-/// new GridView.count(
+/// GridView.count(
/// primary: false,
/// padding: const EdgeInsets.all(20.0),
/// crossAxisSpacing: 10.0,
@@ -987,12 +987,12 @@
/// ```
///
/// ```dart
-/// new CustomScrollView(
+/// CustomScrollView(
/// primary: false,
/// slivers: <Widget>[
-/// new SliverPadding(
+/// SliverPadding(
/// padding: const EdgeInsets.all(20.0),
-/// sliver: new SliverGrid.count(
+/// sliver: SliverGrid.count(
/// crossAxisSpacing: 10.0,
/// crossAxisCount: 2,
/// children: <Widget>[
diff --git a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart
index 4e64d34..f7f614a 100644
--- a/packages/flutter/lib/src/widgets/single_child_scroll_view.dart
+++ b/packages/flutter/lib/src/widgets/single_child_scroll_view.dart
@@ -83,23 +83,23 @@
/// more room, in which case they stack vertically and scroll.
///
/// ```dart
-/// new LayoutBuilder(
+/// LayoutBuilder(
/// builder: (BuildContext context, BoxConstraints viewportConstraints) {
/// return SingleChildScrollView(
-/// child: new ConstrainedBox(
-/// constraints: new BoxConstraints(
+/// child: ConstrainedBox(
+/// constraints: BoxConstraints(
/// minHeight: viewportConstraints.maxHeight,
/// ),
-/// child: new Column(
+/// child: Column(
/// mainAxisSize: MainAxisSize.min,
/// mainAxisAlignment: MainAxisAlignment.spaceAround,
/// children: <Widget>[
-/// new Container(
+/// Container(
/// // A fixed-height child.
/// color: Colors.yellow,
/// height: 120.0,
/// ),
-/// new Container(
+/// Container(
/// // Another fixed-height child.
/// color: Colors.green,
/// height: 120.0,
@@ -135,25 +135,25 @@
/// in an [Expanded] widget.
///
/// ```dart
-/// new LayoutBuilder(
+/// LayoutBuilder(
/// builder: (BuildContext context, BoxConstraints viewportConstraints) {
/// return SingleChildScrollView(
-/// child: new ConstrainedBox(
-/// constraints: new BoxConstraints(
+/// child: ConstrainedBox(
+/// constraints: BoxConstraints(
/// minHeight: viewportConstraints.maxHeight,
/// ),
-/// child: new IntrinsicHeight(
-/// child: new Column(
+/// child: IntrinsicHeight(
+/// child: Column(
/// children: <Widget>[
-/// new Container(
+/// Container(
/// // A fixed-height child.
/// color: Colors.yellow,
/// height: 120.0,
/// ),
-/// new Expanded(
+/// Expanded(
/// // A flexible child that will grow to fit the viewport but
/// // still be at least as big as necessary to fit its contents.
-/// child: new Container(
+/// child: Container(
/// color: Colors.blue,
/// height: 120.0,
/// ),
diff --git a/packages/flutter/lib/src/widgets/sliver.dart b/packages/flutter/lib/src/widgets/sliver.dart
index 95bc33f..ae5a61b 100644
--- a/packages/flutter/lib/src/widgets/sliver.dart
+++ b/packages/flutter/lib/src/widgets/sliver.dart
@@ -486,14 +486,14 @@
/// list, shows an infinite number of items in varying shades of blue:
///
/// ```dart
-/// new SliverFixedExtentList(
+/// SliverFixedExtentList(
/// itemExtent: 50.0,
-/// delegate: new SliverChildBuilderDelegate(
+/// delegate: SliverChildBuilderDelegate(
/// (BuildContext context, int index) {
-/// return new Container(
+/// return Container(
/// alignment: Alignment.center,
/// color: Colors.lightBlue[100 * (index % 9)],
-/// child: new Text('list item $index'),
+/// child: Text('list item $index'),
/// );
/// },
/// ),
@@ -550,19 +550,19 @@
/// list, shows twenty boxes in a pretty teal grid:
///
/// ```dart
-/// new SliverGrid(
-/// gridDelegate: new SliverGridDelegateWithMaxCrossAxisExtent(
+/// SliverGrid(
+/// gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
/// maxCrossAxisExtent: 200.0,
/// mainAxisSpacing: 10.0,
/// crossAxisSpacing: 10.0,
/// childAspectRatio: 4.0,
/// ),
-/// delegate: new SliverChildBuilderDelegate(
+/// delegate: SliverChildBuilderDelegate(
/// (BuildContext context, int index) {
-/// return new Container(
+/// return Container(
/// alignment: Alignment.center,
/// color: Colors.teal[100 * (index % 9)],
-/// child: new Text('grid item $index'),
+/// child: Text('grid item $index'),
/// );
/// },
/// childCount: 20,
diff --git a/packages/flutter/lib/src/widgets/spacer.dart b/packages/flutter/lib/src/widgets/spacer.dart
index 7a4de12..6c64009 100644
--- a/packages/flutter/lib/src/widgets/spacer.dart
+++ b/packages/flutter/lib/src/widgets/spacer.dart
@@ -20,14 +20,14 @@
/// ## Sample code
///
/// ```dart
-/// new Row(
+/// Row(
/// children: <Widget>[
-/// new Text('Begin'),
-/// new Spacer(), // Defaults to a flex of one.
-/// new Text('Middle'),
+/// Text('Begin'),
+/// Spacer(), // Defaults to a flex of one.
+/// Text('Middle'),
/// // Gives twice the space between Middle and End than Begin and Middle.
-/// new Spacer(flex: 2),
-/// new Text('End'),
+/// Spacer(flex: 2),
+/// Text('End'),
/// ],
/// )
/// ```
diff --git a/packages/flutter/lib/src/widgets/text.dart b/packages/flutter/lib/src/widgets/text.dart
index 0a22590..77632fb 100644
--- a/packages/flutter/lib/src/widgets/text.dart
+++ b/packages/flutter/lib/src/widgets/text.dart
@@ -167,11 +167,11 @@
/// ## Sample code
///
/// ```dart
-/// new Text(
+/// Text(
/// 'Hello, $_name! How are you?',
/// textAlign: TextAlign.center,
/// overflow: TextOverflow.ellipsis,
-/// style: new TextStyle(fontWeight: FontWeight.bold),
+/// style: TextStyle(fontWeight: FontWeight.bold),
/// )
/// ```
///
@@ -331,7 +331,7 @@
/// text value:
///
/// ```dart
- /// new Text(r'$$', semanticsLabel: 'Double dollars')
+ /// Text(r'$$', semanticsLabel: 'Double dollars')
///
/// ```
final String semanticsLabel;
diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart
index 66f5947..8b0bd7e 100644
--- a/packages/flutter/lib/src/widgets/transitions.dart
+++ b/packages/flutter/lib/src/widgets/transitions.dart
@@ -761,7 +761,7 @@
/// ```dart
/// class Spinner extends StatefulWidget {
/// @override
-/// _SpinnerState createState() => new _SpinnerState();
+/// _SpinnerState createState() => _SpinnerState();
/// }
///
/// class _SpinnerState extends State<Spinner> with SingleTickerProviderStateMixin {
@@ -770,7 +770,7 @@
/// @override
/// void initState() {
/// super.initState();
-/// _controller = new AnimationController(
+/// _controller = AnimationController(
/// duration: const Duration(seconds: 10),
/// vsync: this,
/// )..repeat();
@@ -784,11 +784,11 @@
///
/// @override
/// Widget build(BuildContext context) {
-/// return new AnimatedBuilder(
+/// return AnimatedBuilder(
/// animation: _controller,
-/// child: new Container(width: 200.0, height: 200.0, color: Colors.green),
+/// child: Container(width: 200.0, height: 200.0, color: Colors.green),
/// builder: (BuildContext context, Widget child) {
-/// return new Transform.rotate(
+/// return Transform.rotate(
/// angle: _controller.value * 2.0 * math.pi,
/// child: child,
/// );
diff --git a/packages/flutter/test/rendering/recording_canvas.dart b/packages/flutter/test/rendering/recording_canvas.dart
index edc0eee..0e04296 100644
--- a/packages/flutter/test/rendering/recording_canvas.dart
+++ b/packages/flutter/test/rendering/recording_canvas.dart
@@ -43,8 +43,8 @@
///
/// ```dart
/// RenderBox box = tester.renderObject(find.text('ABC'));
-/// TestRecordingCanvas canvas = new TestRecordingCanvas();
-/// TestRecordingPaintingContext context = new TestRecordingPaintingContext(canvas);
+/// TestRecordingCanvas canvas = TestRecordingCanvas();
+/// TestRecordingPaintingContext context = TestRecordingPaintingContext(canvas);
/// box.paint(context, Offset.zero);
/// // Now test the expected canvas.invocations.
/// ```
diff --git a/packages/flutter/test/widgets/semantics_tester.dart b/packages/flutter/test/widgets/semantics_tester.dart
index 84af7eb..1fa0fb8 100644
--- a/packages/flutter/test/widgets/semantics_tester.dart
+++ b/packages/flutter/test/widgets/semantics_tester.dart
@@ -451,8 +451,8 @@
///
/// ```dart
/// testWidgets('generate code for MyWidget', (WidgetTester tester) async {
- /// var semantics = new SemanticsTester(tester);
- /// await tester.pumpWidget(new MyWidget());
+ /// var semantics = SemanticsTester(tester);
+ /// await tester.pumpWidget(MyWidget());
/// print(semantics.generateTestSemanticsExpressionForCurrentSemanticsTree());
/// semantics.dispose();
/// });
@@ -462,11 +462,11 @@
///
/// ```dart
/// testWidgets('generate code for MyWidget', (WidgetTester tester) async {
- /// var semantics = new SemanticsTester(tester);
- /// await tester.pumpWidget(new MyWidget());
+ /// var semantics = SemanticsTester(tester);
+ /// await tester.pumpWidget(MyWidget());
/// expect(semantics, hasSemantics(
/// // Generated code:
- /// new TestSemantics(
+ /// TestSemantics(
/// ... properties and child nodes ...
/// ),
/// ignoreRect: true,