搜尋套件、儲存庫與 APP 分類

套件詳情v2.3.0

ios_utsname_ext

用於將 iOS utsname 轉換為完整產品名稱的擴展方法。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
3.8萬
喜歡數
24
Pub 分數
150

安裝套件

flutter pub add ios_utsname_ext

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

ios_utsname_ext 套件提供了一個擴展方法,可將 iOS 裝置的 utsname(系統資訊)轉換為人類可讀的完整產品名稱。它簡化了從底層系統資料中識別確切裝置型號的過程,對於分析、除錯或個人化使用者體驗非常有用。該套件適用於所有 Flutter 平台,包括 iOS、Android、Web、macOS、Windows 和 Linux,使跨平台應用更具彈性。它輕量級且設計用於無縫整合,設定簡單。

適用情境

  • 分析中的設備識別
  • 除錯裝置特定問題
  • 根據硬體個性化使用者體驗
  • 跨平台設備檢測
  • 在應用設定中顯示準確的裝置名稱

主要特色

  • utsname 轉換的擴展方法
  • 支援所有 Flutter 平台
  • 輕量且易於整合
  • 將 utsname 準確對應至產品名稱
  • 無外部依賴

適合對象

  • 開發跨平台應用的開發者
  • 需要精確設備識別的应用
  • 分析與除錯工具
  • 面向使用者的裝置資訊顯示

使用建議

  • 依賴iOS提供的準確utsname資料
  • 僅限iOS設備名稱(不適用於其他平台)
  • 可能需要執行時存取系統資訊
  • 非設備特定功能不需要

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

ios_utsname_ext

pub package build Buy Me A Coffee

Extension method for translation ios utsname to full product name (e.g. iPhone 6 Plus for 'iPhone7,1').

Why this extension package?

When using the device_info package you get the following (extract from the readme file):

import 'package:device_info/device_info.dart';

DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
print('Running on ${androidInfo.model}');  // e.g. "Moto G (4)"

IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
print('Running on ${iosInfo.utsname.machine}');  // e.g. "iPhone7,1"

As you can see, for Android you get a rather good product name. But for iOS... you get iPhone7,1'. This extension package gives you the real product name by adding .iOSProductName`:

import 'package:ios_utsname_ext/extension.dart';

...

print('Running on ${iosInfo.utsname.machine.iOSProductName}');  // will give you `iPhone 6 Plus`

Source of product models

The list is maintained at https://github.com/fieldnotescommunities/ios-device-identifiers. The repo provides an updated .json file.

Based upon that .json file the code for this extension package is generated. When the repo is updated this package will be updated.

API Documentation

API documentation can be found here

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。