Unverified Commit 0f3aa500 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

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()
parent f5bbc5bb
9bc2efdf47b102e3c7cfe84bcfc17327f1a6d6ac c60d817093ddb2daaf9aa0c7d7d83ee1860bf290
\ No newline at end of file
...@@ -189,7 +189,7 @@ class _DismissibleClipper extends CustomClipper<Rect> { ...@@ -189,7 +189,7 @@ class _DismissibleClipper extends CustomClipper<Rect> {
enum _FlingGestureKind { none, forward, reverse } 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 @override
void initState() { void initState() {
super.initState(); super.initState();
......
...@@ -55,7 +55,7 @@ void main() { ...@@ -55,7 +55,7 @@ void main() {
LicenseRegistry.addLicense(() { LicenseRegistry.addLicense(() {
return new Stream<LicenseEntry>.fromIterable(<LicenseEntry>[ 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 @@ void main() { ...@@ -78,13 +78,13 @@ void main() {
testWidgets('AboutListTile control test', (WidgetTester tester) async { testWidgets('AboutListTile control test', (WidgetTester tester) async {
LicenseRegistry.addLicense(() { LicenseRegistry.addLicense(() {
return new Stream<LicenseEntry>.fromIterable(<LicenseEntry>[ return new Stream<LicenseEntry>.fromIterable(<LicenseEntry>[
new LicenseEntryWithLineBreaks(<String>['AAA'], 'BBB') const LicenseEntryWithLineBreaks(const <String>['AAA'], 'BBB')
]); ]);
}); });
LicenseRegistry.addLicense(() { LicenseRegistry.addLicense(() {
return new Stream<LicenseEntry>.fromIterable(<LicenseEntry>[ return new Stream<LicenseEntry>.fromIterable(<LicenseEntry>[
new LicenseEntryWithLineBreaks(<String>['Another package'], 'Another license') const LicenseEntryWithLineBreaks(const <String>['Another package'], 'Another license')
]); ]);
}); });
......
...@@ -336,9 +336,9 @@ void main() { ...@@ -336,9 +336,9 @@ void main() {
}); });
test('Decoration.lerp with unrelated decorations', () { test('Decoration.lerp with unrelated decorations', () {
expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 0.0), const isInstanceOf<FlutterLogoDecoration>()); expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 0.0), const isInstanceOf<FlutterLogoDecoration>()); // ignore: CONST_EVAL_THROWS_EXCEPTION
expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 0.25), const isInstanceOf<FlutterLogoDecoration>()); expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 0.25), const isInstanceOf<FlutterLogoDecoration>()); // ignore: CONST_EVAL_THROWS_EXCEPTION
expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 0.75), const isInstanceOf<BoxDecoration>()); expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 0.75), const isInstanceOf<BoxDecoration>()); // ignore: CONST_EVAL_THROWS_EXCEPTION
expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 1.0), const isInstanceOf<BoxDecoration>()); expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 1.0), const isInstanceOf<BoxDecoration>()); // ignore: CONST_EVAL_THROWS_EXCEPTION
}); });
} }
...@@ -17,7 +17,7 @@ void main() { ...@@ -17,7 +17,7 @@ void main() {
test('ShapeDecoration constructor', () { test('ShapeDecoration constructor', () {
const Color colorR = const Color(0xffff0000); const Color colorR = const Color(0xffff0000);
const Color colorG = const Color(0xff00ff00); 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(const ShapeDecoration(shape: const Border()), const ShapeDecoration(shape: const Border()));
expect(() => new ShapeDecoration(color: colorR, gradient: gradient, shape: const Border()), throwsAssertionError); expect(() => new ShapeDecoration(color: colorR, gradient: gradient, shape: const Border()), throwsAssertionError);
expect(() => new ShapeDecoration(gradient: gradient, shape: null), throwsAssertionError); expect(() => new ShapeDecoration(gradient: gradient, shape: null), throwsAssertionError);
......
...@@ -15,9 +15,9 @@ void main() { ...@@ -15,9 +15,9 @@ void main() {
testWidgets('ListWheelScrollView needs positive diameter ratio', (WidgetTester tester) async { testWidgets('ListWheelScrollView needs positive diameter ratio', (WidgetTester tester) async {
try { try {
new ListWheelScrollView( new ListWheelScrollView(
diameterRatio: -2.0, diameterRatio: nonconst(-2.0),
itemExtent: 20.0, itemExtent: 20.0,
children: <Widget>[], children: const <Widget>[],
); );
fail('Expected failure with negative diameterRatio'); fail('Expected failure with negative diameterRatio');
} on AssertionError catch (exception) { } on AssertionError catch (exception) {
...@@ -39,11 +39,11 @@ void main() { ...@@ -39,11 +39,11 @@ void main() {
testWidgets('ListWheelScrollView can have zero child', (WidgetTester tester) async { testWidgets('ListWheelScrollView can have zero child', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
new Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListWheelScrollView( child: const ListWheelScrollView(
itemExtent: 50.0, itemExtent: 50.0,
children: <Widget>[], children: const <Widget>[],
), ),
), ),
); );
...@@ -96,11 +96,11 @@ void main() { ...@@ -96,11 +96,11 @@ void main() {
testWidgets("ListWheelScrollView children can't be bigger than itemExtent", (WidgetTester tester) async { testWidgets("ListWheelScrollView children can't be bigger than itemExtent", (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
new Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListWheelScrollView( child: const ListWheelScrollView(
itemExtent: 50.0, itemExtent: 50.0,
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 200.0, height: 200.0,
width: 200.0, width: 200.0,
......
...@@ -18,9 +18,9 @@ void main() { ...@@ -18,9 +18,9 @@ void main() {
slivers: <Widget>[ slivers: <Widget>[
const SliverAppBar(floating: true, pinned: true, expandedHeight: 200.0, title: const Text('A')), const SliverAppBar(floating: true, pinned: true, expandedHeight: 200.0, title: const Text('A')),
const SliverAppBar(primary: false, pinned: true, title: const Text('B')), const SliverAppBar(primary: false, pinned: true, title: const Text('B')),
new SliverList( const SliverList(
delegate: new SliverChildListDelegate( delegate: const SliverChildListDelegate(
<Widget>[ const <Widget>[
const Text('C'), const Text('C'),
const Text('D'), const Text('D'),
const SizedBox(height: 500.0), const SizedBox(height: 500.0),
......
...@@ -203,8 +203,8 @@ void main() { ...@@ -203,8 +203,8 @@ void main() {
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
slivers: <Widget>[ slivers: <Widget>[
new SliverPersistentHeader(delegate: new TestDelegate(), floating: true), new SliverPersistentHeader(delegate: new TestDelegate(), floating: true),
new SliverList( const SliverList(
delegate: new SliverChildListDelegate(<Widget>[ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox( const SizedBox(
height: 300.0, height: 300.0,
child: const Text('X'), child: const Text('X'),
......
...@@ -256,8 +256,8 @@ void main() { ...@@ -256,8 +256,8 @@ void main() {
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
slivers: <Widget>[ slivers: <Widget>[
new SliverPersistentHeader(delegate: new TestDelegate(), pinned: true), new SliverPersistentHeader(delegate: new TestDelegate(), pinned: true),
new SliverList( const SliverList(
delegate: new SliverChildListDelegate(<Widget>[ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox( const SizedBox(
height: 300.0, height: 300.0,
child: const Text('X'), child: const Text('X'),
......
...@@ -82,8 +82,8 @@ void main() { ...@@ -82,8 +82,8 @@ void main() {
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
slivers: <Widget>[ slivers: <Widget>[
new SliverPersistentHeader(delegate: new TestDelegate()), new SliverPersistentHeader(delegate: new TestDelegate()),
new SliverList( const SliverList(
delegate: new SliverChildListDelegate(<Widget>[ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox( const SizedBox(
height: 300.0, height: 300.0,
child: const Text('X'), child: const Text('X'),
......
...@@ -15,8 +15,8 @@ Future<Null> test(WidgetTester tester, double offset) { ...@@ -15,8 +15,8 @@ Future<Null> test(WidgetTester tester, double offset) {
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.fixed(offset), offset: new ViewportOffset.fixed(offset),
slivers: <Widget>[ slivers: <Widget>[
new SliverList( const SliverList(
delegate: new SliverChildListDelegate(<Widget>[ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 400.0, child: const Text('a')), 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('b')),
const SizedBox(height: 400.0, child: const Text('c')), const SizedBox(height: 400.0, child: const Text('c')),
...@@ -151,8 +151,8 @@ void main() { ...@@ -151,8 +151,8 @@ void main() {
child: new Viewport( child: new Viewport(
offset: offset, offset: offset,
slivers: <Widget>[ slivers: <Widget>[
new SliverList( const SliverList(
delegate: new SliverChildListDelegate(<Widget>[ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 251.0, child: const Text('a')), const SizedBox(height: 251.0, child: const Text('a')),
const SizedBox(height: 252.0, child: const Text('b')), const SizedBox(height: 252.0, child: const Text('b')),
]), ]),
...@@ -262,8 +262,8 @@ void main() { ...@@ -262,8 +262,8 @@ void main() {
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.zero(), offset: new ViewportOffset.zero(),
slivers: <Widget>[ slivers: <Widget>[
new SliverList( const SliverList(
delegate: new SliverChildListDelegate(<Widget>[ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 400.0, child: const Text('a')), const SizedBox(height: 400.0, child: const Text('a')),
]), ]),
), ),
...@@ -280,8 +280,8 @@ void main() { ...@@ -280,8 +280,8 @@ void main() {
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.fixed(100.0), offset: new ViewportOffset.fixed(100.0),
slivers: <Widget>[ slivers: <Widget>[
new SliverList( const SliverList(
delegate: new SliverChildListDelegate(<Widget>[ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 400.0, child: const Text('a')), const SizedBox(height: 400.0, child: const Text('a')),
]), ]),
), ),
...@@ -298,8 +298,8 @@ void main() { ...@@ -298,8 +298,8 @@ void main() {
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.fixed(100.0), offset: new ViewportOffset.fixed(100.0),
slivers: <Widget>[ slivers: <Widget>[
new SliverList( const SliverList(
delegate: new SliverChildListDelegate(<Widget>[ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 4000.0, child: const Text('a')), const SizedBox(height: 4000.0, child: const Text('a')),
]), ]),
), ),
...@@ -316,8 +316,8 @@ void main() { ...@@ -316,8 +316,8 @@ void main() {
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.zero(), offset: new ViewportOffset.zero(),
slivers: <Widget>[ slivers: <Widget>[
new SliverList( const SliverList(
delegate: new SliverChildListDelegate(<Widget>[ delegate: const SliverChildListDelegate(const <Widget>[
const SizedBox(height: 4000.0, child: const Text('a')), const SizedBox(height: 4000.0, child: const Text('a')),
]), ]),
), ),
......
...@@ -345,7 +345,7 @@ abstract class ServiceObject { ...@@ -345,7 +345,7 @@ abstract class ServiceObject {
// fallback return a ServiceMap object. // fallback return a ServiceMap object.
serviceObject ??= new ServiceMap._empty(owner); serviceObject ??= new ServiceMap._empty(owner);
// We have now constructed an empty service object, call update to populate it. // We have now constructed an empty service object, call update to populate it.
serviceObject.update(map); serviceObject.updateFromMap(map);
return serviceObject; return serviceObject;
} }
...@@ -420,7 +420,7 @@ abstract class ServiceObject { ...@@ -420,7 +420,7 @@ abstract class ServiceObject {
// An object may have been collected. // An object may have been collected.
completer.complete(new ServiceObject._fromMap(owner, response)); completer.complete(new ServiceObject._fromMap(owner, response));
} else { } else {
update(response); updateFromMap(response);
completer.complete(this); completer.complete(this);
} }
} catch (e, st) { } catch (e, st) {
...@@ -433,7 +433,7 @@ abstract class ServiceObject { ...@@ -433,7 +433,7 @@ abstract class ServiceObject {
} }
/// Update [this] using [map] as a source. [map] can be a service reference. /// 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. // Don't allow the type to change on an object update.
final bool mapIsRef = _hasRef(map['type']); final bool mapIsRef = _hasRef(map['type']);
final String mapType = _stripRef(map['type']); final String mapType = _stripRef(map['type']);
...@@ -662,7 +662,7 @@ class VM extends ServiceObjectOwner { ...@@ -662,7 +662,7 @@ class VM extends ServiceObjectOwner {
final String type = _stripRef(map['type']); final String type = _stripRef(map['type']);
if (type == 'VM') { if (type == 'VM') {
// Update this VM object. // Update this VM object.
update(map); updateFromMap(map);
return this; return this;
} }
...@@ -684,7 +684,7 @@ class VM extends ServiceObjectOwner { ...@@ -684,7 +684,7 @@ class VM extends ServiceObjectOwner {
}); });
} else { } else {
// Existing isolate, update data. // Existing isolate, update data.
isolate.update(map); isolate.updateFromMap(map);
} }
return isolate; return isolate;
} }
...@@ -696,7 +696,7 @@ class VM extends ServiceObjectOwner { ...@@ -696,7 +696,7 @@ class VM extends ServiceObjectOwner {
view = new ServiceObject._fromMap(this, map); view = new ServiceObject._fromMap(this, map);
_viewCache[mapId] = view; _viewCache[mapId] = view;
} else { } else {
view.update(map); view.updateFromMap(map);
} }
return view; return view;
} }
...@@ -965,7 +965,7 @@ class Isolate extends ServiceObjectOwner { ...@@ -965,7 +965,7 @@ class Isolate extends ServiceObjectOwner {
final String mapId = map['id']; final String mapId = map['id'];
ServiceObject serviceObject = (mapId != null) ? _cache[mapId] : null; ServiceObject serviceObject = (mapId != null) ? _cache[mapId] : null;
if (serviceObject != null) { if (serviceObject != null) {
serviceObject.update(map); serviceObject.updateFromMap(map);
return serviceObject; return serviceObject;
} }
// Build the object from the map directly. // Build the object from the map directly.
...@@ -1276,6 +1276,24 @@ class ServiceMap extends ServiceObject implements Map<String, dynamic> { ...@@ -1276,6 +1276,24 @@ class ServiceMap extends ServiceObject implements Map<String, dynamic> {
int get length => _map.length; int get length => _map.length;
@override @override
String toString() => _map.toString(); 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. /// Peered to a Android/iOS FlutterView widget on a device.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment