startApp function

void startApp (
  1. {AppAuthType appAuthType: AppAuthType.FIREBASE_AUTH,
  2. BackendType backendType: BackendType.MOCK,
  3. AppThemeType appThemeType: AppThemeType.OFFLINE,
  4. AppContextType appContextType: AppContextType.PROD,
  5. bool shouldReportDevCrashes: true,
  6. bool allowDynamicLink: true}
)

Implementation

void startApp({
  AppAuthType appAuthType = AppAuthType.FIREBASE_AUTH,
  BackendType backendType = BackendType.MOCK,
  AppThemeType appThemeType = AppThemeType.OFFLINE,
  AppContextType appContextType = AppContextType.PROD,
  bool shouldReportDevCrashes = true,
  bool allowDynamicLink = true,
}) {
  WidgetsFlutterBinding.ensureInitialized();
  AppContext appContext =
      getAppContext(appContextType, allowDynamicLink: allowDynamicLink);
  AppAuth appAuth = getAppAuth(appAuthType);
  AppTheme appTheme = getAppTheme(appThemeType);
  DataBackend dataBackend = getDataBackend(backendType);
  runApp(
    MultiProvider(
      providers: [
        ChangeNotifierProvider(create: (context) => appTheme),
        ChangeNotifierProvider(create: (context) => appAuth),
        ChangeNotifierProvider(create: (context) => dataBackend),
        ChangeNotifierProvider(create: (context) => appContext),
      ],
      child: IwfpApp(),
    ),
  );
}