Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-29 12:47:14 +08:00
parent e185ed1a85
commit e0ae93847b
104 changed files with 480 additions and 389 deletions

View File

@@ -0,0 +1,21 @@
import 'package:PiliPlus/utils/platform_utils.dart';
import 'package:flutter/widgets.dart' show WidgetsBinding, Size;
abstract final class DeviceUtils {
static late int sdkInt;
static bool get isTablet {
return size.shortestSide >= 600;
}
static Size get size {
final view = WidgetsBinding.instance.platformDispatcher.views.first;
return view.physicalSize / view.devicePixelRatio;
}
static String get platformName => PlatformUtils.isDesktop
? 'desktop'
: isTablet
? 'pad'
: 'phone';
}