mcrovero / rubber

An elastic material bottom sheet implementation for Flutter.
BSD 2-Clause "Simplified" License
562 stars 88 forks source link

Make listeners work #73

Closed joachimbulow closed 1 year ago

joachimbulow commented 1 year ago

Is your feature request related to a problem? Please describe. It is hard to make custom functionality that depends on sheet state work without the listeners emitting values.

Describe the solution you'd like When the controller animation value changes, please let it emit values so we can attach listeners. E.g. i want to blur out the lowerLayer, which i cannot really do while the listeners do not work, without manual work.

Really makes the library almost useless

E.g.


  @override
  void initState() {
    super.initState();
    controller = RubberAnimationController(
      vsync: this,
      lowerBoundValue: AnimationControllerValue(pixel: 0),
      upperBoundValue: AnimationControllerValue(percentage: 0.9),
      duration: Duration(milliseconds: 200),
    );

    controller.addListener(() {
      // Do my custom stuff
    });
joachimbulow commented 1 year ago

Nvm