getLoggedIn static method
Future<LoggedIn>
getLoggedIn(
- AccessBloc accessBloc,
- User usr,
- MemberModel member,
- List<
AppModel> apps, - PostLoginAction? postLoginAction,
- List<
String> subscribedToApps, { - 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,
);
}