Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
October 13, 2022 08:08 pm GMT

Http logs in Flutter app with talker is easy as possible

A major update of the talker package has recently been released.
New release contains updated TalkerScreen with more actions and logs file sharing, fixed logs generation and etc.

But another one big thing in update is talker_dio_logger package that can integrate http logs as simple as it can ever be done.

Let's take it in turns.

How it will works

talker_dio_logger

talker_dio_logger is a separate package that works on the basis of talker error handler and logger package and dio most popular and powerful dart http client.

When you connect it, all information about your work on the network gets into talker's history and the console of the running application.

Get Started

Follow these steps to run talker_dio_logger in your project and see all http logs

Add dependency

dependencies:  talker_dio_logger: ^0.1.3

Usage

Just add TalkerDioLogger to your dio instance and it will work

final dio = Dio();dio.interceptors.add(    TalkerDioLogger(        settings: const TalkerDioLoggerSettings(          printRequestHeaders: true,          printResponseHeaders: true,        ),    ),);

Using with Talker

You can add your talker instance for TalkerDioLogger if your app already uses Talker.

In this case, all logs and errors will fall into your unified talker tracking system

final talker = Talker();final dio = Dio();dio.interceptors.add(    TalkerDioLogger(        talker: talker,        settings: const TalkerDioLoggerSettings(          printRequestHeaders: true,          printResponseHeaders: true,        ),    ),);

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!


Original Link: https://dev.to/frezyx/http-logs-in-flutter-app-with-talker-is-easy-as-possible-37o4

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To