mirror of
https://github.com/flutter/samples.git
synced 2026-04-02 01:32:58 +00:00
Beta branch fix (#173)
This commit is contained in:
committed by
Andrew Brogdon
parent
6673acc6d7
commit
73086e20c1
@@ -26,19 +26,15 @@ class AppModel<T> extends StatefulWidget {
|
||||
|
||||
_AppModelState<T> createState() => _AppModelState<T>();
|
||||
|
||||
static Type _typeOf<T>() => T;
|
||||
|
||||
static T of<T>(BuildContext context) {
|
||||
final Type appModelScopeType = _typeOf<_AppModelScope<T>>();
|
||||
final _AppModelScope<T> scope = context
|
||||
.inheritFromWidgetOfExactType(appModelScopeType) as _AppModelScope<T>;
|
||||
final _AppModelScope<T> scope =
|
||||
context.dependOnInheritedWidgetOfExactType<_AppModelScope<T>>();
|
||||
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) as _AppModelScope<T>;
|
||||
final _AppModelScope<T> scope =
|
||||
context.dependOnInheritedWidgetOfExactType<_AppModelScope<T>>();
|
||||
scope.appModelState.updateState(newState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,27 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: archive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.11"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.2"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
version: "2.4.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -67,20 +81,27 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.0"
|
||||
image:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.5"
|
||||
version: "0.12.6"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.7"
|
||||
version: "1.1.8"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -95,6 +116,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0+1"
|
||||
petitparser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: petitparser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -148,7 +176,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.5"
|
||||
version: "0.2.11"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -170,6 +198,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.8"
|
||||
xml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.5.0"
|
||||
sdks:
|
||||
dart: ">=2.5.0 <3.0.0"
|
||||
flutter: ">=0.11.9 <2.0.0"
|
||||
|
||||
Reference in New Issue
Block a user