kinhvodoi92 / console_flutter

Plugin to show API logs for Flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

console_flutter

A simple Flutter package project to store, view, and manage app console log, API logs.

Base log type:

  • verbose (Default, with black color text)
  • info (Blue color text)
  • error (Red color text)

Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  console_flutter: <latest_version>

Usage

In main function

import 'package:console_flutter/console_flutter.dart';

void main() async {
    WidgetsFlutterBinding.ensureInitialized();
    Console.logEnabled(kDebugMode); // false will ignore Console view
    runApp(MyApp());
}
  • Method 1: WrapperWidget

In your app

import 'package:console_flutter/console_flutter.dart';

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
        ...
        body: ConsoleWrapper(
            child: MyHomePage(),
        ),
    );
  }
}
  • Method 2: Custom Navigate

Custom your view and action to open Logs Screen

import 'package:console_flutter/console_flutter.dart';

Console.showConsoleLog(context);

About

Plugin to show API logs for Flutter

License:MIT License


Languages

Language:Dart 88.0%Language:Ruby 9.0%Language:Swift 2.7%Language:Objective-C 0.3%