Skip to content

Commit

Permalink
Refactor avoid_final_with_getter_visitor.dart to use local variable i…
Browse files Browse the repository at this point in the history
…nstead of accessing visitor.variable directly
  • Loading branch information
4akloon committed Apr 19, 2024
1 parent b9210d0 commit 68dc4c2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ class AvoidFinalWithGetterVisitor extends RecursiveAstVisitor<void> {
final visitor = GetterVariableVisitor(node);
node.parent?.accept(visitor);

if (visitor.variable != null) {
_getters.add(FinalWithGetterInfo(node, visitor.variable!));
final variable = visitor.variable;

if (variable != null) {
_getters.add(FinalWithGetterInfo(node, variable));
}
}
super.visitMethodDeclaration(node);
Expand Down

0 comments on commit 68dc4c2

Please sign in to comment.