initialize method

  1. @override
Future<void> initialize()
override

Implementation

@override
Future<void> initialize() async {
  if (AbsDatabase.fbDBApp == null) {
    await HycopFactory.initAll();
    logger.finest('initialize');
    AbsDatabase.setFirebaseApp(await Firebase.initializeApp(
      //name: 'database', // <= windows에서 접속 불가
      options: FirebaseOptions(
        apiKey: myConfig!.serverConfig.dbConnInfo.apiKey,
        appId: myConfig!.serverConfig.dbConnInfo.appId,
        storageBucket: myConfig!.serverConfig.dbConnInfo.storageBucket,
        messagingSenderId: myConfig!.serverConfig.dbConnInfo.messagingSenderId,
        projectId: myConfig!.serverConfig.dbConnInfo.projectId,
        databaseURL: myConfig!.serverConfig.dbConnInfo.databaseURL,
      ),
    ));
    //_db = null;
  }
  // ignore: prefer_conditional_assignment
  if (_db == null) {
    logger.finest('_db init');
    _db = FirebaseFirestore.instanceFor(app: AbsDatabase.fbDBApp!);
  }
  assert(_db != null);
}