crashops_flutter 0.2.1 copy "crashops_flutter: ^0.2.1" to clipboard
crashops_flutter: ^0.2.1 copied to clipboard

outdated

This Flutter plugin will bridge your Flutter app with CrashOps SDK, for iOS and Android. CrashOps helps you to easily monitor crash and error reports. This library is plug n' play and it's super easy [...]

CrashOps plugin for Flutter #

License: MIT

This Flutter plugin helps to bridge your app with the CrashOps native SDK. CrashOps SDK helps you monitor your app's crashes and Flutter errors.

Installation #

⑂ & ▶ (plug n' play)

Easiest to install, all you need to do is add crashops_flutter dependency and the SDK will automatically start monitoring native crashes on each app launch.

Required changes in your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
...
  crashops_flutter: 0.2.01
...

Usage #

(see the a full example project in: github.com/CrashOps/Flutter-Example)

CrashOps can catch also errors from Flutter and Dart, not only native crashes. #

To catch errors from your Flutter app, edit your main() method as follows:

void main() {
  CrashOps.instance.run(
      app: MyApp(),
      iosKey: "your-ios-application-key-from-crashops",
      androidKey: "your-android-application-key-from-crashops",
      onError: (flutterErrorDetails, globalError, stackTrace) {
        if (flutterErrorDetails != null) {
          // Sometimes 'flutterErrorDetails' may be null because CrashOps catches Dart errors as well, not only Flutter errors.
          //
          // In case you wish to use more error catchers, make calls like this one:
          // Crashlytics.instance.recordFlutterError(flutterErrorDetails);
        }

        print("CrashOps caught an error from Flutter / Dart:\nError: $globalError\nStack Trace: $stackTrace");
      });
}

Customize configurations as you like #

class _MyAppState extends State<MyApp> {
  // It's not mandatory to put those configurations inside a State.
  // It may also be in the "main()" function.
  final CrashOps crashOps = CrashOps();

  ...

  @override
  void initState() {
    super.initState();

    // If you're willing to create logs in debug
    crashOps.isEnabledInDebugMode = true;
    // If you wish to upload logs to CrashOps' servers
    crashOps.setApplicationKey(
        iosKey: "your-ios-application-key-from-crashops",
        androidKey: "your-android-application-key-from-crashops");
    // If you wish to include more details in each log
    crashOps.setMetadata({"yo": "that's my awesome app!"});
  }

  ...

}

Configuration Files (use them if not configured programmatically) #

These files are not mandatory to use as you can also configure CrashOps via code only (programmatically, as mentioned above), but you still can add these files to save configuration via coding.

iOS 'plist' configuration file #

CrashOpsConfig-info.plist

Android 'xml' configuration file #

crashops_config.xml

Don't have Flutter yet? #

To help you getting started with Flutter, view their online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Acknowledgments #

Our iOS SDK uses KSCrash library.

Our Android SDK uses retrofit.

Thanks to this awesome framework called Flutter, we cloud export this package.

TODO #

Work in progress: creating a UI dashboard on the web, stay tuned.

3
likes
0
pub points
0%
popularity

Publisher

unverified uploader

This Flutter plugin will bridge your Flutter app with CrashOps SDK, for iOS and Android. CrashOps helps you to easily monitor crash and error reports. This library is plug n' play and it's super easy to use. Just add it to your "dependencies" section, set your application key and you're all set.

Homepage

License

unknown (LICENSE)

Dependencies

flutter, stack_trace

More

Packages that depend on crashops_flutter