flutter_log_handler 0.0.1 copy "flutter_log_handler: ^0.0.1" to clipboard
flutter_log_handler: ^0.0.1 copied to clipboard

A powerful logging handler with UI, crash capture, interceptor logging and file sharing.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_log_handler/flutter_log_handler.dart';

void main() {
  LogService.init(
    const LogConfig(
      maxLogs: 200,
      retentionDays: 3,
      fileName: "example_logs.txt",
    ),
  );

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: HomeScreen());
  }
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Log Example")),
      body: Center(
        child: ElevatedButton(
          onPressed: () {
            LogService.to.logEvent(
              message: "Button clicked",
              level: LogLevel.info,
            );

            Navigator.push(
              context,
              MaterialPageRoute(builder: (_) => const LogScreen()),
            );
          },
          child: const Text("Generate Log & Open Logs"),
        ),
      ),
    );
  }
}
1
likes
0
points
508
downloads

Publisher

unverified uploader

Weekly Downloads

A powerful logging handler with UI, crash capture, interceptor logging and file sharing.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter, get, logger, path_provider, share_plus, shared_preferences

More

Packages that depend on flutter_log_handler