🐛 Fix windows tray issue
This commit is contained in:
parent
9e039cc532
commit
566ebde1dd
@ -369,7 +369,7 @@ class _AppSplashScreenState extends State<_AppSplashScreen> with TrayListener {
|
|||||||
if (kIsWeb || Platform.isAndroid || Platform.isIOS) return;
|
if (kIsWeb || Platform.isAndroid || Platform.isIOS) return;
|
||||||
|
|
||||||
await localNotifier.setup(
|
await localNotifier.setup(
|
||||||
appName: 'solian',
|
appName: 'Solian',
|
||||||
shortcutPolicy: ShortcutPolicy.requireCreate,
|
shortcutPolicy: ShortcutPolicy.requireCreate,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -429,7 +429,11 @@ class _AppSplashScreenState extends State<_AppSplashScreen> with TrayListener {
|
|||||||
break;
|
break;
|
||||||
case 'exit':
|
case 'exit':
|
||||||
_appLifecycleListener?.dispose();
|
_appLifecycleListener?.dispose();
|
||||||
SystemChannels.platform.invokeMethod('SystemNavigator.pop');
|
if (Platform.isWindows) {
|
||||||
|
appWindow.close();
|
||||||
|
} else {
|
||||||
|
SystemChannels.platform.invokeMethod('SystemNavigator.pop');
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ import 'dart:math' as math;
|
|||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
@ -188,29 +188,16 @@ class AppRootScaffold extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'Solar Network',
|
'Solar Network',
|
||||||
style: GoogleFonts.spaceGrotesk(),
|
style: GoogleFonts.spaceGrotesk(),
|
||||||
textAlign: !kIsWeb
|
|
||||||
? Platform.isMacOS
|
|
||||||
? TextAlign.center
|
|
||||||
: null
|
|
||||||
: null,
|
|
||||||
).padding(horizontal: 12, vertical: 5),
|
).padding(horizontal: 12, vertical: 5),
|
||||||
),
|
),
|
||||||
if (!Platform.isMacOS)
|
if (!Platform.isMacOS)
|
||||||
Row(
|
MinimizeWindowButton(colors: windowButtonColor),
|
||||||
mainAxisSize: MainAxisSize.min,
|
if (!Platform.isMacOS)
|
||||||
children: [
|
MaximizeWindowButton(colors: windowButtonColor),
|
||||||
Expanded(child: MoveWindow()),
|
if (!Platform.isMacOS)
|
||||||
Row(
|
CloseWindowButton(
|
||||||
children: [
|
colors: windowButtonColor,
|
||||||
MinimizeWindowButton(
|
onPressed: () => appWindow.hide(),
|
||||||
colors: windowButtonColor),
|
|
||||||
MaximizeWindowButton(
|
|
||||||
colors: windowButtonColor),
|
|
||||||
CloseWindowButton(
|
|
||||||
colors: windowButtonColor),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -226,16 +213,18 @@ class AppRootScaffold extends StatelessWidget {
|
|||||||
child: NotifyIndicator()),
|
child: NotifyIndicator()),
|
||||||
if (ResponsiveBreakpoints.of(context).smallerOrEqualTo(MOBILE))
|
if (ResponsiveBreakpoints.of(context).smallerOrEqualTo(MOBILE))
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: safeBottom > 0 ? safeBottom : 16,
|
bottom: safeBottom > 0 ? safeBottom : 16,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
child: ConnectionIndicator())
|
child: ConnectionIndicator(),
|
||||||
|
)
|
||||||
else
|
else
|
||||||
Positioned(
|
Positioned(
|
||||||
top: safeTop > 0 ? safeTop : 16,
|
top: safeTop > 0 ? safeTop : 16,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
child: ConnectionIndicator()),
|
child: ConnectionIndicator(),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
drawer: !isExpandedDrawer ? AppNavigationDrawer() : null,
|
drawer: !isExpandedDrawer ? AppNavigationDrawer() : null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user