@@ -157,19 +157,15 @@ abstract class UiComponent<TProps extends UiProps> extends react.Component {
157
157
// BEGIN Typed props helpers
158
158
//
159
159
160
- /// Keep this Expando unparameterized to work around this bug: <https://github.com/dart-lang/sdk/issues/26743>
161
- Expando _typedPropsCache = new Expando ();
160
+ var _typedPropsCache = new Expando <TProps >();
162
161
163
162
/// A typed props object corresponding to the current untyped props Map ([unwrappedProps] ).
164
163
///
165
164
/// Created using [typedPropsFactory] and cached for each Map instance.
166
165
@override
167
166
TProps get props {
168
167
var unwrappedProps = this .unwrappedProps;
169
- /// Have to cast as [TProps] until we can parameterize [_typedPropsCache] .
170
- ///
171
- /// See: <https://github.com/dart-lang/sdk/issues/26743>
172
- var typedProps = _typedPropsCache[unwrappedProps] as TProps ; // ignore: avoid_as
168
+ var typedProps = _typedPropsCache[unwrappedProps];
173
169
if (typedProps == null ) {
174
170
typedProps = typedPropsFactory (unwrappedProps);
175
171
_typedPropsCache[unwrappedProps] = typedProps;
@@ -211,19 +207,15 @@ abstract class UiStatefulComponent<TProps extends UiProps, TState extends UiStat
211
207
// BEGIN Typed state helpers
212
208
//
213
209
214
- /// Keep this Expando unparameterized to work around this bug: <https://github.com/dart-lang/sdk/issues/26743>
215
- Expando _typedStateCache = new Expando ();
210
+ var _typedStateCache = new Expando <TState >();
216
211
217
212
/// A typed state object corresponding to the current untyped state Map ([unwrappedState] ).
218
213
///
219
214
/// Created using [typedStateFactory] and cached for each Map instance.
220
215
@override
221
216
TState get state {
222
217
var unwrappedState = this .unwrappedState;
223
- /// Have to cast as [TState] until we can parameterize [_typedStateCache] .
224
- ///
225
- /// See: <https://github.com/dart-lang/sdk/issues/26743>
226
- var typedState = _typedStateCache[unwrappedState] as TState ; // ignore: avoid_as
218
+ var typedState = _typedStateCache[unwrappedState];
227
219
if (typedState == null ) {
228
220
typedState = typedStateFactory (unwrappedState);
229
221
_typedStateCache[unwrappedState] = typedState;
0 commit comments