搜索插件、代码仓与 APP 分类

插件详情v2.0.6

device_marketing_names

轻松查找 Android、iOS 和浏览器的设备营销名称。无需互联网连接或数据库。

AndroidiOSWeb
近 30 天下载
4.3万
喜欢数
46
Pub 分数
160

安装插件

flutter pub add device_marketing_names

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个轻量级的 Flutter 包,可在无需互联网连接或外部数据库的情况下,轻松查找 Android、iOS 和 Web 浏览器的设备营销名称。它基于用户代理字符串和系统属性提供准确的设备标识符,非常适合用于分析、调试或个性化用户体验。该包自包含且高效,确保跨平台的快速性能。

适合场景

  • 分析中的设备识别
  • 用户体验个性化
  • 调试设备特定问题
  • 在应用中显示设备名称
  • 兼容性检查

主要特点

  • 无需互联网
  • 跨平台支持
  • 离线数据库
  • 简单 API
  • 准确的设备命名

适合对象

  • 分析集成
  • 开发者工具
  • 应用诊断
  • 面向用户的设备信息
  • 跨平台应用

使用建议

  • 仅限已知设备
  • 不会动态更新
  • 依赖内置设备列表
  • 不适用于实时设备检测
  • 可能会遗漏较新或小众的设备

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Pub Version codecov GitHub Workflow Status GitHub likes pub downloads pub points Main

Device Marketing Names

A simple device name lookup package. Map e.g. 'iPhone13,4' to 'iPhone 12 Pro Max' or 'SM-G980F' to 'Galaxy S20'. No internet connection or database required.

Open in IDX

Features

  • Lookup Android marketing names
  • Lookup iOS (iPhone & iPad) marketing names
  • Lookup web browser names
  • Get the marketing name of the current device or by an already known Android or iOS model
  • Relies on device_info_plus to get the current device model information on Android or iOS and device_identifiers which maps those to the marketing names
  • The browser name is mapped via web and prettified within this library

Usage

Getting Started

Add this to your package's pubspec.yaml file:

dependencies:
  device_marketing_names: ^2.0.3

More information on pub.dev.

Examples

For full examples please see the example app.

final deviceNames = DeviceMarketingNames();

// Get one marketing name of the device.
final singleDeviceName = await deviceNames.getSingleName();

// Get all marketing names of the device.
final allDeviceNames = await deviceNames.getNames();

// Get one marketing name for the given model.
final singleDeviceNameFromModel = deviceNames.getSingleNameFromModel(DeviceType.android, "ONEPLUS A5010");

// Get all marketing names for the given model.
final allDeviceNamesFromModel = deviceNames.getNamesFromModel(DeviceType.android, "ONEPLUS A5010");
Migration from 0.3.0 to 0.4.0
  • Replace getMarketingName() with getSingleName() if you want to get exactly one matching name.
  • Replace getMarketingName() with getNames() if you want all matching names as a single string. Names are separated by " / ".
  • Replace getMarketingNameFromModel() with getSingleNameFromModel() if you want to get exactly one matching name.
  • Replace getMarketingNameFromModel() with getNamesFromModel() if you want all matching names as a single string. Names are separated by " / ".

How to contribute

If you are interested in contributing, please have a look into the contribution guide. Every idea, bug report or line of code is heavily appreciated.

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目