Skip to content

Added option to link panel content scroll position with SlidingUpPanel scroll position

Compare
Choose a tag to compare
@akshathjain akshathjain released this 26 Jan 02:00
· 41 commits to master since this release

Fixes

  • Addressed issue #69: Used a FadeTransition to handle opacity changes (as per Flutter documentation)
  • Cleaned up PanelController code to make maintenance easier
  • Added clearer assert statements and messages to indicate why calling PanelController methods would fail before attaching the PanelController.

Features

  • Addressed issues #17, #55, #60: Added the ability to link / nested the scroll position of the panel content with the position of the panel (i.e. infinite scrolling).
  • Added the panelBuilder property that's required to implement the nested scrolling as described above.
  • Added an isAttached property to the PanelController to indicate whether or not the PanelController is attached to an instance of the SlidingUpPanel

Breaking Changes

The following PanelController methods now return Future<void> instead of void:

  • close()
  • open()
  • hide()
  • show()
  • animatePanelToPosition(double value)

The following PanelController methods have changed to Dart properties to better reflect Dart language conventions:

  • setPanelPosition() -> panelPosition [as a setter]
  • getPanelPosition() -> panelPosition [as a getter]
  • isPanelAnimating() -> isPanelAnimating
  • isPanelOpen() -> isPanelOpen
  • isPanelClosed() -> isPanelClosed
  • isPanelShown() -> isPanelShown

For example, here's how you would have previously used setPanelPosition() and getPanelPosition() vs. how you would now use the panelPosition property:

// OLD, no longer supported
print(pc.getPanelPosition()); // print a value between 0.0 and 1.0
pc.setPanelPosition(0.5);     // sets the panelPosition to 0.5
// NEW
print(pc.panelPosition); // print a value between 0.0 and 1.0
pc.panelPosition = 0.5;  // sets the panelPosition to 0.5

And here's how you would have previously called isPanelAnimating() vs. how you would now call isPanelAnimating.

panelController.isPanelAnimating(); // OLD, no longer supported
panelController.isPanelAnimating; // NEW

Documentation

  • Updated the documentation to reflect changes
  • Updated example to use nested scrolling