checkApp static method

Future<void> checkApp(
  1. String appId
)

Implementation

static Future<void> checkApp(String appId) async {
  appId = appId.toUpperCase();
  var app = await appRepository()!.get(appId);
  if (app == null) {
    await AbstractMainRepositorySingleton.singleton
        .userRepository()!
        .signOut();
    await AbstractMainRepositorySingleton.singleton
        .userRepository()!
        .signOut();
    var usr = await AbstractMainRepositorySingleton.singleton
        .userRepository()!
        .signInWithGoogle();
    if (usr == null) {
      throw Exception("User is null");
    }
//    await claimOwnerShipApplication(theApp.documentID, usr.uid);

    MemberModel member = await AccessBloc.firebaseToMemberModel(usr);
    await AppBuilder(
            AppModel(documentID: appId, ownerID: member.documentID), member)
        .create(ConsoleConsumeAppBuilderProgress(), false);
  }
}