Flutter - Get/Set Android and IOS device name for Bluetooth/Wifi/Hotspot discovery

832 Views Asked by At

I tried to use the device_info_plus package but I could not find any options for getting or setting the Android or Ios device user name so that it appears as Someone's Iphone on wifi/bluetooth discovery. Is not there any method to achieve that?

1

There are 1 best solutions below

1
On
import 'package:device_info/device_info.dart';

DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
print('Running on ${androidInfo.model}');  // e.g. "Moto G (4)"

IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
print('Running on ${iosInfo.utsname.machine}');  // e.g. "iPod7,1"