SafeLayout class
A layout widget that checks constraints and renders a fallback message (or custom fallback widget) if the terminal space is below the minimum required dimensions.
Constructors
- SafeLayout({Key? key, required Widget child, int minWidth = 50, int minHeight = 12, Widget? fallback})
-
Creates a SafeLayout widget.
const
Properties
- child → Widget
-
The child widget to display when layout constraints are met.
final
- fallback → Widget?
-
Optional custom fallback widget to display when constraints are violated.
If not provided, defaults to a centered, red, bold "Screen too small!" text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
The optional key for this widget.
finalinherited
- minHeight → int
-
The minimum height required for the child widget.
final
- minWidth → int
-
The minimum width required for the child widget.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → Element -
Creates an Element to manage this widget's location in the tree.
override
-
getIntrinsicHeight(
int width) → int -
Computes the intrinsic height of this widget under the given
widthconstraint.override -
getIntrinsicWidth(
int height) → int -
Computes the intrinsic width of this widget under the given
heightconstraint.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited