In many instances in Flutter, it's more appropriate to define widgets rather than use builder helper methods. In these instances, projects can enable sort_child_properties_last to ensure that they're styled sensibly. However, in instances where helper methods are appropriate, there's not currently an option to ensure they are styled consistently with this rule.
While it's not out of the question that some developers might want to create non-rendering methods with child keyword arguments, I believe those picky enough to enable the sort_child_properties_last rule would probably also ask for different semantics in code reviews if they saw something like this on a Flutter project (speaking for myself here :innocent:). It might also make sense to enable this check just for methods that return Widgets.
Discussion checklist
[ ] List any existing rules this proposal complements, overlaps or conflict with.
[ ] List any relevant issues (reported here, the SDK Tracker, or elsewhere).
[ ] If there's any prior art (e.g., in other linters), please add references here.
[ ] If this proposal corresponds to Effective Dart or Flutter Style Guide advice, please call it out. (If there isn’t any corresponding advice, should there be?)
[ ] If this proposal is motivated by real-world examples, please provide as many details as you can. Demonstrating potential impact is especially valuable.
sort_child_method_arguements_last
Description
Sort child arguments in widget construction helper methods.
Details
Similar to https://dart-lang.github.io/linter/lints/sort_child_properties_last.html, but for widget building helper methods.
Kind
style
Good Examples
Bad Examples
Discussion
In many instances in Flutter, it's more appropriate to define widgets rather than use builder helper methods. In these instances, projects can enable
sort_child_properties_last
to ensure that they're styled sensibly. However, in instances where helper methods are appropriate, there's not currently an option to ensure they are styled consistently with this rule.While it's not out of the question that some developers might want to create non-rendering methods with
child
keyword arguments, I believe those picky enough to enable thesort_child_properties_last
rule would probably also ask for different semantics in code reviews if they saw something like this on a Flutter project (speaking for myself here :innocent:). It might also make sense to enable this check just for methods that returnWidget
s.Discussion checklist