Files
stream-chat-flutter/packages/stream_chat_flutter/lib/src/utils/device_segmentation.dart
T
2023-05-08 18:22:54 +05:30

29 lines
1.0 KiB
Dart

import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
/// Returns true if the app is running on web.
bool get isWeb => CurrentPlatform.isWeb;
/// Returns true if the app is running in a mobile device.
bool get isMobileDevice => true;
/// Returns true if the app is running in a desktop device.
bool get isDesktopDevice =>
CurrentPlatform.isMacOS ||
CurrentPlatform.isWindows ||
CurrentPlatform.isLinux;
/// Returns true if the app is running on windows or linux platform.
bool get isDesktopVideoPlayerSupported =>
// Dart VLC is not supported on MacOS.
!CurrentPlatform.isMacOS &&
(CurrentPlatform.isWindows || CurrentPlatform.isLinux);
/// Returns true if the app is running in a mobile or web.
bool get isMobileDeviceOrWeb => isWeb || isMobileDevice;
/// Returns true if the app is running in a desktop or web.
bool get isDesktopDeviceOrWeb => false;
/// Returns true if the app is running in a flutter test environment.
bool get isTestEnvironment => CurrentPlatform.isFlutterTest;