Skip to content

Commit

Permalink
Use one main.dart to minimize duplicated code (#870)
Browse files Browse the repository at this point in the history
TODO: You have to adjust your .vscode/launch.json files
  • Loading branch information
KarinBerg authored Sep 28, 2024
1 parent 9505c14 commit 790b7e3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 99 deletions.
13 changes: 12 additions & 1 deletion recipients_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,32 @@ Future<void> main() async {
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown],
);

const appFlavor = String.fromEnvironment("FLUTTER_APP_FLAVOR");
if (appFlavor.isEmpty) {
throw Exception("Missing app flavor setting");
}

await Firebase.initializeApp();
await FirebaseAppCheck.instance.activate();

final firestore = FirebaseFirestore.instance;
final firebaseAuth = FirebaseAuth.instance;
final messaging = FirebaseMessaging.instance;

if (appFlavor == "dev") {
firestore.useFirestoreEmulator("localhost", 8080);
firebaseAuth.useAuthEmulator("localhost", 9099);
firebaseAuth.setSettings(appVerificationDisabledForTesting: true);
}

Bloc.observer = CustomBlocObserver();

await SentryFlutter.init(
(options) {
options.dsn = const String.fromEnvironment("SENTRY_URL");
options.tracesSampleRate = 1.0;
options.profilesSampleRate = 1.0;
options.environment = "prod";
options.environment = appFlavor;
},
appRunner: () => runApp(
MyApp(
Expand Down
51 changes: 0 additions & 51 deletions recipients_app/lib/main_dev.dart

This file was deleted.

47 changes: 0 additions & 47 deletions recipients_app/lib/main_stage.dart

This file was deleted.

0 comments on commit 790b7e3

Please sign in to comment.