0 purchases
device name
device_name #
A Flutter package for getting device name from device identifier.
Getting Started #
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
flutter:
sdk:
device_name: ^{latest_version}
copied to clipboard
In your library add the following import:
import 'package:device_name/device_name.dart';
copied to clipboard
Usage #
Import package:device_name/device_name.dart, instantiate DeviceName and use iOS getters to get device name.
You can get the device identifier from device_info.
Get utsname.machine from iosInfo.
import 'package:device_name/device_name.dart';
Future<void> main() async {
final identifier = 'iPhone13,4';
final deviceName = DeviceName();
print('device name is ${deviceName.ios(identifier)}');
// device name is iPhone 12 Pro Max
print('device name is ${await deviceName.apple(identifier)}');
// device name is iPhone 12 Pro Max
}
copied to clipboard
Reference #
Models - The iPhone Wiki
Apple_mobile_device_types.txt
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.