console_flutter 1.1.1 copy "console_flutter: ^1.1.1" to clipboard
console_flutter: ^1.1.1 copied to clipboard

Plugin to show API logs for Flutter. Includes a console screen to view logs. Export logs as a zip file.

example/lib/main.dart

import 'package:console_flutter/components/console_wrapper.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'package:console_flutter/console_flutter.dart';

void main() {
  Console.logEnabled(true);
  Console.logFileEnabled("123456", "example", false);
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _consoleFlutterPlugin = Console();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: ConsoleWrapper(
        child: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: Center(
            child: GestureDetector(
              child: Text('Test Console Log'),
              onLongPress: () {
                final zip = Console.zipLog();
                zip.then((file) {
                  if (kDebugMode) {
                    print("Zipped log file path: ${file.path} Size: ${file.lengthSync()} bytes");
                  }
                  Console.zipToShareLog();
                }).catchError((error) {
                  if (kDebugMode) {
                    print("Error zipping log file: $error");
                  }
                });
              },
              onTap: () {
                logInfo("This is a info log message.");
              },
            ),
          ),
        ),
      ),
    );
  }
}
3
likes
135
points
219
downloads

Publisher

unverified uploader

Weekly Downloads

Plugin to show API logs for Flutter. Includes a console screen to view logs. Export logs as a zip file.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, logz, plugin_platform_interface

More

Packages that depend on console_flutter