How to handle dart application exceptions ?
Stanislav Ilin
Posted on August 30, 2022
Talker - package to handle dart application exceptions.
š The main goal of the project provide ability to understand where the error occurs in a short time
ā
Can work with different state managements
ā
Can work with any crash reporting tool (Firebase Crashlytics, Sentry, Your own, etc)
ā
Flutter app logs UI output at screen
ā
Integrated logs and exceptions history
ā
Showing UI exception alerts
Easy to use
You can use Talker instance everywhere in your app
Simple and concise syntax will help you with this
final talker = Talker();
// Handle exceptions and errors
try {
// your code...
} on Exception catch (e, st) {
talker.handle(e, st, 'Exception with');
}
// Log your app info
talker.info('App is started');
talker.critical('ā Houston, we have a problem!');
talker.error('šØ The service is not available');
More examples you can get here
Customization
Talker package has a lot of customizations like:
ā
Custom logs with any color and message
ā
Logs history (contains all application info)
ā
Custom Filters, Formatters, outputs
ā
Observers for making custom logic
ā
Data stream to handle logs in any point of code
I am launching a series of articles about this technology.
In each new article I will talk about a certain feature of this approach to error handling in the Flutter/dart application
š Go to the GitHub repository page!
š„µ Here you can see beautiful examples of usage and code snippets.
Show some ā¤ļø and star the repo to support the project!
Posted on August 30, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.