sublime_log 1.0.7 copy "sublime_log: ^1.0.7" to clipboard
sublime_log: ^1.0.7 copied to clipboard

Flutter package which manages the logs message, view or share to other.

example/lib/main.dart

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

void main() => runApp(MaterialApp(home: const ExampleApp()));

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

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  final TextEditingController _inputController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Sublime log demo')),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            TextField(
              controller: _inputController,
              textAlign: TextAlign.center,
            ),
            TextButton(onPressed: _addLog, child: Text('Add log')),
            TextButton(onPressed: _viewLog, child: Text('View Logs'))
          ],
        ),
      ),
    );
  }

  void _addLog() {
    FocusScope.of(context).requestFocus(new FocusNode());
    SublimeLog.log(message: _inputController.text.trim());
    _inputController.clear();
    const snackBar = SnackBar(
      content: Text(
          'Yay! Your text has been logged! Press `View Logs` to see logged text!'),
    );
    ScaffoldMessenger.of(context).showSnackBar(snackBar);
  }

  void _viewLog() {
    SublimeLog.showLogsPreview(
      context,
      quotes: ['First quote', 'Second quote'],
    );
  }
}
1
likes
140
points
270
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter package which manages the logs message, view or share to other.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter, path_provider, share_plus

More

Packages that depend on sublime_log