mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-09-14 23:44:26 +08:00

This required refactoring the code. With this we can now write an integration test to test the main parts of the app, but more importantly we can automate the process of generating the screenshots.
27 lines
730 B
Dart
27 lines
730 B
Dart
import 'dart:async';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_crashlytics/flutter_crashlytics.dart';
|
|
import 'package:journal/app.dart';
|
|
|
|
void main() async {
|
|
FlutterError.onError = (FlutterErrorDetails details) {
|
|
if (JournalApp.isInDebugMode) {
|
|
FlutterError.dumpErrorToConsole(details);
|
|
} else {
|
|
Zone.current.handleUncaughtError(details.exception, details.stack);
|
|
}
|
|
};
|
|
|
|
if (!JournalApp.isInDebugMode) {
|
|
await FlutterCrashlytics().initialize();
|
|
}
|
|
|
|
runZoned<Future<void>>(() async {
|
|
await JournalApp.main();
|
|
}, onError: (Object error, StackTrace stackTrace) async {
|
|
await FlutterCrashlytics()
|
|
.reportCrash(error, stackTrace, forceCrash: false);
|
|
});
|
|
}
|