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 loadDeviceInfo() async { WidgetsFlutterBinding.ensureInitialized(); DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; _isTV = androidInfo.systemFeatures.contains('android.software.leanback_only'); } bool isTV() { return _isTV; }