class
_BiliAppState
extends
State<BiliApp> {
BiliRouteDelegate _routeDelegate = BiliRouteDelegate();
@override
Widget build(BuildContext context) {
return
FutureBuilder<HiCache>(
future: HiCache.preInit(),
builder: (BuildContext context, AsyncSnapshot<HiCache> snapshot) {
var widget = snapshot.connectionState == ConnectionState.done
? Router(routerDelegate: _routeDelegate)
: Scaffold(
body: Center(child: CircularProgressIndicator()),
);
return
MaterialApp(
home: widget,
theme: ThemeData(primarySwatch: white),
);
});
}
}