mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-13 17:30:28 +00:00
feat: Implement Windows runner for Flutter application
- Added FlutterWindow class to manage the Flutter view within a Win32 window. - Created main entry point in main.cpp to initialize and run the Flutter application. - Implemented utility functions for console attachment and command line argument parsing. - Added resource management for application icon and manifest. - Enhanced Win32Window class for DPI awareness and theme management. - Included necessary headers and resource files for building the Windows runner.
This commit is contained in:
37
lib/utils/toast_logger.dart
Normal file
37
lib/utils/toast_logger.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../providers/messages_provider.dart';
|
||||
|
||||
/// Toast logger utility - replaces SnackBar with system messages in the channels tab
|
||||
class ToastLogger {
|
||||
/// Log an info message
|
||||
static void info(BuildContext context, String message) {
|
||||
_log(context, message, 'info');
|
||||
}
|
||||
|
||||
/// Log a success message
|
||||
static void success(BuildContext context, String message) {
|
||||
_log(context, message, 'success');
|
||||
}
|
||||
|
||||
/// Log a warning message
|
||||
static void warning(BuildContext context, String message) {
|
||||
_log(context, message, 'warning');
|
||||
}
|
||||
|
||||
/// Log an error message
|
||||
static void error(BuildContext context, String message) {
|
||||
_log(context, message, 'error');
|
||||
}
|
||||
|
||||
/// Internal method to log a system message
|
||||
static void _log(BuildContext context, String message, String level) {
|
||||
try {
|
||||
final messagesProvider = context.read<MessagesProvider>();
|
||||
messagesProvider.logSystemMessage(text: message, level: level);
|
||||
} catch (e) {
|
||||
// Fallback to print if provider is not available
|
||||
debugPrint('[$level] $message');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user