widget_backdrop 1.0.0
widget_backdrop: ^1.0.0 copied to clipboard
A Material Design backdrop widget with a draggable front layer, a controller API, content-sized front layers, and home-indicator safe area support.
Changelog #
1.0.0 #
Initial stable release.
Backdropwidget implementing the Material Design backdrop pattern: a back layer plus a front layer that opens and closes by tapping or dragging itsfrontHeader(a Material-style drag handle by default).BackdropControllerfor opening, closing, and toggling the front layer programmatically and listening to open/closed changes.FrontLayerFit.contentto size the front layer to its child, so an open front layer covers only as much of the back layer as it needs (FrontLayerFit.expandfills the backdrop).useSafeArea(on by default) reserves the bottom view padding — the home indicator area on modern iPhones — for the front header when closed, and keeps the open front layer below the top view padding so the header never disappears under the status bar. The insets reach the front header and content throughMediaQuery, soSafeAreawidgets and scrollables inside them avoid the insets while backgrounds stay edge-to-edge.- Dragging moves the front layer in exact lockstep with the finger (deltas and fling velocities are normalized by the real travel distance, not the full backdrop height).
durationandcurveconfigure the open/close animation for taps and controller calls; drags released with momentum settle with a physics fling based on the release velocity.
