init static method
初始化 Element 全局单例服务:
void main() async {
await El.init();
runApp(const MainApp());
}
Implementation
static Future<void> init([El? instance]) async {
if (_el == null) {
WidgetsFlutterBinding.ensureInitialized();
_el = instance ?? El();
await el.storage.initStorage();
await Obs.initStorage();
await ImageStorage.initStorage();
}
}