Add package_info: ^0.4.0+3 in pubspec.yaml file of your project.
below
dependencies:
flutter:
sdk: flutter
package_info: ^0.4.0+3
Using next code sample you can retrieve the details.
Future<List<String>> getDeviceDetails() async {
String deviceName;
String deviceVersion;
String identifier;
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
try {
if (Platform.isAndroid) {
var build = await deviceInfoPlugin.androidInfo;
deviceName = build.model;
deviceVersion = build.version.toString();
identifier = build.androidId; //UUID for Android
} else if (Platform.isIOS) {
var data = await deviceInfoPlugin.iosInfo;
deviceName = data.name;
deviceVersion = data.systemVersion;
identifier = data.identifierForVendor; //UUID for iOS
}
} on Exception catch (e) {
print('Failed to get platform version ${e.toString()}');
}
return [deviceName, deviceVersion, identifier];
}
For Iphone it returns
[iPhone Xʀ, 12.2, 0EE6BD4D-FB32-4283-B9C2-BD235DD421CF]