Open sdas19 opened 3 years ago
You can use animatePanelToPosition method available on the panel controller.
animatePanelToPosition(double value, {Duration duration, Curve curve = Curves.linear})
Attach this to to a postframe callback so it gets called after the UI is built.
late final panelController;
void initState() {
super.initState();
panelController = PanelController();
WidgetsBinding.instance.addPostFrameCallback((_) =>
panelController.animatePanelToPosition(yourPosition, duration: Duration(milliseconds: 0))
);
}
The requirement is user should be able to see
sliding_panel
opened by default, not to maxHeight but to a specific position. However, later on, the user can drag the panel within maxHeight and minHeight.Tried several ways to accomplish this,
defaultPanelState
as CLOSED and tried overridingonPanelClosed
to change the panel position by the controller with one time check, howeveronPanelClosed
callback only triggers when the user interacts with the panel for the first time.setState
for this widget to increase themaxHeight
as soon as it is rendered. This solves the issue but the max height change transition experienced by the user is not smooth, it jumps to the maxHeight.Even if there is any other clean way already available to achieve it, please share that as well.