diff --git a/bin/internal/dart-sdk.version b/bin/internal/dart-sdk.version index e1d164202a..545161c8e6 100644 --- a/bin/internal/dart-sdk.version +++ b/bin/internal/dart-sdk.version @@ -1 +1 @@ -2.0.0-dev.20.0 +2.0.0-dev.22.0 diff --git a/bin/internal/engine.version b/bin/internal/engine.version index 6dd62b0dd3..1457e2b4d8 100644 --- a/bin/internal/engine.version +++ b/bin/internal/engine.version @@ -1 +1 @@ -9bc2efdf47b102e3c7cfe84bcfc17327f1a6d6ac +c60d817093ddb2daaf9aa0c7d7d83ee1860bf290 \ No newline at end of file diff --git a/packages/flutter/lib/src/widgets/dismissible.dart b/packages/flutter/lib/src/widgets/dismissible.dart index e61cd105aa..89d4d87f27 100644 --- a/packages/flutter/lib/src/widgets/dismissible.dart +++ b/packages/flutter/lib/src/widgets/dismissible.dart @@ -189,7 +189,7 @@ class _DismissibleClipper extends CustomClipper { enum _FlingGestureKind { none, forward, reverse } -class _DismissibleState extends State with TickerProviderStateMixin, AutomaticKeepAliveClientMixin { +class _DismissibleState extends State 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 2ab107940e..256a52196d 100644 --- a/packages/flutter/test/material/about_test.dart +++ b/packages/flutter/test/material/about_test.dart @@ -55,7 +55,7 @@ void main() { LicenseRegistry.addLicense(() { return new Stream.fromIterable([ - new LicenseEntryWithLineBreaks([ 'Pirate package '], 'Pirate license') + const LicenseEntryWithLineBreaks(const [ 'Pirate package '], 'Pirate license') ]); }); @@ -78,13 +78,13 @@ void main() { testWidgets('AboutListTile control test', (WidgetTester tester) async { LicenseRegistry.addLicense(() { return new Stream.fromIterable([ - new LicenseEntryWithLineBreaks(['AAA'], 'BBB') + const LicenseEntryWithLineBreaks(const ['AAA'], 'BBB') ]); }); LicenseRegistry.addLicense(() { return new Stream.fromIterable([ - new LicenseEntryWithLineBreaks(['Another package'], 'Another license') + const LicenseEntryWithLineBreaks(const ['Another package'], 'Another license') ]); }); diff --git a/packages/flutter/test/painting/decoration_test.dart b/packages/flutter/test/painting/decoration_test.dart index 438f250191..438ff71e17 100644 --- a/packages/flutter/test/painting/decoration_test.dart +++ b/packages/flutter/test/painting/decoration_test.dart @@ -336,9 +336,9 @@ void main() { }); test('Decoration.lerp with unrelated decorations', () { - expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 0.0), const isInstanceOf()); - expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 0.25), const isInstanceOf()); - expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 0.75), const isInstanceOf()); - expect(Decoration.lerp(new FlutterLogoDecoration(), const BoxDecoration(), 1.0), const isInstanceOf()); + expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 0.0), const isInstanceOf()); // ignore: CONST_EVAL_THROWS_EXCEPTION + expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 0.25), const isInstanceOf()); // ignore: CONST_EVAL_THROWS_EXCEPTION + expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 0.75), const isInstanceOf()); // ignore: CONST_EVAL_THROWS_EXCEPTION + expect(Decoration.lerp(const FlutterLogoDecoration(), const BoxDecoration(), 1.0), const isInstanceOf()); // 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 2a5d5ab519..a4967523ac 100644 --- a/packages/flutter/test/painting/shape_decoration_test.dart +++ b/packages/flutter/test/painting/shape_decoration_test.dart @@ -17,7 +17,7 @@ void main() { test('ShapeDecoration constructor', () { const Color colorR = const Color(0xffff0000); const Color colorG = const Color(0xff00ff00); - final Gradient gradient = new LinearGradient(colors: [colorR, colorG]); + final Gradient gradient = const LinearGradient(colors: const [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 db41ef427e..e8cda50608 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 @@ void main() { testWidgets('ListWheelScrollView needs positive diameter ratio', (WidgetTester tester) async { try { new ListWheelScrollView( - diameterRatio: -2.0, + diameterRatio: nonconst(-2.0), itemExtent: 20.0, - children: [], + children: const [], ); fail('Expected failure with negative diameterRatio'); } on AssertionError catch (exception) { @@ -39,11 +39,11 @@ void main() { 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: [], + children: const [], ), ), ); @@ -96,11 +96,11 @@ void main() { 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: [ + children: const [ 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 2e5e59ca33..d7d2932cb2 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 @@ void main() { slivers: [ 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( - [ + const SliverList( + delegate: const SliverChildListDelegate( + const [ 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 e423ca0743..a35fb8ba8a 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 @@ void main() { physics: const BouncingScrollPhysics(), slivers: [ new SliverPersistentHeader(delegate: new TestDelegate(), floating: true), - new SliverList( - delegate: new SliverChildListDelegate([ + const SliverList( + delegate: const SliverChildListDelegate(const [ 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 856252fdbf..1eba52cfcc 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 @@ void main() { physics: const BouncingScrollPhysics(), slivers: [ new SliverPersistentHeader(delegate: new TestDelegate(), pinned: true), - new SliverList( - delegate: new SliverChildListDelegate([ + const SliverList( + delegate: const SliverChildListDelegate(const [ 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 fc5339202e..06b7869810 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 @@ void main() { physics: const BouncingScrollPhysics(), slivers: [ new SliverPersistentHeader(delegate: new TestDelegate()), - new SliverList( - delegate: new SliverChildListDelegate([ + const SliverList( + delegate: const SliverChildListDelegate(const [ 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 b3632a0fe7..4a056436b1 100644 --- a/packages/flutter/test/widgets/slivers_block_test.dart +++ b/packages/flutter/test/widgets/slivers_block_test.dart @@ -15,8 +15,8 @@ Future test(WidgetTester tester, double offset) { child: new Viewport( offset: new ViewportOffset.fixed(offset), slivers: [ - new SliverList( - delegate: new SliverChildListDelegate([ + const SliverList( + delegate: const SliverChildListDelegate(const [ 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 @@ void main() { child: new Viewport( offset: offset, slivers: [ - new SliverList( - delegate: new SliverChildListDelegate([ + const SliverList( + delegate: const SliverChildListDelegate(const [ const SizedBox(height: 251.0, child: const Text('a')), const SizedBox(height: 252.0, child: const Text('b')), ]), @@ -262,8 +262,8 @@ void main() { child: new Viewport( offset: new ViewportOffset.zero(), slivers: [ - new SliverList( - delegate: new SliverChildListDelegate([ + const SliverList( + delegate: const SliverChildListDelegate(const [ const SizedBox(height: 400.0, child: const Text('a')), ]), ), @@ -280,8 +280,8 @@ void main() { child: new Viewport( offset: new ViewportOffset.fixed(100.0), slivers: [ - new SliverList( - delegate: new SliverChildListDelegate([ + const SliverList( + delegate: const SliverChildListDelegate(const [ const SizedBox(height: 400.0, child: const Text('a')), ]), ), @@ -298,8 +298,8 @@ void main() { child: new Viewport( offset: new ViewportOffset.fixed(100.0), slivers: [ - new SliverList( - delegate: new SliverChildListDelegate([ + const SliverList( + delegate: const SliverChildListDelegate(const [ const SizedBox(height: 4000.0, child: const Text('a')), ]), ), @@ -316,8 +316,8 @@ void main() { child: new Viewport( offset: new ViewportOffset.zero(), slivers: [ - new SliverList( - delegate: new SliverChildListDelegate([ + const SliverList( + delegate: const SliverChildListDelegate(const [ 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 2aba1bdb7d..3aa11b9480 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -345,7 +345,7 @@ abstract class ServiceObject { // 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 @@ abstract class ServiceObject { // 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 @@ abstract class ServiceObject { } /// Update [this] using [map] as a source. [map] can be a service reference. - void update(Map map) { + void updateFromMap(Map 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 @@ class VM extends ServiceObjectOwner { final String type = _stripRef(map['type']); if (type == 'VM') { // Update this VM object. - update(map); + updateFromMap(map); return this; } @@ -684,7 +684,7 @@ class VM extends ServiceObjectOwner { }); } else { // Existing isolate, update data. - isolate.update(map); + isolate.updateFromMap(map); } return isolate; } @@ -696,7 +696,7 @@ class VM extends ServiceObjectOwner { view = new ServiceObject._fromMap(this, map); _viewCache[mapId] = view; } else { - view.update(map); + view.updateFromMap(map); } return view; } @@ -965,7 +965,7 @@ class Isolate extends ServiceObjectOwner { 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 @@ class ServiceMap extends ServiceObject implements Map { int get length => _map.length; @override String toString() => _map.toString(); + @override + void addEntries(Iterable> entries) => _map.addEntries(entries); + @override + Map cast() => _map.cast(); + @override + void removeWhere(bool test(String key, dynamic value)) => _map.removeWhere(test); + @override + Map map(MapEntry transform(String key, dynamic value)) => + _map.map(transform); + @override + Iterable> get entries => _map.entries; + @override + void updateAll(dynamic update(String key, dynamic value)) => _map.updateAll(update); + @override + Map retype() => _map.retype(); + @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.