fluffychat/lib/utils/platform_infos.dart

22 lines
624 B
Dart
Raw Normal View History

2020-09-26 20:27:15 +02:00
import 'dart:io';
import 'package:flutter/foundation.dart';
abstract class PlatformInfos {
static bool get isWeb => kIsWeb;
2020-10-04 16:11:18 +02:00
2020-11-22 22:48:10 +01:00
static bool get isCupertinoStyle =>
!kIsWeb && (Platform.isIOS || Platform.isMacOS);
2020-09-26 20:27:15 +02:00
static bool get isMobile => !kIsWeb && (Platform.isAndroid || Platform.isIOS);
2020-10-04 16:11:18 +02:00
/// For desktops which don't support ChachedNetworkImage yet
static bool get isBetaDesktop =>
!kIsWeb && (Platform.isWindows || Platform.isLinux);
2020-10-28 08:05:10 +01:00
static bool get isDesktop =>
!kIsWeb && (Platform.isLinux || Platform.isWindows || Platform.isMacOS);
2020-09-26 20:27:15 +02:00
static bool get usesTouchscreen => !isMobile;
}