mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-01-31 01:30:40 +00:00
492cbaa7ee
* lock orientation to `portraitUp` * removed custom rotator for camera preview * downgraded to Flutter 3.24.5 * purchasable product * updated goldens * skip artifact upload for PR checks * iap 2.1.3 * Update update_goldens.sh
46 lines
1.6 KiB
Dart
46 lines
1.6 KiB
Dart
import 'dart:async';
|
|
|
|
import 'package:firebase_core/firebase_core.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter_native_splash/flutter_native_splash.dart';
|
|
import 'package:lightmeter/application.dart';
|
|
import 'package:lightmeter/application_wrapper.dart';
|
|
import 'package:lightmeter/constants.dart';
|
|
import 'package:lightmeter/data/analytics/analytics.dart';
|
|
import 'package:lightmeter/data/analytics/api/analytics_firebase.dart';
|
|
import 'package:lightmeter/environment.dart';
|
|
import 'package:lightmeter/firebase_options.dart';
|
|
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
|
|
|
const _errorsLogger = LightmeterAnalytics(api: LightmeterAnalyticsFirebase());
|
|
|
|
Future<void> runLightmeterApp(Environment env) async {
|
|
runZonedGuarded(
|
|
() async {
|
|
final widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
|
|
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
|
|
if (env.buildType == BuildType.prod) {
|
|
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
|
}
|
|
_errorsLogger.init();
|
|
final application = ApplicationWrapper(env, child: const Application());
|
|
runApp(
|
|
env.buildType == BuildType.dev
|
|
? IAPProducts(
|
|
products: [
|
|
IAPProduct(
|
|
storeId: IAPProductType.paidFeatures.storeId,
|
|
price: '0.0\$',
|
|
),
|
|
],
|
|
child: application,
|
|
)
|
|
: IAPProductsProvider(
|
|
apiUrl: iapServerUrl,
|
|
child: application,
|
|
),
|
|
);
|
|
},
|
|
_errorsLogger.logCrash,
|
|
);
|
|
}
|