catcher 0.0.3 copy "catcher: ^0.0.3" to clipboard
catcher: ^0.0.3 copied to clipboard

outdated

Plugin for error catching. Allows handling errors when they're not catched by developer. Plugin provides multiple handlers for errors.

example/lib/main.dart

import 'package:catcher/handlers/console_handler.dart';
import 'package:flutter/material.dart';

import 'package:catcher/catcher.dart';
void main() => Catcher(application: MyApp(), handlers: [ConsoleHandler()]);
class MyApp extends StatefulWidget{

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

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


  @override
  Widget build(BuildContext context) {

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(child:
          FlatButton(child: Text("Generate error"),onPressed: () => generateError())
        ),
      ),
    );
  }

  generateError()  async {

    try {
      foo() async {
        throw new StateError('This is an async Dart exception.');
      }
      bar() async {
        await foo();
      }
      await bar();
    } catch (exc,stackTrace){
      print("Cathced exc: "+ exc.toString());
      Catcher.getInstance().reportCheckedError(exc, stackTrace);
    }
  }

}
592
likes
0
pub points
94%
popularity

Publisher

verified publisherhasoft.pl

Plugin for error catching. Allows handling errors when they're not catched by developer. Plugin provides multiple handlers for errors.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

device_info, dio, flutter, flutter_local_notifications, fluttertoast, mailer, package_info

More

Packages that depend on catcher