[Bug]: macOS modelName returns "Unknown Model" for Mac mini (case mismatch in identifier table)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 91/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Trong DeviceIdentifiers.swift, các mục Mac mini sử dụng những mã định danh như "MacMini9,1", trong khi issue báo cáo rằng hw.model trả về "Macmini9,1". Đọc bảng tra cứu và xác nhận switch xử lý các chuỗi này như thế nào. Công việc hoàn tất khi các mã định danh bị ảnh hưởng khớp với cách viết hoa thường được báo cáo và tên mẫu Mac mini được phân giải chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Platform
macOS
Plugin
device_info_plus
Version
13.3.0
Flutter SDK
3.47.5
Steps to reproduce
On a Mac mini (M1, 2020), MacOsDeviceInfo.modelName returns "Unknown Model", even though the device's identifier is in the lookup table.
hw.model reports the identifier as Macmini9,1 (lowercase "m" in "mini"). In DeviceIdentifiers.swift the Mac mini entries are written with an uppercase "M":
case "MacMini6,1", "MacMini6,2": return "Mac mini (2012)"
case "MacMini7,1": return "Mac mini (2014)"
case "MacMini8,1": return "Mac mini (2018)"
case "MacMini9,1": return "Mac mini (2020)"
Swift switch compares strings case-sensitively, so "Macmini9,1" doesn't match "MacMini9,1" and the lookup falls through to default: return "Unknown Model".
Steps to reproduce
Run any app that uses DeviceInfoPlugin().macOsInfo on a Mac mini with an identifier of Macmini6,x to Macmini9,1.
Read model and modelName.
Actual
model: Macmini9,1
modelName: Unknown Model
Expected
model: Macmini9,1
modelName: Mac mini (2020)
Suggested fix
Change the five MacMini identifiers in DeviceIdentifiers.swift to Macmini, matching the value hw.model returns:
case "Macmini6,1", "Macmini6,2": return "Mac mini (2012)"
case "Macmini7,1": return "Mac mini (2014)"
case "Macmini8,1": return "Mac mini (2018)"
case "Macmini9,1": return "Mac mini (2020)"
Newer Mac mini models (Mac14,3, Mac14,12, Mac16,10, Mac16,11) use the MacNN,N format and aren't affected.
Code Sample
Logs
No exception is thrown. Minimal output from `DeviceInfoPlugin().macOsInfo` on a Mac mini (M1, 2020):
model: Macmini9,1
modelName: Unknown Model
arch: arm64
majorVersion: 27
minorVersion: 0
patchVersion: 1
osRelease: Version 27.0.1 (Build 26A434)
Flutter Doctor
[✓] Flutter (Channel stable, 3.47.5, on macOS 27.0.1 26A434 darwin-arm64, locale en-US)
• Flutter version 3.47.5 on channel stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 6a19cca564 (8 weeks ago), 2026-09-17 14:13:22 -0400
• Engine revision af7e796e16
• Dart version 3.13.4
• DevTools version 2.60.0
[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
• Platform android-37.0, build-tools 36.1.0
• Java version OpenJDK Runtime Environment (build 21.0.6+-13368085-b895.109)
! Some Android licenses not accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 27.2)
• Build 27B52
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web
[✓] Connected device (3 available)
• Pixel 8 (mobile) • <redacted> • android-arm64 • Android 17 (API 37)
• macOS (desktop) • macos • darwin-arm64 • macOS 27.0.1 26A434 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 157.0.8103.78
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
Checklist before submitting a bug
- I searched issues in this repository and couldn't find such bug/problem
- I Google'd a solution and I couldn't find it
- I searched on StackOverflow for a solution and I couldn't find it
- I read the README.md file of the plugin
- I'm using the latest version of the plugin
- All dependencies are up to date with
flutter pub upgrade - I did a
flutter clean - I tried running the example project
- Ngôn ngữ chính
- Dart
- Star
- 1.9k
- Fork
- 1.3k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fluttercommunity/plus_plugins
-
[Bug]: Docs not reachableĐang mởbug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
fluttercommunity/plus_plugins#4018 ·
-
[Bug]: (share_plus) iOS drops the subject when sharing a uriCó thể đã có người làm @kaluli123123 đã nhận 43 ngày trước. Đang mởbug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
fluttercommunity/plus_plugins#3994 · 1 bình luận ·
-
enhancement triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
fluttercommunity/plus_plugins#4019 ·
-
question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
fluttercommunity/plus_plugins#4015 ·
-
[Bug]: device_info_plus on Linux keeps the single quotes from os-release (Gentoo)Có thể đã có người làm @ChandraChaan đã nhận 20 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
fluttercommunity/plus_plugins#4011 ·
Tất cả issue của fluttercommunity/plus_plugins
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
OscillateLabsLLC/ovos-gui-visage#52 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: add per-harness setup docsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
VeryGoodOpenSource/vgv_ai_cli#150 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
PATILYASHH/XPENC#206 · 1 bình luận ·
-
Bug Dart
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-dart#4167 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
lichess-org/mobile#4039 ·
Maintainer thường phản hồi trong vòng 1 ngày