felangel / flow_builder

Flutter Flows made easy! A Flutter package which simplifies navigation flows with a flexible, declarative API.
https://pub.dev/packages/flow_builder
MIT License
389 stars 63 forks source link

`addListener` and `removeListener` are missing `super` call enforcement #54

Closed narcodico closed 2 years ago

narcodico commented 2 years ago

Describe the bug When overriding addListener and/or removeListener in a custom FlowController, the user can remove the super call, thus resulting in the listener never being called, because the listener doesn't get registered with the internal ValueNotifier.

To Reproduce Steps to reproduce the behavior:

  1. Create a custom FlowController
  2. Override addListener and/or removeListener
  3. Remove the super call/s
  4. Note that changes to the flow state won't result in listener/s being invoked

Expected behavior The user should get a warning when removing/omitting super calls with addListener and removeListener.