pin_code_fields icon indicating copy to clipboard operation
pin_code_fields copied to clipboard

Confusing naming for errorAnimationController

Open Alex-Usmanov opened this issue 2 years ago • 1 comments

The name of the field errorAnimationController is quite confusing.

First of all, Flutter SDK already ships with a class called AnimationController, which is used to control animation. This field has nothing to do with AnimationController, is actually a StreamController that dispatches animation types for the field.

I suggest renaming for this field to prevent muddling up with AnimationController, which makes the API less intuitive. Instead, I would call it something along errorAnimationTypeController, or errorAnimationTypeStreamController.

(Also, use of StreamControllers as parameters in widgets is uncommon in the widgets library that is shipped with the framework. Instead, the SDK conforms to the pattern of Controllers, like TextEditingController, that use functions instead of reactive programming => easier to grasp for beginners)

Alex-Usmanov avatar Jul 02 '22 18:07 Alex-Usmanov

The name of the field errorAnimationController is quite confusing.

First of all, Flutter SDK already ships with a class called AnimationController, which is used to control animation. This field has nothing to do with AnimationController, is actually a StreamController that dispatches animation types for the field.

I suggest renaming for this field to prevent muddling up with AnimationController, which makes the API less intuitive. Instead, I would call it something along errorAnimationTypeController, or errorAnimationTypeStreamController.

(Also, use of StreamControllers as parameters in widgets is uncommon in the widgets library that is shipped with the framework. Instead, the SDK conforms to the pattern of Controllers, like TextEditingController, that use functions instead of reactive programming => easier to grasp for beginners)

Since you have all this knowledge you can make the changes you see are needed and make PR to the maintainer. Which is the beauty of the open source.

Add00w avatar Jul 26 '22 08:07 Add00w

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 24 '22 10:09 stale[bot]