BaseDrawer class
BaseDrawer with iOS 26 Liquid Glass Dynamic Material support
Features iOS 26 Liquid Glass Dynamic Material with:
- Transparency with optical clarity zones for drawer content
- Environmental reflections and adaptive blur effects
- Dynamic interaction states with real-time responsiveness
- Enhanced haptic feedback for drawer gestures
- Unified design language across platforms
Enhanced drawer implementation with:
- Custom positioning capabilities (start, end, top, bottom)
- Sophisticated gesture handling with multi-touch support
- Adaptive barrier dismissal with optical feedback
- Smooth animation curves with easing transitions
Cannot specify start and end positions simultaneously Default width/height is 304 units
Enhanced: 2024.01.20 with iOS 26 Liquid Glass Dynamic Material
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BaseDrawer
Constructors
- BaseDrawer({Key? key, Duration duration = _drawerTransitionDuration, AxisDirection axisDirection = AxisDirection.right, Size? size, double? percent, Color backgroundColor = _drawerBackgroundColor, required Widget child, Curve curve = Curves.linearToEaseOut, Curve reverseCurve = Curves.linearToEaseOut, bool allowGesture = true, bool allowMultipleGesture = false, bool barrierDismissible = true, bool enableLiquidGlass = true, double glassOpacity = 0.9, double reflectionIntensity = 0.7, double refractionStrength = 0.5, bool adaptiveInteraction = true, bool hapticFeedback = true})
-
const
- BaseDrawer.height({Key? key, Duration duration = _drawerTransitionDuration, AxisDirection axisDirection = AxisDirection.up, Color backgroundColor = _drawerBackgroundColor, required double height, required Widget child, Curve curve = Curves.linearToEaseOut, Curve reverseCurve = Curves.linearToEaseOut, bool allowGesture = true, bool allowMultipleGesture = false, bool barrierDismissible = true, bool enableLiquidGlass = true, double glassOpacity = 0.9, double reflectionIntensity = 0.7, double refractionStrength = 0.5, bool adaptiveInteraction = true, bool hapticFeedback = true})
- 指定高度 axisDirection 只能为 AxisDirection.up or AxisDirection.down 指定高度 axisDirection 只能为 AxisDirection.up or AxisDirection.down
- BaseDrawer.percent({Key? key, Duration duration = _drawerTransitionDuration, AxisDirection axisDirection = AxisDirection.right, Color backgroundColor = _drawerBackgroundColor, required double? percent, required Widget child, Curve curve = Curves.linearToEaseOut, Curve reverseCurve = Curves.linearToEaseOut, bool allowGesture = true, bool allowMultipleGesture = false, bool barrierDismissible = true, bool enableLiquidGlass = true, double glassOpacity = 0.9, double reflectionIntensity = 0.7, double refractionStrength = 0.5, bool adaptiveInteraction = true, bool hapticFeedback = true})
-
Specify percentage
const
- BaseDrawer.size({Key? key, Duration duration = _drawerTransitionDuration, AxisDirection axisDirection = AxisDirection.right, Color backgroundColor = _drawerBackgroundColor, Size? size, required Widget child, Curve curve = Curves.linearToEaseOut, Curve reverseCurve = Curves.linearToEaseOut, bool allowGesture = true, bool allowMultipleGesture = false, bool barrierDismissible = true, bool enableLiquidGlass = true, double glassOpacity = 0.9, double reflectionIntensity = 0.7, double refractionStrength = 0.5, bool adaptiveInteraction = true, bool hapticFeedback = true})
-
const
- BaseDrawer.width({Key? key, Duration duration = _drawerTransitionDuration, AxisDirection axisDirection = AxisDirection.right, Color backgroundColor = _drawerBackgroundColor, required double width, required Widget child, Curve curve = Curves.linearToEaseOut, Curve reverseCurve = Curves.linearToEaseOut, bool allowGesture = true, bool allowMultipleGesture = false, bool barrierDismissible = true, bool enableLiquidGlass = true, double glassOpacity = 0.9, double reflectionIntensity = 0.7, double refractionStrength = 0.5, bool adaptiveInteraction = true, bool hapticFeedback = true})
- Specify width axisDirection 只能为 AxisDirection.left or AxisDirection.right
Properties
- adaptiveInteraction → bool
-
Enable adaptive interaction with real-time responsiveness
Provides context-aware visual and haptic feedback for drawer interactions
final
- allowGesture → bool
-
final
- allowMultipleGesture → bool
-
final
- axisDirection → AxisDirection
-
axisDirection
final
- backgroundColor → Color
-
backgroundColor
final
- barrierDismissible → bool
-
final
- child → Widget
-
child
final
- curve → Curve
-
final
- duration → Duration
-
transitionDuration, default is
_drawerTransitionDurationfinal - enableLiquidGlass → bool
-
*** iOS 26 Liquid Glass Dynamic Material properties start ***
Enable Liquid Glass Dynamic Material optical effects for drawer
Provides transparency, reflections, and adaptive visual states
final
- glassOpacity → double
-
Glass transparency level for environmental awareness
Creates optical clarity while maintaining content readability (0.0 to 1.0)
final
- hapticFeedback → bool
-
Enable haptic feedback for enhanced drawer experience
Provides appropriate haptic responses for gestures and state changes
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- percent → double?
-
(width or height)'s percent
Cannot provide both a size and a percent
size == null && percent == null, the size = _defaultDrawerSize
axisDirection = up / down, width = 100%, height = percent
axisDirection = left / right, width = percent, height = 100%
final
- reflectionIntensity → double
-
Reflection intensity for environmental responsiveness
Simulates real-world glass reflection behavior (0.0 to 1.0)
final
- refractionStrength → double
-
Refraction strength for light distortion effects
Creates realistic glass light-bending properties (0.0 to 1.0)
final
- reverseCurve → Curve
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → Size?
-
size
final
Methods
-
close(
GlobalObjectKey< BaseDrawerState> drawerKey) → void -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StatefulWidget> -
*** iOS 26 Liquid Glass Dynamic Material properties end ***
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
-
open<
T> (BuildContext context, {}) → Future< T?> -
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