Update Platform identifiers

This commit is contained in:
Ankit Mahato
2023-04-27 08:13:25 +05:30
parent 315af01593
commit 80b180a3f1
2 changed files with 10 additions and 9 deletions

View File

@ -9,10 +9,12 @@ const kDiscordUrl = "https://bit.ly/heyfoss";
const kGitUrl = "https://github.com/foss42/api-dash"; const kGitUrl = "https://github.com/foss42/api-dash";
const kIssueUrl = "$kGitUrl/issues"; const kIssueUrl = "$kGitUrl/issues";
final kIsMacOS = Platform.isMacOS; final kIsMacOS = !kIsWeb && Platform.isMacOS;
final kIsWindows = Platform.isWindows; final kIsWindows = !kIsWeb && Platform.isWindows;
final kIsLinux = Platform.isLinux; final kIsLinux = !kIsWeb && Platform.isLinux;
final kIsDesktop = kIsMacOS || kIsWindows || kIsLinux; final kIsApple = !kIsWeb && (Platform.isIOS || Platform.isMacOS);
final kIsDesktop =
!kIsWeb && (Platform.isMacOS || Platform.isWindows || Platform.isLinux);
final kColorTransparentState = final kColorTransparentState =
MaterialStateProperty.all<Color>(Colors.transparent); MaterialStateProperty.all<Color>(Colors.transparent);
@ -26,9 +28,8 @@ const kMinInitialWindowHeight = 800.0;
const kColorSchemeSeed = Colors.blue; const kColorSchemeSeed = Colors.blue;
final kFontFamily = GoogleFonts.openSans().fontFamily; final kFontFamily = GoogleFonts.openSans().fontFamily;
final kFontFamilyFallback = (!kIsWeb && (Platform.isIOS || Platform.isMacOS)) final kFontFamilyFallback =
? null kIsApple ? null : <String>[GoogleFonts.notoColorEmoji().fontFamily!];
: <String>[GoogleFonts.notoColorEmoji().fontFamily!];
final kCodeStyle = TextStyle( final kCodeStyle = TextStyle(
fontFamily: GoogleFonts.sourceCodePro().fontFamily, fontFamily: GoogleFonts.sourceCodePro().fontFamily,

View File

@ -6,7 +6,7 @@ import 'package:window_manager/window_manager.dart';
import '../consts.dart'; import '../consts.dart';
Future<void> setupInitialWindow(Size? sz) async { Future<void> setupInitialWindow(Size? sz) async {
if (!kIsWeb && kIsDesktop) { if (kIsDesktop) {
await window_size.getWindowInfo().then((window) { await window_size.getWindowInfo().then((window) {
final screen = window.screen; final screen = window.screen;
if (screen != null) { if (screen != null) {
@ -38,7 +38,7 @@ Future<void> resetWindowSize() async {
} }
Future<void> setupWindow({Size? sz, Offset? off, bool center = false}) async { Future<void> setupWindow({Size? sz, Offset? off, bool center = false}) async {
if (!kIsWeb && kIsDesktop) { if (kIsDesktop) {
double width = kMinInitialWindowWidth, height = kMinInitialWindowHeight; double width = kMinInitialWindowWidth, height = kMinInitialWindowHeight;
if (sz == null) { if (sz == null) {
await window_size.getWindowInfo().then((window) { await window_size.getWindowInfo().then((window) {