isMobile and isDesktop return false on web
This commit is contained in:
parent
099ae9893d
commit
f74dc5bd68
@ -8,9 +8,9 @@ class PlatformInfo {
|
||||
static const _desktopPlatforms = [TargetPlatform.macOS, TargetPlatform.windows, TargetPlatform.linux];
|
||||
static const _mobilePlatforms = [TargetPlatform.android, TargetPlatform.iOS];
|
||||
|
||||
static bool get isDesktop => _desktopPlatforms.contains(defaultTargetPlatform);
|
||||
static bool get isDesktop => _desktopPlatforms.contains(defaultTargetPlatform) && !kIsWeb;
|
||||
static bool get isDesktopOrWeb => isDesktop || kIsWeb;
|
||||
static bool get isMobile => _mobilePlatforms.contains(defaultTargetPlatform);
|
||||
static bool get isMobile => _mobilePlatforms.contains(defaultTargetPlatform) && !kIsWeb;
|
||||
|
||||
static double get pixelRatio => WidgetsBinding.instance.window.devicePixelRatio;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user