joo6077 / cool_dropdown

MIT License
18 stars 18 forks source link

Please dispose all AnimationControllers #14

Closed Eerey closed 1 year ago

Eerey commented 1 year ago

drop_down_body.dart

My proposal:

  @override
  void dispose() {
    _animationController.dispose();
    _triangleController.dispose();
    _scrollController.dispose();
    for (final anim in _DCController) {
      anim.dispose();
    }
    super.dispose();
  }
Eerey commented 1 year ago

Also, there are two list of animation controllers that are basically the same:

final List _DCController = []; final List _paddingController = [];

It's hard to follow the logic if both lists have the same objects.

joo6077 commented 1 year ago

Yeah I need to refactory this old code. I have been planned to refactory overall of this library soon.

Thank you for letting me know tho!