Skip to content

Amitpatil215/platformexceptioncatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Platform Exception Capture

A Flutter plugin for capturing unhandled errors from Native Android

Installing

Step 1: Navigate to project's pubspec.yaml file.

Step 2 : Add dependancy

platfromexceptioncatcher:
    git:
        url: https://github.com/Amitpatil215/platformexceptioncatcher.git

Step 3: Get the packages

flutter pub get

Step 4:

Now in your Dart code, you can use:

import 'package:platfromexceptioncatcher/platfromexceptioncatcher.dart';

How to use?

void main() {

  // Initialize PlatfromExceptionCatcher  
  PlatfromExceptionCatcher.init(
    () => runApp(const MyApp()),
    url: "https://anyUrl.com/Api/log",
    onErrorCallBack: ((error, stackTrace) {
        // do something if platform exception occurs
    }),
    onHttpRequestFailedCallback: (error, stackTrace) {
        // do something if logging to server fails
    },
  );
}

Example App

Step 1 : Clonse the project

Step 2 : Navigate to example

Step 3 : get th epackages and Build the example app

Step 4 : Cick on generate Exception Button to generate platform exception

App generate Null pointer exception and plugin logs it to the server at a given url

Sneek Peek

About

A flutter plugin for logging platform exceptions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published