EXERLOG / exer_log

exer_log - authored by @KalleHallden

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Firebase Features Suggestion

TheAmanM opened this issue · comments

@KalleHallden It might be a good idea to implement Firebase Crashlytics and Performance monitoring. These will give you good insight about your app on the Firebase console.

Here is some sample code for implementing Crashlytics, it looks pretty simple:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await Firebase.initializeApp();

  // Pass all uncaught errors from the framework to Crashlytics.
  FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;

  runApp(MyApp());
}

in addition to this we should probably also put the content of the main into a runeZonedGuard and catch and report the errors to firebase crashlytics.

@all-contributors please add @TheAmanM for code, maintenance and

Good point on the runZoneGuarded. The code, according to Firebase documentation should then be:

void main() async {
  runZonedGuarded<Future<void>>(() async {
    WidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp();

    FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;

    runApp(MyApp());
  }, (error, stack) =>
    FirebaseCrashlytics.instance.recordError(error, stack, fatal: true));
}

Also @jorre127, how do you know so much about Flutter? Where do you learn everything from?

@TheAmanM I work for a company that makes flutter apps, so that helps a lot haha. Just by coming into contact with it everyday I guess.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.