log_chamber 1.2.0 copy "log_chamber: ^1.2.0" to clipboard
log_chamber: ^1.2.0 copied to clipboard

A logging tool for Flutter applications that acts like a console window that can be seen inside the app.

example/lib/main.dart

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

void main() {
  // Initialize Chamber
  Chamber.config = ChamberConfig(
    maxLogSize: 100,
    formatTime: (time) => "${time.hour}:${time.minute}:${time.second}.${time.millisecond}",
    isUserAuthorized: true,
  );

  runApp(const MyApp());
}

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

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

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Chamber Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              onPressed: () {
                Chamber.log('Button pressed with success!!');
              },
              child: const Text('Add Log'),
            ),
            ElevatedButton(
              onPressed: () {
                Chamber.display(context);
              },
              child: const Text('Show Logs'),
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
150
pub points
20%
popularity

Publisher

unverified uploader

A logging tool for Flutter applications that acts like a console window that can be seen inside the app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on log_chamber