initializeApp method
void
initializeApp(
- String token,
- BuildContext context, {
- BlocObserver? blocObserver,
- required bool pathUrlStrategyEnabled,
- required List<
dynamic Function()> dependenciesInitializers, - bool loadThemeFromLocalStorage = true,
Implementation
void initializeApp(
String token,
BuildContext context, {
BlocObserver? blocObserver,
required bool pathUrlStrategyEnabled,
required List<Function()> dependenciesInitializers,
bool loadThemeFromLocalStorage = true,
}) {
_dependenciesInitializer
.initialize(
token,
context,
blocObserver: blocObserver,
pathUrlStrategyEnabled: pathUrlStrategyEnabled,
dependenciesInitializers: dependenciesInitializers,
loadThemeFromLocalStorage: loadThemeFromLocalStorage,
)
.then(
(res) => res.fold(
(l) => emit(DesignFlowAppError(error: l.toString())),
(r) => _customFontsService.fetchFonts(r.appProps.customFonts).then(
(res) => emit(
DesignFlowAppLoaded(
token: token,
assetsMapData: r.assetsMapData,
initialTheme: r.initialTheme,
appProps: r.appProps,
),
),
),
),
);
}