initGlobal function
Initial the most common case main()
,
with the [child]
widget, e.g.
await initGlobal(MyApp())
is the equivalent to
await initGlobalPersist();
runApp(globalHost(child: MyApp()));
ex.
Future<void> main() async {
await initGlobal(MyApp());
}
Implementation
Future<void> initGlobal(Widget child) async {
//* Initial the persistent storage.
await initGlobalPersist();
runApp(
//* Create the host with `globalHost` at the top of the widget tree.
globalHost(child: child),
);
}