Installation

SDK Installation

Bugsee flutter SDK is distributed through github. To add it to your project, add it to the dependencies in your pubspec.yaml as follows:

dependencies:
  bugsee:
    git:
      url: git@github.com:bugsee/flutter-bugsee.git

In order to refer to a specific version of the SDK, add a ref definition.

dependencies:
  bugsee:
    git:
      url: git@github.com:bugsee/flutter-bugsee.git
      ref: 1.2.3

Initialization

In order to allow Bugsee to properly intercept and report unhandled exceptions, it is best to first initialize Bugsee and then the rest of the app. This approach will guarantee that the app is running in a Zone, binding channel, etc. The following example also assume you are using different apps in Bugsee for Android and iOS deployments, this is very typical.

import 'package:bugsee/bugsee.dart';

Future<Null> launchBugsee(Function(bool isBugseeLaunched) appRunner) async {
  var launchOptions;
  var bugseeToken = "";

  if (Platform.isAndroid) {
    bugseeToken = "<android app token>";
    launchOptions = new AndroidLaunchOptions();
  } else if (Platform.isIOS) {
    bugseeToken = "<ios app token>";
    launchOptions = new IOSLaunchOptions();
  }

  await Bugsee.launch(bugseeToken,
      appRunCallback: appRunner, launchOptions: launchOptions);
}

Future<Null> main() async {
  await launchBugsee((bool isBugseeLaunched) async {
    runApp(new MyApp());
  });
}

class MyApp extends StatelessWidget {
  ....

See configuration to learn more on Bugsee launch options and customizations.