init function

Future<WidgetsBinding> init({
  1. bool isDebug = false,
  2. String? logTag,
  3. String? networkLog,
  4. int dioTimeOut = 10,
  5. List<Locale>? supportedLocales,
})

初始化脚手架

Implementation

Future<WidgetsBinding> init({
  bool isDebug = false,
  String? logTag,
  String? networkLog,
  int dioTimeOut = 10,
  List<Locale>? supportedLocales,
}) async {
  isDebugMode = isDebug;
  Logger.init(isDebugMode, logTag, networkLog);
  WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
  await Get.putAsync(
      () => GlobalService().init(supportedLocales: supportedLocales));
  await Get.putAsync(() => HttpService().init(timeout: dioTimeOut));
  return widgetsBinding;
}