OpenMediacenterMobileFlutter/lib/platform.dart
lukas-heiligenbrunner a7757b14dd format, lint
outsource preview table in several function
revert android compile version
2022-08-25 22:48:44 +02:00

24 lines
606 B
Dart

import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
bool _isTV = false;
bool isDesktop() {
return (Platform.isLinux || Platform.isWindows || Platform.isMacOS) &&
!kIsWeb;
}
Future<void> loadDeviceInfo() async {
WidgetsFlutterBinding.ensureInitialized();
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
_isTV = androidInfo.systemFeatures.contains('android.software.leanback_only');
}
bool isTV() {
return _isTV;
}