KFDrawer class

A side menu that translates and scales its content to reveal drawer items.

Inheritance

Constructors

KFDrawer({Key? key, Widget? header, Widget? footer, Widget? content, KFDrawerDirection direction = KFDrawerDirection.start, List<KFDrawerItem> items = const <KFDrawerItem>[], KFDrawerController? controller, BoxDecoration? decoration, double? drawerWidth, double? minScale, double? borderRadius, double? shadowBorderRadius, double? shadowOffset, bool scrollable = true, EdgeInsets? menuPadding, bool disableContentTap = true, bool dragEnabled = true, double edgeDragWidth = 8, Duration animationDuration = const Duration(milliseconds: 280), Curve slideCurve = Curves.easeInOutCubic, Curve scaleCurve = Curves.easeInOutBack, ValueChanged<bool>? onDrawerChanged, String? semanticLabel, Color shadowColor = const Color(0x80FFFFFF), bool footerPinned = false, bool centerScrollableItems = false})
Creates an animated side drawer.
const

Properties

animationDuration Duration
Duration of programmatic open and close animations.
final
borderRadius double?
Content corner radius while the drawer is fully open.
final
centerScrollableItems bool
Vertically centers a shrink-wrapped scrollable item list.
final
content Widget?
Content displayed when controller is null or has no current page.
final
controller KFDrawerController?
Controller that supplies the current page and, when non-null, the items.
final
decoration BoxDecoration?
Background decoration for the drawer layer.
final
direction KFDrawerDirection
Logical side from which the drawer opens.
final
disableContentTap bool
Whether open drawer content absorbs taps and closes when tapped.
final
dragEnabled bool
Whether horizontal pointer dragging can open and close the drawer.
final
drawerWidth double?
Revealed drawer width as a fraction of the available screen width.
final
edgeDragWidth double
Width of the edge gesture area used to start opening a closed drawer.
final
Optional widget displayed after or below the menu items.
final
footerPinned bool
Keeps footer outside the scrolling item list when enabled.
final
hashCode int
The hash code for this object.
no setterinherited
Optional widget displayed above the menu items.
final
items List<KFDrawerItem>
Items used when controller is null.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
Padding around the drawer menu.
final
minScale double?
Scale applied to content while the drawer is fully open.
final
onDrawerChanged ValueChanged<bool>?
Called when the drawer starts targeting a different open state.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleCurve Curve
Curve used for content scaling.
final
scrollable bool
Whether drawer items can scroll.
final
semanticLabel String?
Accessibility label applied to the drawer menu while it is visible.
final
shadowBorderRadius double?
Corner radius of the decorative shadow layer.
final
shadowColor Color
Color of the decorative layer behind the transformed content.
final
shadowOffset double?
Horizontal offset of the decorative shadow layer.
final
slideCurve Curve
Curve used for content translation.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<KFDrawer>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

of(BuildContext context) KFDrawerControl?
Returns controls for the nearest ancestor KFDrawer, if one exists.