Added option to link panel content scroll position with SlidingUpPanel scroll position
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 thePanelController
.
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 thePanelController
to indicate whether or not thePanelController
is attached to an instance of theSlidingUpPanel
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