2024-10-06 01:21:25 +00:00
|
|
|
import 'dart:io';
|
|
|
|
|
|
2024-10-06 00:03:02 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
import 'src/app.dart';
|
|
|
|
|
import 'src/settings/settings_controller.dart';
|
|
|
|
|
import 'src/settings/settings_service.dart';
|
|
|
|
|
|
2024-10-06 01:21:25 +00:00
|
|
|
void main(List<String> args) async {
|
2024-10-06 00:03:02 +00:00
|
|
|
// Set up the SettingsController, which will glue user settings to multiple
|
|
|
|
|
// Flutter Widgets.
|
|
|
|
|
final settingsController = SettingsController(SettingsService());
|
|
|
|
|
|
|
|
|
|
// Load the user's preferred theme while the splash screen is displayed.
|
|
|
|
|
// This prevents a sudden theme change when the app is first displayed.
|
|
|
|
|
await settingsController.loadSettings();
|
|
|
|
|
|
2024-10-06 01:21:25 +00:00
|
|
|
File? file;
|
|
|
|
|
if (args.isNotEmpty) {
|
|
|
|
|
file = File(args[0]);
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-06 00:03:02 +00:00
|
|
|
// Run the app and pass in the SettingsController. The app listens to the
|
|
|
|
|
// SettingsController for changes, then passes it further down to the
|
|
|
|
|
// SettingsView.
|
2024-10-06 01:21:25 +00:00
|
|
|
runApp(LogViewerApp(settingsController: settingsController, file: file));
|
2024-10-06 00:03:02 +00:00
|
|
|
}
|