1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-06 11:41:26 +00:00

Updates travis config to include place_tracker and platform_view_swift (#42)

This commit is contained in:
Andrew Brogdon
2018-12-21 15:06:55 -08:00
committed by GitHub
parent 6ce0d22e9b
commit e67cbb03ea
14 changed files with 211 additions and 162 deletions

View File

@@ -4,7 +4,7 @@ class _AppModelScope<T> extends InheritedWidget {
const _AppModelScope({
Key key,
this.appModelState,
Widget child
Widget child,
}) : super(key: key, child: child);
final _AppModelState<T> appModelState;
@@ -18,7 +18,7 @@ class AppModel<T> extends StatefulWidget {
Key key,
@required this.initialState,
this.child,
}) : assert(initialState != null),
}) : assert(initialState != null),
super(key: key);
final T initialState;
@@ -30,13 +30,15 @@ class AppModel<T> extends StatefulWidget {
static T of<T>(BuildContext context) {
final Type appModelScopeType = _typeOf<_AppModelScope<T>>();
final _AppModelScope<T> scope = context.inheritFromWidgetOfExactType(appModelScopeType);
final _AppModelScope<T> scope =
context.inheritFromWidgetOfExactType(appModelScopeType);
return scope.appModelState.currentState;
}
static void update<T>(BuildContext context, T newState) {
final Type appModelScopeType = _typeOf<_AppModelScope<T>>();
final _AppModelScope<T> scope = context.inheritFromWidgetOfExactType(appModelScopeType);
final _AppModelScope<T> scope =
context.inheritFromWidgetOfExactType(appModelScopeType);
scope.appModelState.updateState(newState);
}
}