afMainApp function
void
afMainApp({
- required AFDartParams paramsDart,
- AFExtendBaseDelegate? installBase,
- AFExtendBaseDelegate? installBaseLibrary,
- required AFExtendAppDelegate installCoreApp,
- AFExtendLibraryUIDelegate? installCoreLibrary,
- required AFExtendTestDelegate installTest,
- AFAppExtensionContext? appContext,
afMainApp handles startup, execution, and shutdown sequence for an afApp
Implementation
void afMainApp({
required AFDartParams paramsDart,
AFExtendBaseDelegate? installBase,
AFExtendBaseDelegate? installBaseLibrary,
required AFExtendAppDelegate installCoreApp,
AFExtendLibraryUIDelegate? installCoreLibrary,
required AFExtendTestDelegate installTest,
AFAppExtensionContext? appContext,
}) {
final baseContext = AFBaseExtensionContext();
if(installBase != null) {
installBase(baseContext);
}
if(installBaseLibrary != null) {
installBaseLibrary(baseContext);
}
AFibD.initialize(paramsDart);
final context = appContext ?? AFibF.context;
installCoreApp(context);
installTest(context.test);
if(installCoreLibrary != null) {
installCoreLibrary(context.thirdParty);
}
AFibF.initialize(context, AFConceptualStore.appStore);
final createApp = AFibF.g.createApp;
if(createApp == null) throw AFException("Missing create app function");
final app = createApp();
app.afBeforeRunApp();
runApp(app);
app.afAfterRunApp();
}