Last active
January 7, 2021 07:34
-
-
Save piumimaheshika/ad37019f04854885b33d44d4b4983cf3 to your computer and use it in GitHub Desktop.
Crashlytics flutter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Record non fatal errors | |
| Future<void> reportNonFatalError(String error, String method, String reason, | |
| {dynamic exception, StackTrace stack}) async { | |
| FirebaseCrashlytics.instance.setCustomKey('ERROR', error); | |
| FirebaseCrashlytics.instance.setCustomKey('METHOD', method); | |
| FirebaseCrashlytics.instance.setCustomKey('REASON', reason); | |
| FirebaseCrashlytics.instance.log(reason); | |
| await FirebaseCrashlytics.instance.recordError( | |
| exception != null ? exception : Error(), | |
| stack != null ? stack : StackTrace.current, | |
| reason: 'Recorded error'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment