Djangoflow Error Reporter is a library that provides an easy and flexible way to handle errors in your flutter application. It allows you to add multiple error reporters and provides a singleton for managing them all. It also provides basic functionality for initializing, reporting and updating user information.


Add the package to your pubspec.yaml file:

  djangoflow_error_reporter: <latest_version>

Then run flutter pub get to install the package.


Enabling error reporting

To enable the error reporter, you can use the enableErrorReporting method of DjangoflowErrorReporter.instance. Disabled by default.



To initialize the error reporter, you can use the initialize method of the DjangoflowErrorReporter class. This method takes in two optional strings, env and release. This will initialize/re-initialize with new env and release values.

DjangoflowErrorReporter.instance.initialize(env: 'production', release: '1.0.0+1');

Reporting errors

To report an error, you can use the report method of the DjangoflowErrorReporter class. This method takes in an exception object and an optional stackTrace object.

try {
  // some code that throws an exception
} catch (e, s) { e, stackTrace: s);

Updating user information

To update the user information, you can use the updateUserInformation method of the DjangoflowErrorReporter class. This method takes in three optional strings, id, email, and name.

DjangoflowErrorReporter.instance.updateUserInformation(id: '123', email: '', name: 'John Doe');

Adding error reporters

To add error reporters to the DjangoflowErrorReporter class, you can use the addAll method. This method takes in a list of ErrorReporter objects.

final errorReporter1 = CustomErrorReporter();
final errorReporter2 = AnotherCustomErrorReporter();
final errorReporters = [errorReporter1, errorReporter2];


import 'package:djangoflow_error_reporter/djangoflow_error_reporter.dart';

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
        .initialize(env: 'production', release: '1.0.0+1');

    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: RaisedButton(
            onPressed: () {
              try {
                throw Exception('Something went wrong');
              } catch (e, s) {
       e, stackTrace: s);
            child: Text('Throw Exception'),