I'm using device_info_plus plugin to get device info but I couldn't get the model name.
the device name is changing and the
utsname.machine
don't give me the right name
what to do to get the right device name in a flutter project.
How about using apple_product_name package?
import 'package:apple_product_name/apple_product_name.dart';
import 'package:device_info_plus/device_info_plus.dart';
if (Platform.isIOS) {
final info = await DeviceInfoPlugin().iosInfo;
print(info.utsname.machine); // "iPhone15,2"
print(info.utsname.productName); // "iPhone 14 Pro"
}
You can get the model name of iOS devices.
FYI, I'm author of this package.
For those who face such an issue I used Apple's mobile device codes to display the device model name from the machine code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With