mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-13 09:20:29 +00:00
- 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.
38 lines
1.1 KiB
Dart
38 lines
1.1 KiB
Dart
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');
|
|
}
|
|
}
|
|
}
|