DrawerConfig class

Configuration for the drawer. widthPercentage is the width for the drawer. If not specified, the default width will be used which is 0.8 for mobile, 0.3 for desktop and 0.5 for tablet.

closeOnClickOutside is whether the drawer should be closed when the user clicks outside the drawer. Defaults to true.

backdropOpacity is the opacity of the backdrop. Defaults to 0.4.

dragEnabled is whether the user can drag the drawer from the edge of the screen. Defaults to false.

maxDragExtent is the maximum extent the user can drag the drawer. Defaults to 300.

side is the side of the drawer. Defaults to DrawerSide.right.

closeOnEscapeKey is whether the drawer should be closed when the user presses the escape key. Defaults to true.

closeOnResume is a boolean value that indicates whether the drawer should be closed when the app resumes from background. Defaults to true.

closeOnBackButton is a boolean value that indicates whether the drawer should be closed when the user presses the back button on Android. Defaults to false.

Constructors

DrawerConfig({double? widthPercentage, bool closeOnClickOutside = true, double backdropOpacity = 0.4, bool? dragEnabled = false, double? maxDragExtent = 300, DrawerSide? side = DrawerSide.right, bool closeOnEscapeKey = true, double borderRadius = 20, bool closeOnResume = false, bool closeOnBackButton = false, Duration animationDuration = const Duration(milliseconds: 300)})
Constructs a new DrawerConfig.
const

Properties

animationDuration Duration
Drawer animation duration
final
backdropOpacity double
The opacity of the backdrop.
final
borderRadius double
Border radius
final
closeOnBackButton bool
Close on back button
final
closeOnClickOutside bool
Whether the drawer should be closed when the user clicks outside the drawer.
final
closeOnEscapeKey bool
Close on Escape key
final
closeOnResume bool
Close on resume
final
dragEnabled bool?
Whether the user can drag the drawer from the edge of the screen.
final
hashCode int
The hash code for this object.
no setterinherited
maxDragExtent double?
The maximum extent the user can drag the drawer.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
side DrawerSide?
The side of the drawer.
final
widthPercentage double?
The width percentage of the drawer. It is used to calculate the width of the drawer based on the width of the screen.
final

Methods

copyWith({double? widthPercentage, bool? closeOnClickOutside, double? backdropOpacity, bool? enableEdgeDrag, double? maxDragExtent, DrawerSide? side, bool? closeOnEscapeKey, Duration? animationDuration, double? borderRadius}) DrawerConfig
copyWith method
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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