1+ import 'dart:io' ;
2+
3+ import 'package:device_info_plus/device_info_plus.dart' ;
14import 'package:flutter/foundation.dart' ;
25import 'package:flutter/material.dart' ;
36import 'package:flutter_acrylic/flutter_acrylic.dart' ;
@@ -15,13 +18,14 @@ Future<void> main() async {
1518 // Window.disableZoomButton();
1619 Window .makeTitlebarTransparent ();
1720
18- WindowOptions windowOptions = const WindowOptions (
19- size: Size (1250 , 700 ),
21+ WindowOptions windowOptions = WindowOptions (
22+ size: const Size (1250 , 700 ),
2023 center: true ,
21- backgroundColor: Colors .transparent,
24+ // backgroundColor: Colors.transparent,
2225 skipTaskbar: false ,
23- titleBarStyle: TitleBarStyle .hidden,
24- minimumSize: Size (1100 , 600 ),
26+ titleBarStyle: Platform .isMacOS ? TitleBarStyle .hidden : TitleBarStyle .normal,
27+ title: 'Open Dev' ,
28+ minimumSize: const Size (1100 , 600 ),
2529 );
2630
2731 windowManager.waitUntilReadyToShow (windowOptions, () async {
@@ -30,24 +34,17 @@ Future<void> main() async {
3034 });
3135 }
3236
33- // await Window.setEffect(
34- // effect: WindowEffect.mica,
35- // );
36-
37- // if (Platform.isWindows) {
38- // await Window.hideWindowControls();
39- // }
37+ if (Platform .isWindows) {
38+ DeviceInfoPlugin deviceInfo = DeviceInfoPlugin ();
39+ WindowsDeviceInfo deviceInfoWindows = await deviceInfo.windowsInfo;
40+ if (deviceInfoWindows.productName.contains ('Windows 11' )) {
41+ await Window .setEffect (
42+ effect: WindowEffect .mica,
43+ );
44+ }
45+ }
4046
4147 runApp (const MyApp ());
42- // if (Platform.isWindows) {
43- // doWhenWindowReady(() {
44- // appWindow
45- // ..minSize = Size(640, 360)
46- // ..size = Size(720, 540)
47- // ..alignment = Alignment.center
48- // ..show();
49- // });
50- // }
5148}
5249
5350class MyApp extends StatelessWidget {
@@ -59,16 +56,14 @@ class MyApp extends StatelessWidget {
5956 title: 'Open Dev' ,
6057 theme: ThemeData (useMaterial3: true , colorScheme: lightColorScheme),
6158 darkTheme: ThemeData (useMaterial3: true , colorScheme: darkColorScheme),
62- // darkTheme: ThemeData.dark(
63- // // colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
64- // useMaterial3: true,
65- // ),
66- // theme: ThemeData(
67- // colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
68- // useMaterial3: true,
69- // ),
7059 debugShowCheckedModeBanner: false ,
71- home: kIsWeb ? const BaseView () : const SafeArea (child: TitlebarSafeArea (child: BaseView ())),
60+ home: kIsWeb
61+ ? const BaseView ()
62+ : const SafeArea (
63+ child: TitlebarSafeArea (
64+ child: BaseView (),
65+ ),
66+ ),
7267 );
7368 }
7469}
0 commit comments