apple_product_name 1.0.0
apple_product_name: ^1.0.0 copied to clipboard

Library for translation apple device identifier to product name (e.g. 'iPhone13,2' to 'iPhone 12')

apple_product_name #

pub package

Library for translation apple device identifier to product name (e.g. 'iPhone13,2' to 'iPhone 12')

iOSmacOS
ios imagemacos image

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;
  info.utsname.machine     // "iPhone13,2"
  info.utsname.productName // "iPhone 12"
} else if (Platform.isMacOS) {
  final info = await DeviceInfoPlugin().macOsInfo;
  info.model       // "iMac21,1"
  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)

Sources #

0
likes
120
pub points
36%
popularity

Library for translation apple device identifier to product name (e.g. 'iPhone13,2' to 'iPhone 12')

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

device_info_plus, flutter

More

Packages that depend on apple_product_name