RuchDi
RuchDi

Reputation: 488

How to get android device name in Flutter?

I try to get android Device name.

Now I am using package device_info_plus v4.1.2, but it can't get this info.

enter image description here

DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;

Output

print('Running on Product ${androidInfo.product}'); --show sdk_gphone_x86_arm
print('Running on Board ${androidInfo.board}'); --show oldfish_x86
print('Running on Device ${androidInfo.device}'); --show generic_x86_arm
print('Running on Model ${androidInfo.model}'); --show AOSP on IA Emulator

Could you guys recommend the other one that can get that info?

Upvotes: 1

Views: 1340

Answers (1)

Just a Person
Just a Person

Reputation: 1600

In device_info_plus package after getting the android info, read the values board and product.

Like this:

import 'package:device_info_plus/device_info_plus.dart';

DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
print('Running on ${androidInfo.product}');
print('Running on ${androidInfo.board}');

Upvotes: -1

Related Questions