Files
SpotiFLAC-Mobile/lib/utils/desktop_platform.dart
T
zarzet 840e16e1f4 feat(desktop): add desktop platform check, scroll and theme defaults
Add isDesktopPlatform. Desktop windows skip the tablet UI scaler,
Windows and Linux use Material's clamping scroll with scrollbars while
macOS keeps the bounce, and a first launch without a stored style
starts in Mornye on macOS and Material on Windows and Linux. Mobile
behavior is unchanged.
2026-10-20 13:36:18 +07:00

14 lines
527 B
Dart

import 'dart:io' show Platform;
/// Overrides [isDesktopPlatform] in tests.
bool? debugDesktopPlatformOverride;
// `flutter test` runs on a desktop host; tests see a mobile app unless they
// opt in through [debugDesktopPlatformOverride].
final bool _hostIsDesktop =
!Platform.environment.containsKey('FLUTTER_TEST') &&
(Platform.isMacOS || Platform.isWindows || Platform.isLinux);
/// True in Windows, Linux and macOS builds of the app.
bool get isDesktopPlatform => debugDesktopPlatformOverride ?? _hostIsDesktop;