Skip to content

fix(device_info_plus): match Mac mini identifiers on macOS - #4026

Open
yeegz wants to merge 1 commit into
fluttercommunity:mainfrom
yeegz:fix/4017-macmini-model-names
Open

yeegz wants to merge 1 commit into
fluttercommunity:mainfrom
yeegz:fix/4017-macmini-model-names

Conversation

@yeegz

@yeegz yeegz commented Nov 18, 2026

Copy link
Copy Markdown

Description

hw.model returns Macmini9,1 (lowercase m), but the lookup table had MacMini9,1. Swift string matching is case-sensitive, so Mac minis from 2012 to 2020 showed up as "Unknown Model". This just fixes the four case lines. The other model families were already correct.

I tested it by compiling DeviceIdentifiers.swift with a small script: before the change all five Mac mini IDs gave "Unknown Model", and after it they give the right names. There's no Swift test target for this file, but I can add one if you want.

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing. (Swift-only change; I didn't run the Dart tests.)
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

hw.model reports Mac minis as "Macmini<N>,<M>" (lowercase "m"), but the
lookup table used "MacMini", so modelName fell through to "Unknown Model"
for Mac mini 2012-2020. Use the identifiers as reported.

Fixes fluttercommunity#4017

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: macOS modelName returns "Unknown Model" for Mac mini (case mismatch in identifier table)

1 participant