getCreateTasks method
List<NewAppTask> ?
getCreateTasks(
- String uniqueId,
- AppModel app,
- NewAppWizardParameters parameters,
- MemberModel member,
- HomeMenuProvider homeMenuProvider,
- AppBarProvider appBarProvider,
- DrawerProvider leftDrawerProvider,
- DrawerProvider rightDrawerProvider,
override
Implementation
@override
List<NewAppTask>? getCreateTasks(
String uniqueId,
AppModel app,
NewAppWizardParameters parameters,
MemberModel member,
HomeMenuProvider homeMenuProvider,
AppBarProvider appBarProvider,
DrawerProvider leftDrawerProvider,
DrawerProvider rightDrawerProvider,
) {
if (parameters is NewPolicyParameters) {
var policySpecifications = parameters.actionSpecifications;
var appId = app.documentID;
if (policySpecifications.shouldCreatePageDialogOrWorkflow()) {
List<NewAppTask> tasks = [];
var memberId = member.documentID;
tasks.add(() async {
print("Policy Medium");
var policyMedium =
await JpgPolicyMediumBuilder(uniqueId, app, memberId).create();
parameters.registerTheAppPolicyMedium(policyMedium);
});
AppPolicyModel? policyModel;
tasks.add(() async {
print("Policy Model");
var policyMedium = parameters.appPolicyMedium;
if (policyMedium != null) {
policyModel =
await AppPolicyBuilder(uniqueId, appId, memberId, policyMedium)
.create();
if (policyModel != null) {
parameters.registerTheAppPolicy(policyModel!);
}
}
});
tasks.add(() async {
print("Policy Page");
if (policyModel != null) {
await PolicyPageBuilder(
uniqueId,
policyPageId,
app,
memberId,
homeMenuProvider(),
appBarProvider(),
leftDrawerProvider(),
rightDrawerProvider(),
policyModel!,
'Policy',
'Policy',
).create();
}
});
return tasks;
}
} else {
throw Exception('Unexpected class for parameters: $parameters');
}
return null;
}