HarborBeacon class
A beacon: marks a widget the lighthouse watches.
With onObscured, it reports how much of itself the docks on edge cover (0 in clear water, 1 entirely under them) whenever that changes: the hero title that hands off to the header as it scrolls under it.
With keepInSight set, it brings itself back into sight, clearance clear of the docks and the keyboard, once the keyboard has risen or what covers the bottom has grown, and when focus moves into it: a field and the button under it, reached by a tap or the keyboard's next action. With onlyWhileFocused, only while focus is inside it, so a form full of beacons reveals just the field being typed in. Inside a HarborLighthouseRegion it can lift instead: the region moves its content up until the beacon clears what covers it, and settles back when that goes away.
See also:
TextField.scrollPadding, the closest Flutter setting to keepInSight. onObscured and lift have no Flutter equivalent.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- HarborBeacon
Constructors
-
HarborBeacon({Key? key, HarborEdge edge = HarborEdge.top, ValueChanged<
double> ? onObscured, bool keepInSight = false, bool onlyWhileFocused = false, bool lift = false, double clearance = 0.0, bool holdPosition = false, required Widget child}) -
const
Properties
- child → Widget
-
final
- clearance → double
-
How far clear of what covers it this widget is kept.
final
- edge → HarborEdge
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- holdPosition → bool
-
While true, a lift holds where it is (an element being dragged).
final
- keepInSight → bool
-
Whether to scroll this widget back into sight when what covers the bottom
grows, and when focus moves into it from outside.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lift → bool
-
Whether the enclosing HarborLighthouseRegion should lift its content to
keep this widget clear of what covers the bottom.
final
- onlyWhileFocused → bool
-
Whether keepInSight applies only while focus is inside this beacon.
final
-
onObscured
→ ValueChanged<
double> ? -
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(
) → State< HarborBeacon> -
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.
override
-
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