import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'main.dart'; import 'src/integrations/mattermost/mattermost_push_host_integration.dart'; import 'src/integrations/mattermost/mattermost_push_plugin_client.dart'; class IopClientBootstrapOptions { final bool initializeFirebase; final bool initializeMattermost; final MattermostPushHostIntegration? mattermostHost; const IopClientBootstrapOptions({ this.initializeFirebase = true, this.initializeMattermost = true, this.mattermostHost, }); } final MattermostPushHostIntegration defaultMattermostHost = MattermostPushHostIntegration( pushClient: MattermostPushPluginClient(), ); Future bootstrapIopClient({ IopClientBootstrapOptions options = const IopClientBootstrapOptions(), }) async { applyFullscreenMode(); if (options.initializeFirebase) { await Firebase.initializeApp(); } if (options.initializeMattermost) { final host = options.mattermostHost ?? defaultMattermostHost; await host.initialize(); } } Future runIopClient({ IopClientBootstrapOptions options = const IopClientBootstrapOptions(), }) async { WidgetsFlutterBinding.ensureInitialized(); await bootstrapIopClient(options: options); runApp(IopClientApp( mattermostHost: options.initializeMattermost ? (options.mattermostHost ?? defaultMattermostHost) : null, )); }