addApp2 method

  1. @override
Future<LoggedIn> addApp2(
  1. AccessBloc accessBloc,
  2. Map<String, PagesAndDialogAccesss> accesses,
  3. List<DeterminedApp> apps,
  4. AppModel newCurrentApp,
)
override

Implementation

@override
Future<LoggedIn> addApp2(
    AccessBloc accessBloc,
    Map<String, PagesAndDialogAccesss> accesses,
    List<DeterminedApp> apps,
    AppModel newCurrentApp) async {
  var newAccesses = await AccessHelper.extendAccesses(
      accessBloc, member, accesses, newCurrentApp, true);
  var newApps = apps.map((v) => v).toList();

  var privilegeLevel = _privilegeLevel(newCurrentApp.documentID, newAccesses);
  var appIsBlocked = _isBlocked(newCurrentApp.documentID, newAccesses);
  var homePage =
      await getHomepage(newCurrentApp, appIsBlocked, privilegeLevel);
  newApps.add(DeterminedApp(newCurrentApp, homePage));
  return Future.value(LoggedIn._(
    usr,
    member,
    postLoginAction,
    newApps,
    newAccesses,
    subscribedToApps,
    blockedMembers,
    playstoreApp: playstoreApp,
    newForceRefresh: forceRefresh,
  ));
}