apple_product_name 1.3.0 apple_product_name: ^1.3.0 copied to clipboard
Library for translation apple device identifier to product name (e.g. 'iPhone13,2' to 'iPhone 12')
apple_product_name #
Library for translation apple device identifier to product name (e.g. 'iPhone13,2' to 'iPhone 12')
iOS | macOS |
---|---|
Usage #
Translates machine id to product name.
You can use this package with device_info_plus package.
import 'package:apple_product_name/apple_product_name.dart';
if (Platform.isIOS) {
final info = await DeviceInfoPlugin().iosInfo;
print(info.utsname.machine); // "iPhone13,2"
print(info.utsname.productName); // "iPhone 12"
} else if (Platform.isMacOS) {
final info = await DeviceInfoPlugin().macOsInfo;
print(info.model); // "iMac21,1"
print(info.productName); // "iMac (24-inch, M1, 2021)"
}
Also, you can use without device_info_plus package dependency.
AppleProductName().lookup('iPad13,10')
// iPad Pro 5th Gen (12.9 inch, WiFi+Cellular)