bottom_sheet_bar 1.0.0+1
bottom_sheet_bar: ^1.0.0+1 copied to clipboard
A toolbar that expands into a bottom sheet
bottom_sheet_bar #
import 'package:bottom_sheet_bar/bottom_sheet_bar.dart';
BottomSheetBar(
expandedBuilder: (scrollController) => ListView.builder(
controller: scrollController,
itemBuilder: (context, index) => ListTile(title: index.toString()),
itemCount: 50,
),
collapsed: Text('Collapsed toolbar widget'),
body: Text('Content overlayed by toolbar and bottom sheet'),
);
BottomSheetBar constructor parameters #
Required
Widget bodyFunction(ScrollController) expandedBuilder
Optional
Widget collapsedBottomSheetBarController controllerColor colordefault: Colors.whiteColor backdropColordefault: Colors.transparentBorderRadius borderRadiusdouble heightdefault: kToolbarHeightbool isDismissabledefault: truebool lockeddefault: trueKey key
BottomSheetBarController #
A BottomSheetBarController can be used to expand and collapse the bottom sheet programatically, listen for changes, and query the current state of the BottomSheetBar
bool get isCollapsed- Returns true if bottom sheet is fully collapsedbool get isExpanded- Returns true if bottom sheet is fully expandedTickerFuture collapse()- Collapse the bottom sheet widget defined byexpandedBuilderTickerFuture expand()- Expand the bottom sheet widget defined byexpandedBuildervoid addListener(Function listener)- Add a listener that is called on every frame of animationvoid removeListener(Function listener)- Removes a previously added listenervoid dispose()
Advanced
void attach(AnimationController animationController)- Used internally to assign theAnimationControllercreated byBottomSheetBarto the controller. Unless you're using advanced animation techniques, you probably won't ever need to use this method.
Example #
A quick demonstration can be found in the example directory. To run the example:
flutter run example/main.dart