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

Libraries

apple_product_name