parent
dfbd608f8c
commit
3708677863
@ -0,0 +1,26 @@ |
|||||||
|
import 'package:flutter/material.dart'; |
||||||
|
|
||||||
|
class BlocProvider { |
||||||
|
// TODO TBD |
||||||
|
} |
||||||
|
|
||||||
|
class AppState extends InheritedWidget { |
||||||
|
final BlocProvider blocs; |
||||||
|
const AppState({ |
||||||
|
Key? key, |
||||||
|
required this.blocs, |
||||||
|
required Widget child, |
||||||
|
}) : super(key: key, child: child); |
||||||
|
|
||||||
|
static AppState of(BuildContext context) { |
||||||
|
final AppState? result = |
||||||
|
context.dependOnInheritedWidgetOfExactType<AppState>(); |
||||||
|
assert(result != null, 'No AppState found in context'); |
||||||
|
return result!; |
||||||
|
} |
||||||
|
|
||||||
|
@override |
||||||
|
bool updateShouldNotify(AppState oldWidget) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue