PanelViewport class final

The resolved space a floating panel may occupy.

This is the single source of geometric truth for the panel. Rotation, a window resize, split-screen, and the software keyboard all reduce to a change in this value, so nothing downstream needs to special-case them.

Annotations

Constructors

PanelViewport({required Size size, required EdgeInsets safeArea, required EdgeInsets viewInsets, required EdgeInsets margin, required TextDirection direction, required bool avoidKeyboard})
const
PanelViewport.of(BuildContext context, {required EdgeInsets margin, required bool avoidKeyboard})
Reads the viewport from the ambient MediaQuery.
factory

Properties

avoidKeyboard → bool
Whether bounds shrinks to stay clear of the keyboard.
final
bounds → Rect
The rect the panel's own rect must stay inside.
no setter
direction → TextDirection
Resolves the directional start and end of placements onto physical left and right.
final
hashCode → int
The hash code for this object.
no setteroverride
margin → EdgeInsets
Additional inset the panel keeps from the safe area.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
safeArea → EdgeInsets
Padding taken by system chrome — notch, status bar, home indicator.
final
size → Size
The full size of the surface the panel floats above.
final
viewInsets → EdgeInsets
Insets taken by a system overlay that covers content, chiefly the software keyboard.
final

Methods

copyWith({Size? size, EdgeInsets? safeArea, EdgeInsets? viewInsets, EdgeInsets? margin, TextDirection? direction, bool? avoidKeyboard}) → PanelViewport
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
travelFor(Size panelSize) → Rect
The rect of legal top-left positions for a panel of panelSize.

Operators

operator ==(Object other) → bool
The equality operator.
override