Reputation: 18790
I am upgrading an older app from Flutter 2 to Flutter 3, and one problem I have encountered is that the TextButton.icon()
goes crazy if child
is a Flexible
. This did not happen with FlatButton.icon()
, which worked just fine.
So I'm wondering if there is a way to use the Dart analyzer to my advantage, to prevent the code from even compiling if I'm passing a Flexible()
as a child to TextButton.icon()
anywhere in the code?
I know that of course I can search and replace in the code, but I'm more interested to know if the Dart analyzer can be used to perform this kind of analysis somehow?
Upvotes: -2
Views: 31
Reputation: 44186
You can use the custom_lint package to write custom lints to do whatever you want. It's a nice simplification (and documentation!) of the existing analyzer API, but apparently much easier to write it to do what you want. You can even write "quick fixes" if you desire.
Upvotes: 0