Roll engine with rolled dart (#14538)
* Roll engine to pre-dart roll
* Roll engine to pick up updated dart
* Apply Map changes
* Move to dev.22
* Fix some analysis issues
* Silent analyzer
* More consts
* More const massaging
* Yet more const massaging
* Yet more const massaging
* Use nonconst()
diff --git a/packages/flutter/lib/src/widgets/dismissible.dart b/packages/flutter/lib/src/widgets/dismissible.dart
index e61cd10..89d4d87 100644
--- a/packages/flutter/lib/src/widgets/dismissible.dart
+++ b/packages/flutter/lib/src/widgets/dismissible.dart
@@ -189,7 +189,7 @@
enum _FlingGestureKind { none, forward, reverse }
-class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin, AutomaticKeepAliveClientMixin {
+class _DismissibleState extends State<Dismissible> with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { // ignore: MIXIN_INFERENCE_INCONSISTENT_MATCHING_CLASSES
@override
void initState() {
super.initState();
diff --git a/packages/flutter/test/material/about_test.dart b/packages/flutter/test/material/about_test.dart
index 2ab1079..256a521 100644
--- a/packages/flutter/test/material/about_test.dart
+++ b/packages/flutter/test/material/about_test.dart
@@ -55,7 +55,7 @@
LicenseRegistry.addLicense(() {
return new Stream<LicenseEntry>.fromIterable(<LicenseEntry>[
- new LicenseEntryWithLineBreaks(<String>[ 'Pirate package '], 'Pirate license')
+ const LicenseEntryWithLineBreaks(const <String>[ 'Pirate package '], 'Pirate license')
]);
});
@@ -78,13 +78,13 @@
testWidgets('AboutListTile control test', (WidgetTester tester) async {
LicenseRegistry.addLicense(() {
return new Stream<LicenseEntry>.fromIterable(<LicenseEntry>[
- new LicenseEntryWithLineBreaks(<String>['AAA'], 'BBB')
+ const LicenseEntryWithLineBreaks(const <String>['AAA'], 'BBB')
]);
});
LicenseRegistry.addLicense(() {
return new Stream<LicenseEntry>.fromIterable(<LicenseEntry>[
- new LicenseEntryWithLineBreaks(<String>['Another package'], 'Another license')
+ const LicenseEntryWithLineBreaks(const <String>['Another package'], 'Another license')
]);
});
diff --git a/packages/flutter/test/painting/decoration_test.dart b/packages/flutter/test/painting/decoration_test.dart
index 438f250..438ff71 100644
--- a/packages/flutter/test/painting/decoration_test.dart
+++ b/packages/flutter/test/painting/decoration_test.dart
@@ -336,9 +336,9 @@
});
test('Decoration.lerp with unrelated decorations', () {
- expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 0.0), const isInstanceOf<FlutterLogoDecoration>());
- expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 0.25), const isInstanceOf<FlutterLogoDecoration>());
- expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 0.75), const isInstanceOf<BoxDecoration>());
- expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 1.0), const isInstanceOf<BoxDecoration>());
+ expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 0.0), const isInstanceOf<FlutterLogoDecoration>()); // ignore: CONST_EVAL_THROWS_EXCEPTION
+ expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 0.25), const isInstanceOf<FlutterLogoDecoration>()); // ignore: CONST_EVAL_THROWS_EXCEPTION
+ expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 0.75), const isInstanceOf<BoxDecoration>()); // ignore: CONST_EVAL_THROWS_EXCEPTION
+ expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 1.0), const isInstanceOf<BoxDecoration>()); // ignore: CONST_EVAL_THROWS_EXCEPTION
});
}
diff --git a/packages/flutter/test/painting/shape_decoration_test.dart b/packages/flutter/test/painting/shape_decoration_test.dart
index 2a5d5ab..a496752 100644
--- a/packages/flutter/test/painting/shape_decoration_test.dart
+++ b/packages/flutter/test/painting/shape_decoration_test.dart
@@ -17,7 +17,7 @@
test('ShapeDecoration constructor', () {
const Color colorR = const Color(0xffff0000);
const Color colorG = const Color(0xff00ff00);
- final Gradient gradient = new LinearGradient(colors: <Color>[colorR, colorG]);
+ final Gradient gradient = const LinearGradient(colors: const <Color>[colorR, colorG]);
expect(const ShapeDecoration(shape: const Border()), const ShapeDecoration(shape: const Border()));
expect(() => new ShapeDecoration(color: colorR, gradient: gradient, shape: const Border()), throwsAssertionError);
expect(() => new ShapeDecoration(gradient: gradient, shape: null), throwsAssertionError);
diff --git a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart
index db41ef4..e8cda50 100644
--- a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart
+++ b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart
@@ -15,9 +15,9 @@
testWidgets('ListWheelScrollView needs positive diameter ratio', (WidgetTester tester) async {
try {
new ListWheelScrollView(
- diameterRatio: -2.0,
+ diameterRatio: nonconst(-2.0),
itemExtent: 20.0,
- children: <Widget>[],
+ children: const <Widget>[],
);
fail('Expected failure with negative diameterRatio');
} on AssertionError catch (exception) {
@@ -39,11 +39,11 @@
testWidgets('ListWheelScrollView can have zero child', (WidgetTester tester) async {
await tester.pumpWidget(
- new Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
- child: new ListWheelScrollView(
+ child: const ListWheelScrollView(
itemExtent: 50.0,
- children: <Widget>[],
+ children: const <Widget>[],
),
),
);
@@ -96,11 +96,11 @@
testWidgets("ListWheelScrollView children can't be bigger than itemExtent", (WidgetTester tester) async {
await tester.pumpWidget(
- new Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
- child: new ListWheelScrollView(
+ child: const ListWheelScrollView(
itemExtent: 50.0,
- children: <Widget>[
+ children: const <Widget>[
const SizedBox(
height: 200.0,
width: 200.0,
diff --git a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart
index 2e5e59c..d7d2932 100644
--- a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart
+++ b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart
@@ -18,9 +18,9 @@
slivers: <Widget>[
const SliverAppBar(floating: true, pinned: true, expandedHeight: 200.0, title: const Text('A')),
const SliverAppBar(primary: false, pinned: true, title: const Text('B')),
- new SliverList(
- delegate: new SliverChildListDelegate(
- <Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(
+ const <Widget>[
const Text('C'),
const Text('D'),
const SizedBox(height: 500.0),
diff --git a/packages/flutter/test/widgets/slivers_appbar_floating_test.dart b/packages/flutter/test/widgets/slivers_appbar_floating_test.dart
index e423ca0..a35fb8b 100644
--- a/packages/flutter/test/widgets/slivers_appbar_floating_test.dart
+++ b/packages/flutter/test/widgets/slivers_appbar_floating_test.dart
@@ -203,8 +203,8 @@
physics: const BouncingScrollPhysics(),
slivers: <Widget>[
new SliverPersistentHeader(delegate: new TestDelegate(), floating: true),
- new SliverList(
- delegate: new SliverChildListDelegate(<Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(
height: 300.0,
child: const Text('X'),
diff --git a/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart b/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart
index 856252f..1eba52c 100644
--- a/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart
+++ b/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart
@@ -256,8 +256,8 @@
physics: const BouncingScrollPhysics(),
slivers: <Widget>[
new SliverPersistentHeader(delegate: new TestDelegate(), pinned: true),
- new SliverList(
- delegate: new SliverChildListDelegate(<Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(
height: 300.0,
child: const Text('X'),
diff --git a/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart b/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart
index fc53392..06b7869 100644
--- a/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart
+++ b/packages/flutter/test/widgets/slivers_appbar_scrolling_test.dart
@@ -82,8 +82,8 @@
physics: const BouncingScrollPhysics(),
slivers: <Widget>[
new SliverPersistentHeader(delegate: new TestDelegate()),
- new SliverList(
- delegate: new SliverChildListDelegate(<Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(
height: 300.0,
child: const Text('X'),
diff --git a/packages/flutter/test/widgets/slivers_block_test.dart b/packages/flutter/test/widgets/slivers_block_test.dart
index b3632a0..4a05643 100644
--- a/packages/flutter/test/widgets/slivers_block_test.dart
+++ b/packages/flutter/test/widgets/slivers_block_test.dart
@@ -15,8 +15,8 @@
child: new Viewport(
offset: new ViewportOffset.fixed(offset),
slivers: <Widget>[
- new SliverList(
- delegate: new SliverChildListDelegate(<Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 400.0, child: const Text('a')),
const SizedBox(height: 400.0, child: const Text('b')),
const SizedBox(height: 400.0, child: const Text('c')),
@@ -151,8 +151,8 @@
child: new Viewport(
offset: offset,
slivers: <Widget>[
- new SliverList(
- delegate: new SliverChildListDelegate(<Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 251.0, child: const Text('a')),
const SizedBox(height: 252.0, child: const Text('b')),
]),
@@ -262,8 +262,8 @@
child: new Viewport(
offset: new ViewportOffset.zero(),
slivers: <Widget>[
- new SliverList(
- delegate: new SliverChildListDelegate(<Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 400.0, child: const Text('a')),
]),
),
@@ -280,8 +280,8 @@
child: new Viewport(
offset: new ViewportOffset.fixed(100.0),
slivers: <Widget>[
- new SliverList(
- delegate: new SliverChildListDelegate(<Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 400.0, child: const Text('a')),
]),
),
@@ -298,8 +298,8 @@
child: new Viewport(
offset: new ViewportOffset.fixed(100.0),
slivers: <Widget>[
- new SliverList(
- delegate: new SliverChildListDelegate(<Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 4000.0, child: const Text('a')),
]),
),
@@ -316,8 +316,8 @@
child: new Viewport(
offset: new ViewportOffset.zero(),
slivers: <Widget>[
- new SliverList(
- delegate: new SliverChildListDelegate(<Widget>[
+ const SliverList(
+ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 4000.0, child: const Text('a')),
]),
),
diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart
index 2aba1bd..3aa11b9 100644
--- a/packages/flutter_tools/lib/src/vmservice.dart
+++ b/packages/flutter_tools/lib/src/vmservice.dart
@@ -345,7 +345,7 @@
// fallback return a ServiceMap object.
serviceObject ??= new ServiceMap._empty(owner);
// We have now constructed an empty service object, call update to populate it.
- serviceObject.update(map);
+ serviceObject.updateFromMap(map);
return serviceObject;
}
@@ -420,7 +420,7 @@
// An object may have been collected.
completer.complete(new ServiceObject._fromMap(owner, response));
} else {
- update(response);
+ updateFromMap(response);
completer.complete(this);
}
} catch (e, st) {
@@ -433,7 +433,7 @@
}
/// Update [this] using [map] as a source. [map] can be a service reference.
- void update(Map<String, dynamic> map) {
+ void updateFromMap(Map<String, dynamic> map) {
// Don't allow the type to change on an object update.
final bool mapIsRef = _hasRef(map['type']);
final String mapType = _stripRef(map['type']);
@@ -662,7 +662,7 @@
final String type = _stripRef(map['type']);
if (type == 'VM') {
// Update this VM object.
- update(map);
+ updateFromMap(map);
return this;
}
@@ -684,7 +684,7 @@
});
} else {
// Existing isolate, update data.
- isolate.update(map);
+ isolate.updateFromMap(map);
}
return isolate;
}
@@ -696,7 +696,7 @@
view = new ServiceObject._fromMap(this, map);
_viewCache[mapId] = view;
} else {
- view.update(map);
+ view.updateFromMap(map);
}
return view;
}
@@ -965,7 +965,7 @@
final String mapId = map['id'];
ServiceObject serviceObject = (mapId != null) ? _cache[mapId] : null;
if (serviceObject != null) {
- serviceObject.update(map);
+ serviceObject.updateFromMap(map);
return serviceObject;
}
// Build the object from the map directly.
@@ -1276,6 +1276,24 @@
int get length => _map.length;
@override
String toString() => _map.toString();
+ @override
+ void addEntries(Iterable<MapEntry<String, dynamic>> entries) => _map.addEntries(entries);
+ @override
+ Map<RK, RV> cast<RK, RV>() => _map.cast<RK, RV>();
+ @override
+ void removeWhere(bool test(String key, dynamic value)) => _map.removeWhere(test);
+ @override
+ Map<K2, V2> map<K2, V2>(MapEntry<K2, V2> transform(String key, dynamic value)) =>
+ _map.map(transform);
+ @override
+ Iterable<MapEntry<String, dynamic>> get entries => _map.entries;
+ @override
+ void updateAll(dynamic update(String key, dynamic value)) => _map.updateAll(update);
+ @override
+ Map<RK, RV> retype<RK, RV>() => _map.retype<RK, RV>();
+ @override
+ dynamic update(String key, dynamic update(dynamic value), {dynamic ifAbsent()}) =>
+ _map.update(key, update, ifAbsent: ifAbsent);
}
/// Peered to a Android/iOS FlutterView widget on a device.