Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyle-seongwoo-jun/flutter_apple_product_name
Library for translating Apple machine identifiers into Apple product names (e.g. 'iPhone15,2' to 'iPhone 14 Pro')
https://github.com/kyle-seongwoo-jun/flutter_apple_product_name
apple flutter flutter-package flutter-plugin ios macos osx
Last synced: 16 days ago
JSON representation
Library for translating Apple machine identifiers into Apple product names (e.g. 'iPhone15,2' to 'iPhone 14 Pro')
- Host: GitHub
- URL: https://github.com/kyle-seongwoo-jun/flutter_apple_product_name
- Owner: kyle-seongwoo-jun
- License: mit
- Created: 2021-07-15T20:00:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-17T07:36:31.000Z (7 months ago)
- Last Synced: 2024-04-24T06:44:45.367Z (7 months ago)
- Topics: apple, flutter, flutter-package, flutter-plugin, ios, macos, osx
- Language: Dart
- Homepage: https://pub.dev/packages/apple_product_name
- Size: 2.6 MB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# apple_product_name
[![pub package](https://img.shields.io/pub/v/apple_product_name)](https://pub.dev/packages/apple_product_name)
[![pub points](https://img.shields.io/pub/points/apple_product_name?color=2E8B57&label=pub%20points)](https://pub.dev/packages/apple_product_name/score)
[![pub popularity](https://img.shields.io/pub/popularity/apple_product_name)](https://pub.dev/packages/apple_product_name/score)
[![flutter ci](https://github.com/kyle-seongwoo-jun/flutter_apple_product_name/actions/workflows/flutter.yml/badge.svg)](https://github.com/kyle-seongwoo-jun/flutter_apple_product_name/actions/workflows/flutter.yml)Library for translating Apple machine identifiers into Apple product names (e.g. `iPhone17,1` to `iPhone 16 Pro`)
| iOS | macOS |
| -------------- | ---------------- |
| ![ios image][] | ![macos image][] |## Usage
Translates machine id to product name.
You can use this package with [device_info_plus](https://pub.dev/packages/device_info_plus) package.
```dart
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); // "iPhone17,1"
print(info.utsname.productName); // "iPhone 16 Pro"
} else if (Platform.isMacOS) {
final info = await DeviceInfoPlugin().macOsInfo;
print(info.model); // "Mac14,2"
print(info.productName); // "MacBook Air (M2, 2022)"
}
```Or you can use `AppleProductName` class directly without `device_info_plus` package.
```dart
AppleProductName().lookup('iPad16,5')
// iPad Pro 13-inch (M4)
```## Source
- [kyle-seongwoo-jun/apple-device-identifiers](https://github.com/kyle-seongwoo-jun/apple-device-identifiers)
[ios image]: https://raw.githubusercontent.com/kyle-seongwoo-jun/flutter_apple_product_name/main/images/ios.png
[macos image]: https://raw.githubusercontent.com/kyle-seongwoo-jun/flutter_apple_product_name/main/images/macos.png