diff --git a/lib/consts.dart b/lib/consts.dart index 75779ad3..93a57ce9 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -9,10 +9,12 @@ const kDiscordUrl = "https://bit.ly/heyfoss"; const kGitUrl = "https://github.com/foss42/api-dash"; const kIssueUrl = "$kGitUrl/issues"; -final kIsMacOS = Platform.isMacOS; -final kIsWindows = Platform.isWindows; -final kIsLinux = Platform.isLinux; -final kIsDesktop = kIsMacOS || kIsWindows || kIsLinux; +final kIsMacOS = !kIsWeb && Platform.isMacOS; +final kIsWindows = !kIsWeb && Platform.isWindows; +final kIsLinux = !kIsWeb && Platform.isLinux; +final kIsApple = !kIsWeb && (Platform.isIOS || Platform.isMacOS); +final kIsDesktop = + !kIsWeb && (Platform.isMacOS || Platform.isWindows || Platform.isLinux); final kColorTransparentState = MaterialStateProperty.all(Colors.transparent); @@ -26,9 +28,8 @@ const kMinInitialWindowHeight = 800.0; const kColorSchemeSeed = Colors.blue; final kFontFamily = GoogleFonts.openSans().fontFamily; -final kFontFamilyFallback = (!kIsWeb && (Platform.isIOS || Platform.isMacOS)) - ? null - : [GoogleFonts.notoColorEmoji().fontFamily!]; +final kFontFamilyFallback = + kIsApple ? null : [GoogleFonts.notoColorEmoji().fontFamily!]; final kCodeStyle = TextStyle( fontFamily: GoogleFonts.sourceCodePro().fontFamily, diff --git a/lib/services/window_services.dart b/lib/services/window_services.dart index 7d3a9e23..f84de5e4 100644 --- a/lib/services/window_services.dart +++ b/lib/services/window_services.dart @@ -6,7 +6,7 @@ import 'package:window_manager/window_manager.dart'; import '../consts.dart'; Future setupInitialWindow(Size? sz) async { - if (!kIsWeb && kIsDesktop) { + if (kIsDesktop) { await window_size.getWindowInfo().then((window) { final screen = window.screen; if (screen != null) { @@ -38,7 +38,7 @@ Future resetWindowSize() async { } Future setupWindow({Size? sz, Offset? off, bool center = false}) async { - if (!kIsWeb && kIsDesktop) { + if (kIsDesktop) { double width = kMinInitialWindowWidth, height = kMinInitialWindowHeight; if (sz == null) { await window_size.getWindowInfo().then((window) {