2022-04-15 16:15:44 +00:00
|
|
|
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() {
|
2022-08-25 20:48:44 +00:00
|
|
|
return (Platform.isLinux || Platform.isWindows || Platform.isMacOS) &&
|
|
|
|
!kIsWeb;
|
2022-04-15 16:15:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|