Flutterfire: [firebase_crashlytics] runZoned with onError is deprecated in version v1.17.0

Created on 13 Apr 2020  Â·  2Comments  Â·  Source: FirebaseExtended/flutterfire

Describe the bug
Updating flutter to v1.17.0 (beta channel at the moment of writing) cause flutter analyze to trigger an error:

   info • 'onError' is deprecated and shouldn't be used. Use runZonedGuarded instead • lib/main.dart:73:6 • deprecated_member_use

To Reproduce
Steps to reproduce the behavior:

  1. run flutter channel
  2. select the channel beta
  3. run flutter analyze
  4. see the error in the console

Expected behavior
The example code in the documentation should not cause any deprecation warning.

crashlytics bug documentation

Most helpful comment

A possible fix would be to change the documentation into something like this:

  runZonedGuarded(() {
    runApp(
      MyApp(),
    );
  }, (Object error, StackTrace stack) {
    Crashlytics.instance.recordError(error, stack);
  });

All 2 comments

A possible fix would be to change the documentation into something like this:

  runZonedGuarded(() {
    runApp(
      MyApp(),
    );
  }, (Object error, StackTrace stack) {
    Crashlytics.instance.recordError(error, stack);
  });
Was this page helpful?
0 / 5 - 0 ratings