readStateData<T> method
T
readStateData<T>({
- required BuildContext context,
- required String key,
- required T onNotFound(
- BuildContext context,
- String key
Implementation
T readStateData<T>({
required BuildContext context,
required String key,
required T Function(BuildContext context, String key) onNotFound,
}) {
try {
return readState(context, identifier: key) as T;
} catch (e) {
return onNotFound(context, key);
}
}