Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect whether the device is phone, tablet or tv on flutter

Tags:

flutter

dart

I want to know whether the used device is tv or not..I am using flutter_device_type package but it only detects the tablet and consider any other device as phone

like image 517
Emam Avatar asked Sep 15 '25 20:09

Emam


1 Answers

You can use the device_info_plus package for detecting Android TV.

The AndroidDeviceInfo class contains a list of all the system's features as documented in the Android PackageManager

For detecting TV, you can use e.g:

DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
bool isTV = androidInfo.systemFeatures.contains('android.software.leanback')
like image 126
mtkopone Avatar answered Sep 18 '25 14:09

mtkopone