fix
This commit is contained in:
@ -1,14 +1,30 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:momo/fluent/app.dart';
|
||||
import 'package:momo/material/app.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
import 'package:tray_manager/tray_manager.dart';
|
||||
|
||||
void main() {
|
||||
print(defaultTargetPlatform);
|
||||
runApp(ProviderScope(child: const MyApp()));
|
||||
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 {
|
||||
@ -16,10 +32,6 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (Platform.isWindows) {
|
||||
return const MyFluentApp();
|
||||
} else {
|
||||
return const MyMaterialApp();
|
||||
}
|
||||
return const MyMaterialApp();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user