Reputation: 335
Guys I am trying to get the name of the user who uses the phone. Is there any flutter plugin which can provide me this functionality
Upvotes: 3
Views: 1485
Reputation: 191
Hello you can use this plugin device_info, you can see the documentation about it here : https://pub.dev/packages/device_info#-example-tab-
import 'package:device_info/device_info.dart';
void getDeviceinfo() async {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidDeviceInfo = await deviceInfo.androidInfo; // instantiate Android Device Information
IosDeviceInfo iosInfo = await deviceInfo.iosInfo; // instantiate IOS Device Information
print("for Android : ${androidDeviceInfo.product}");
print("for IOS : ${iosInfo.name}");
}
Upvotes: 4