38 lines
1.1 KiB
Dart
38 lines
1.1 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:fluent_ui/fluent_ui.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:momo/material/app.dart';
|
|
import 'package:window_manager/window_manager.dart';
|
|
import 'package:tray_manager/tray_manager.dart';
|
|
|
|
void main() async {
|
|
if (Platform.isLinux || Platform.isWindows || Platform.isMacOS) {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
// Must add this line.
|
|
await windowManager.ensureInitialized();
|
|
WindowOptions windowOptions = const WindowOptions(
|
|
size: Size(800, 600),
|
|
center: true,
|
|
minimumSize: Size(300, 400),
|
|
// backgroundColor: Colors.transparent,
|
|
// skipTaskbar: false,
|
|
// titleBarStyle: TitleBarStyle.hidden,
|
|
);
|
|
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
|
await windowManager.show();
|
|
await windowManager.focus();
|
|
});
|
|
}
|
|
runApp(const ProviderScope(child: MyApp()));
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return const MyMaterialApp();
|
|
}
|
|
}
|