Skip to content

Commit

Permalink
Address CR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronlademann-wf committed Dec 19, 2023
1 parent 1bf39c4 commit d36a656
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions lib/src/dart3_suggestors/null_safety_prep/required_flux_props.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ class RequiredFluxProps extends RecursiveAstVisitor with ClassSuggestor {
.whereType<MethodDeclaration>()
.firstOrNull
?.name
.value()
.toString()
.contains(RegExp(r'getDefaultProps|defaultProps')) ==
true;
.lexeme
.contains(RegExp(r'getDefaultProps|defaultProps')) ??
false;
if (isReturnedAsDefaultProps) return;

final maybeFluxUiPropsMixin = cascadeWriteEl.mixins
Expand Down Expand Up @@ -86,15 +85,7 @@ class RequiredFluxProps extends RecursiveAstVisitor with ClassSuggestor {
}

void yieldNewCascadeSection(CascadeExpression node, String newSection) {
final sf = context.sourceFile;
final targetLineOffset = sf.getOffset(sf.getLine(node.target.offset));
int offset;
if (targetLineOffset == sf.getOffset(sf.getLine(node.target.end))) {
// Cascade on a single line / same line as the target, add the new setter(s) before the semicolon
offset = node.target.end;
} else {
offset = sf.getOffsetOfLineAfter(node.target.offset);
}
final offset = node.target.end;
yieldPatch(newSection, offset, offset);
}

Expand Down

0 comments on commit d36a656

Please sign in to comment.