Closed saad-palapa closed 1 year ago
This is what I have in a wrapper class:
import 'package:debug_overlay/debug_overlay.dart'; import 'package:flutter/widgets.dart'; class Logger { static final logs = LogCollection(); static void info(String message) => _log(message, DiagnosticLevel.info); static void debug(String message) => _log(message, DiagnosticLevel.debug); static void error(String message) => _log(message, DiagnosticLevel.error); static void _log(String message, DiagnosticLevel level) { // Flutter will wait until the current build is completed before executing this code WidgetsBinding.instance.addPostFrameCallback((_) { debugPrint(message); logs.add( Log(level: level, message: message), ); final reversed = logs.logs.reversed.toList(); logs.logs.clear(); logs.logs.addAll(reversed); }); } }
This is my hacky way to show the most recent logs first. Can we instead have that as an option?
I added a toggle icon as part of v0.2.4
This is what I have in a wrapper class:
This is my hacky way to show the most recent logs first. Can we instead have that as an option?