anadea_flutter_loggy 1.2.1 copy "anadea_flutter_loggy: ^1.2.1" to clipboard
anadea_flutter_loggy: ^1.2.1 copied to clipboard

Anadea flutter loggy package. An package extention for the loggy package with various integrations such as dio, routing and flutter_bloc.

A loggy extensions package.

Features #

  • Logs inspector
  • Dio integrations
  • Navigation logging
  • Bloc log observer

Getting started #

You can use this package with loggy package. Add loggy and anadea_flutter_loggy dependencies to your project.

Usage #

For inspector overlay simply add inspector wrapper to the app builder.

class ExampleApp extends StatelessWidget {
  const ExampleApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: (context, child) => Inspector(
        child: child!,
      ),
      ...
    );
  }
}

Dio integration #

For dio logging add LogInterceptor to the dio instanse.

final dio = Dio()..interceptors.add(LogInterceptor());

Add LogNavigatorObserver to the navigator.

@override
Widget build(BuildContext context) {
    return MaterialApp(
        navigatorObservers: [LogNavigatorObserver()], // This line
        builder: (context, child) => Inspector(
            child: child!,
        ),
        ...
    );
}

Bloc integration #

Add LogBlocObserver for zone.

void main() {
  BlocOverrides.runZoned(
    () async {
      Loggy.initLoggy(
        logPrinter: StreamPrinter(const PrettyPrinter()),
      );

      runApp(ExampleApp());
    },
    blocObserver: LogBlocObserver(),
  );
}
4
likes
0
pub points
34%
popularity

Publisher

verified publisheranadeainc.com

Anadea flutter loggy package. An package extention for the loggy package with various integrations such as dio, routing and flutter_bloc.

Repository

License

unknown (LICENSE)

Dependencies

dio, flutter, flutter_bloc, flutter_loggy, loggy

More

Packages that depend on anadea_flutter_loggy