GithubHelp home page GithubHelp logo

althurzard / device_name Goto Github PK

View Code? Open in Web Editor NEW

This project forked from edasandesu/device_name

0.0 0.0 0.0 34 KB

A Flutter package for getting device name from device identifier.

License: MIT License

Dart 100.00%

device_name's Introduction

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}

In your library add the following import:

import 'package:device_name/device_name.dart';

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
}

Reference

Models - The iPhone Wiki Apple_mobile_device_types.txt

device_name's People

Contributors

edasandesu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.