BottomAreaAvoider class

Helps child stay visible by resizing it to avoid the given areaToAvoid.

Wraps the child in a AnimatedContainer that adjusts its bottom padding to accommodate the given area.

If autoScroll is true and the child contains a focused widget such as a TextField, automatically scrolls so that it is just visible above the keyboard, plus any additional overscroll.

Inheritance

Constructors

BottomAreaAvoider({Key? key, required Widget? child, required double areaToAvoid, bool autoScroll = false, Duration duration = defaultDuration, Curve curve = defaultCurve, double overscroll = defaultOverscroll, ScrollPhysics? physics})

Properties

areaToAvoid double
Amount of bottom area to avoid. For example, the height of the currently-showing system keyboard, or any custom bottom overlays.
final
autoScroll bool
Whether to auto-scroll to the focused widget after the keyboard appears. Defaults to false. Could be expensive because it searches all the child objects in this widget's render tree.
final
child Widget?
The child to embed.
final
curve Curve
Animation curve. Defaults to defaultCurve
final
duration Duration
Duration of the resize animation. Defaults to defaultDuration. To disable, set to Duration.zero.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
overscroll double
Extra amount to scroll past the focused widget. Defaults to defaultOverscroll. Useful in case the focused widget is inside a parent widget that you also want to be visible.
final
physics ScrollPhysics?
The ScrollPhysics of the SingleChildScrollView which contains child
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() BottomAreaAvoiderState
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}) 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

Constants

defaultAutoScroll → const bool
defaultCurve → const Curve
defaultDuration → const Duration
defaultOverscroll → const double