mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-05-19 22:50:40 +00:00
added crashlytics
This commit is contained in:
parent
6944da25fa
commit
c1c77049fc
6 changed files with 22 additions and 3 deletions
|
@ -1,3 +1 @@
|
||||||
include: package:flutter_lints/flutter.yaml
|
include: package:flutter_lints/flutter.yaml
|
||||||
analyzer:
|
|
||||||
exclude: [lib/main_prod.dart]
|
|
|
@ -29,6 +29,7 @@ if (keystorePropertiesFile.exists()) {
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ buildscript {
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||||
classpath 'com.google.gms:google-services:4.3.10'
|
classpath 'com.google.gms:google-services:4.3.10'
|
||||||
|
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
14
lib/firebase.dart
Normal file
14
lib/firebase.dart
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
|
import 'firebase_options.dart';
|
||||||
|
|
||||||
|
Future<void> initializeFirebase() async {
|
||||||
|
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
|
||||||
|
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
|
||||||
|
PlatformDispatcher.instance.onError = (error, stack) {
|
||||||
|
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -2,8 +2,11 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/environment.dart';
|
import 'package:lightmeter/environment.dart';
|
||||||
|
|
||||||
import 'application.dart';
|
import 'application.dart';
|
||||||
|
import 'firebase.dart';
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await initializeFirebase();
|
||||||
|
|
||||||
runApp(const Application(Environment.prod()));
|
runApp(const Application(Environment.prod()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ dependencies:
|
||||||
camera: 0.10.0+4
|
camera: 0.10.0+4
|
||||||
exif: 3.1.2
|
exif: 3.1.2
|
||||||
dynamic_color: 1.5.4
|
dynamic_color: 1.5.4
|
||||||
|
firebase_core: 2.7.0
|
||||||
|
firebase_crashlytics: 3.1.2
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_bloc: 8.1.1
|
flutter_bloc: 8.1.1
|
||||||
|
|
Loading…
Reference in a new issue