KeyboardPanelScaffold<PanelType> class
Scaffold that displays the given contentBuilder, while also (optionally) displaying a toolbar docked to the top of the software keyboard, and/or a panel that appears instead of the software keyboard.
A typical use case for the keyboard panel is a chat application switching between the software keyboard and an emoji panel.
To correctly use this scaffold, you must place a KeyboardScaffoldSafeArea higher in the widget tree to adjust the padding so that the content is above the keyboard panel and software keyboard. The KeyboardScaffoldSafeArea can go anywhere higher in the tree, so long as the KeyboardScaffoldSafeArea takes up the entire screen.
The widget returned by toolbarBuilder is positioned above the keyboard panel, when visible, or above the software keyboard, when visible. If neither the keyboard panel nor the software keyboard are visible, the widget is positioned at the bottom of the screen.
The widget returned by keyboardPanelBuilder is positioned at the bottom of the screen, with its height constrained to be equal to the software keyboard height.
The widget returned by contentBuilder is positioned above the above-keyboard panel, using all the remaining height.
Use the controller to show/hide the keyboard panel and software keyboard.
If there is a Scaffold in your widget tree, it must have resizeToAvoidBottomInset
set to false, otherwise we can't get the software keyboard height to size the keyboard
panel. If resizeToAvoidBottomInset is set to true, the panel won't be displayed.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- KeyboardPanelScaffold
Constructors
-
KeyboardPanelScaffold({Key? key, required KeyboardPanelController<
PanelType> controller, required ValueListenable<bool> isImeConnected, required Widget toolbarBuilder(BuildContext context, PanelType? openPanel), required Widget keyboardPanelBuilder(BuildContext context, PanelType? openPanel), double fallbackPanelHeight = 340, required Widget contentBuilder(BuildContext context, PanelType? openPanel), bool bypassMediaQuery = false}) -
const
Properties
- bypassMediaQuery → bool
-
When determining the height of the keyboard, whether to bypass Flutter's
MediaQueryand solely rely onSuperKeyboardreporting, or whether the scaffold should use a combination of both.final - contentBuilder → Widget Function(BuildContext context, PanelType? openPanel)
-
Builds the regular widget subtree beneath this widget.
final
-
controller
→ KeyboardPanelController<
PanelType> -
Controls the visibility of the keyboard toolbar, keyboard panel, and software keyboard.
final
- fallbackPanelHeight → double
-
The height of the keyboard panel in situations where no software keyboard is
present, e.g., on a tablet when using a physical keyboard, or when using a floating
software keyboard.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isImeConnected
→ ValueListenable<
bool> -
A ValueListenable that should notify this KeyboardPanelScaffold when the IME connects
and disconnects.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardPanelBuilder → Widget Function(BuildContext context, PanelType? openPanel)
-
Builds the keyboard panel that's displayed in place of the software keyboard.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toolbarBuilder → Widget Function(BuildContext context, PanelType? openPanel)
-
Builds the toolbar that's docked to the top of the software keyboard area.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< KeyboardPanelScaffold< PanelType> > -
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