mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-17 10:35:10 +00:00
Added flavers env and prod for android and ios including Google services
This commit is contained in:
@ -3,19 +3,20 @@ import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:syncrow_app/firebase_options.dart';
|
||||
import 'package:syncrow_app/firebase_options_prod.dart';
|
||||
import 'package:syncrow_app/services/locator.dart';
|
||||
import 'package:syncrow_app/utils/bloc_observer.dart';
|
||||
import 'package:syncrow_app/utils/helpers/localization_helpers.dart';
|
||||
import 'my_app.dart';
|
||||
|
||||
void main() {
|
||||
//to observe the state of the blocs in the output console
|
||||
Bloc.observer = MyBlocObserver();
|
||||
//to catch all the errors in the app and send them to firebase
|
||||
runZonedGuarded(() async {
|
||||
//to load the environment variables
|
||||
const environment = String.fromEnvironment('FLAVOR', defaultValue: 'production');
|
||||
await dotenv.load(fileName: '.env.$environment');
|
||||
// const environment = String.fromEnvironment('FLAVOR', defaultValue: 'prod');
|
||||
await dotenv.load(fileName: '.env.prod');
|
||||
|
||||
// //this is to make the app work with the self-signed certificate
|
||||
// HttpOverrides.global = MyHttpOverrides();
|
||||
@ -29,11 +30,10 @@ void main() {
|
||||
// });
|
||||
|
||||
//to initialize the locator
|
||||
initialSetup();
|
||||
initialSetup(envName: 'prod');
|
||||
|
||||
await Firebase.initializeApp(
|
||||
name: 'test2',
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
options: DefaultFirebaseOptionsStaging.currentPlatform,
|
||||
);
|
||||
|
||||
//final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
Reference in New Issue
Block a user