-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
BAD:
return AnimatedBuilder(
animation: someAnimation,
builder: _builder,
// no child
);
Widget _builder(BuildContext context, Widget? child) {
return SizedBox(
height: someAnimation.value * someOtherValue,
child: SomeOtherWidget(), // child does not need the value of the animation
);
}GOOD:
return AnimatedBuilder(
animation: someAnimation,
builder: _builder,
child: SomeOtherWidget(),
);
Widget _builder(BuildContext context, Widget? child) {
return SizedBox(
height: someAnimation.value * someOtherValue,
child: child,
);
}Similar for ValueListenableBuilder, but that one might be easier because the actual value we're interested in is part of the method signature (so no need to correlate someAnimation as in the AnimatedBuilder).
/cc @Hixie
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug