initialize method

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

Implementation

@override
Future<void> initialize() async {
  if (AbsRealtime.fbRTApp == null) {
    //await HycopFactory.initAll();
    AbsRealtime.setFirebaseApp(await Firebase.initializeApp(
        name: "realTime",
        options: FirebaseOptions(
            databaseURL: myConfig!.serverConfig.dbConnInfo.databaseURL,
            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)));
    logger.finest('realTime initialized');
  }
  // ignore: prefer_conditional_assignment
  if (_db == null) {
    _db = FirebaseDatabase.instanceFor(app: AbsRealtime.fbRTApp!).ref();
  }

  // for realtime
}