diff --git a/lib/src/component_declaration/component_base.dart b/lib/src/component_declaration/component_base.dart index d147c98b0..295f09afe 100644 --- a/lib/src/component_declaration/component_base.dart +++ b/lib/src/component_declaration/component_base.dart @@ -412,12 +412,22 @@ abstract class UiProps Function get componentFactory; } +/// A class that declares the `_map` getter shared by [PropsMapViewMixin]/[StateMapViewMixin] and [MapViewMixin]. +/// +/// Necessary in order to work around Dart 1.23 strong mode change that disallows conflicting private members +/// in mixins: . +abstract class _OverReactMapViewBase { + Map get _map; +} + /// Works in conjunction with [MapViewMixin] to provide [dart.collection.MapView]-like /// functionality to [UiProps] subclasses. -abstract class PropsMapViewMixin { +abstract class PropsMapViewMixin implements _OverReactMapViewBase { /// The props maintained by this builder and used passed into the component when built. /// In this case, it's the current MapView object. Map get props; + + @override Map get _map => this.props; @override @@ -426,8 +436,10 @@ abstract class PropsMapViewMixin { /// Works in conjunction with [MapViewMixin] to provide [dart.collection.MapView]-like /// functionality to [UiState] subclasses. -abstract class StateMapViewMixin { +abstract class StateMapViewMixin implements _OverReactMapViewBase { Map get state; + + @override Map get _map => this.state; @override @@ -441,9 +453,7 @@ abstract class StateMapViewMixin { /// /// For use by concrete [UiProps] and [UiState] implementations (either generated or manual), /// and thus must remain public. -abstract class MapViewMixin { - Map get _map; - +abstract class MapViewMixin implements _OverReactMapViewBase { V operator[](Object key) => _map[key]; void operator[]=(K key, V value) { _map[key] = value; } void addAll(Map other) { _map.addAll(other); }