App license is not sorted at the top in licenses shown in LicensePage
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
The `LicensePage` seems to have special handling for the app license, see https://github.com/flutter/flutter/blob/3.16.9/packages/flutter/lib/src/material/about.dart#L704-L706 and https://github.com/flutter/flutter/blob/3.16.9/packages/flutter/lib/src/material/about.dart#L731-L749. It assumes the first license that it gets from `LicenceRegistry.licenses` is the application package, but this is not the case. The licenses in the asset NOTICES.Z are already sorted in a way, and the application package is not the first one. What this means that there is no way to make the app license to appear on top; if it is named so that it is sorted first, it will still be sorted second (unless the package really sorts as the very first one, which is unlikely as it would require it to have a name starting with `_`).
This behavior (showing the app package as first) is actually never advertised here: https://api.flutter.dev/flutter/material/LicensePage-class.html, this behavior is only mentioned in code. So maybe just removing the code (because it is confusing for readers, as it just doesn't work as its comments say) is the fix?
Contributor guide
Assessment
This issue has not been assessed yet.