fix exit button on windows

This commit is contained in:
shillo 2022-12-23 13:29:03 -06:00
parent bf04505d40
commit c6dd9394be

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -219,7 +221,11 @@ class _DesktopMenuState extends ConsumerState<DesktopMenu> {
onChanged: (_) { onChanged: (_) {
// todo: save stuff/ notify before exit? // todo: save stuff/ notify before exit?
// exit(0); // exit(0);
SystemNavigator.pop(); if (Platform.isWindows) {
exit(0);
} else {
SystemNavigator.pop();
}
}, },
controller: controllers[7], controller: controllers[7],
), ),