android screensht no test

This commit is contained in:
2024-09-11 13:31:45 +02:00
parent 438163a91e
commit f1f39889b7
9 changed files with 219 additions and 109 deletions

View File

@@ -10,6 +10,7 @@ class MyTheme {
late String mode;
late String screenType;
late AssetImage loading;
late TargetPlatform platform;
bool kIsWeb = const bool.fromEnvironment('dart.library.js_util');
// Options:-
// f3f9d2 = Cream
@@ -74,6 +75,19 @@ class MyTheme {
));
}
String getPlatform() {
if (kIsWeb) {
return "Web";
} else if (isPwa()) {
if (platform == TargetPlatform.android) {
return "Android";
} else if (platform == TargetPlatform.iOS) {
return "iOS";
}
}
return "Other";
}
bool isPwa() {
return html.window.matchMedia('(display-mode: standalone)').matches;
}