From b88636db15f94da951484c1fadacfaec01c95c82 Mon Sep 17 00:00:00 2001 From: Vadim Date: Sun, 26 Mar 2023 17:45:18 +0300 Subject: [PATCH] removed launch_app --- README.md | 4 +--- analysis_options.yaml | 2 +- lib/launch_app.dart | 12 ------------ lib/main_dev.dart | 8 ++++++-- lib/main_prod.dart | 11 +++++++++-- 5 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 lib/launch_app.dart diff --git a/README.md b/README.md index 210adb9..89ed428 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,7 @@ The list of features that the old lightmeter app has and that have to be impleme ## Build -``` -flutter build apk --flavor dev --dart-define cameraPreviewAspectRatio=2/3 -t lib/main_dev.dart -``` +As part of this project is private, you will be able to run this app from the _main_dev.dart_ file (i.e. --flavor dev). Also to avoid fatal errors the _main_prod.dart_ file is excluded from analysis. ## Contribution diff --git a/analysis_options.yaml b/analysis_options.yaml index 6f0d37d..fb80863 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,3 +1,3 @@ include: package:flutter_lints/flutter.yaml analyzer: - exclude: [lib/launch_app.dart] \ No newline at end of file + exclude: [lib/main_prod.dart] \ No newline at end of file diff --git a/lib/launch_app.dart b/lib/launch_app.dart deleted file mode 100644 index 69dfcb7..0000000 --- a/lib/launch_app.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:firebase_core/firebase_core.dart'; -import 'package:flutter/material.dart'; -import 'package:lightmeter/firebase_options.dart'; - -import 'application.dart'; -import 'environment.dart'; - -Future launchApp(Environment env) async { - WidgetsFlutterBinding.ensureInitialized(); - await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); - runApp(Application(env)); -} diff --git a/lib/main_dev.dart b/lib/main_dev.dart index fb3d8e3..e74e87b 100644 --- a/lib/main_dev.dart +++ b/lib/main_dev.dart @@ -1,5 +1,9 @@ +import 'package:flutter/material.dart'; import 'package:lightmeter/environment.dart'; -import 'launch_app.dart'; +import 'application.dart'; -void main() => launchApp(const Environment.dev()); +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + runApp(const Application(Environment.dev())); +} diff --git a/lib/main_prod.dart b/lib/main_prod.dart index a1839f6..aefaa2f 100644 --- a/lib/main_prod.dart +++ b/lib/main_prod.dart @@ -1,5 +1,12 @@ +import 'package:firebase_core/firebase_core.dart'; +import 'package:flutter/material.dart'; import 'package:lightmeter/environment.dart'; -import 'launch_app.dart'; +import 'application.dart'; +import 'firebase_options.dart'; -void main() => launchApp(const Environment.prod()); +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + runApp(const Application(Environment.prod())); +}