mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-11-29 07:34:13 +01:00
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.
14 lines
527 B
Dart
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;
|