getLoggedIn static method

Future<LoggedIn> getLoggedIn(
  1. AccessBloc accessBloc,
  2. User usr,
  3. MemberModel member,
  4. List<AppModel> apps,
  5. PostLoginAction? postLoginAction,
  6. List<String> subscribedToApps, {
  7. AppModel? playstoreApp,
})

Implementation

static Future<LoggedIn> getLoggedIn(
  AccessBloc accessBloc,
  User usr,
  MemberModel member,
  List<AppModel> apps,
  PostLoginAction? postLoginAction,
  List<String> subscribedToApps, {
  AppModel? playstoreApp,
}) async {
  var accesses =
      await AccessHelper.getAccesses(accessBloc, member, apps, false);

  var determinedApps = await Future.wait(apps.map((app) async {
    var privilegeLevel = _privilegeLevel(app.documentID, accesses);
    var appIsBlocked = _isBlocked(app.documentID, accesses);
    var homePage = await getHomepage(app, appIsBlocked, privilegeLevel);
    return DeterminedApp(app, homePage);
  }).toList());

  List<String> blockedMembers =
      await MaintainBlocked.getBlockedMembers(member.documentID);

/*
  if ((!(subscribedToApps.contains(currentApp.documentID))) && (currentApp.policies == null)) {
    // accept membership as not policies provided
    member = await acceptMembership(member, currentApp);
  }
*/

  return LoggedIn._(
    usr,
    member,
    postLoginAction,
    determinedApps,
    accesses,
    subscribedToApps,
    blockedMembers,
    playstoreApp: playstoreApp,
  );
}