Thanks!
Actually, I am contributing to
dart-code-metrics package.
SimpleIdentifier's
staticElement helped me with
BorderRadius.circular(_value).
But, I have a question about
BinaryExpression:
I should check, wherer result of binary expression is const.
Example:
ClipRRect(borderRadius: BorderRadius.circular(_constValue - _constValue)), // LINT
ClipRRect(borderRadius: BorderRadius.circular(_constValue - _finalValue)),
I wrote some code, but it doesn't work the way i thought.
My thought was to use element's isConstantEvaluated.
But, (
_constValue - _finalValue)'s isConstantEvaluated returns true.
So, I get false positive linting if binary expression result is not a const.
Is there any other way to check whether result of binary expression is const?
среда, 29 сентября 2021 г. в 22:10:25 UTC+3, brianwilkerson: