PressRegion class
Makes a widget pressable: tap, hover, focus and keyboard activation, with the plain state layer overlay paints over fill inside shape. A widget that shows those states itself leaves overlay null and listens.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PressRegion
Constructors
-
PressRegion({Key? key, VoidCallback? onTap, ValueChanged<
bool> ? onHover, ValueChanged<bool> ? onPressedChanged, ValueChanged<bool> ? onFocusChange, ShapeBorder? shape, Color? fill, WidgetStateProperty<Color?> ? overlay, Color? hoverColor, bool canRequestFocus = true, bool excludeFromSemantics = false, bool enableFeedback = true, MouseCursor? mouseCursor, required Widget child}) -
const
Properties
- canRequestFocus → bool
-
final
- child → Widget
-
final
- enableFeedback → bool
-
final
- excludeFromSemantics → bool
-
final
- fill → Color?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hoverColor → Color?
-
Replaces the hover of overlay.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mouseCursor → MouseCursor?
-
Defaults to a click cursor while onTap is set.
final
-
onFocusChange
→ ValueChanged<
bool> ? -
final
-
onHover
→ ValueChanged<
bool> ? -
final
-
onPressedChanged
→ ValueChanged<
bool> ? -
final
- onTap → VoidCallback?
-
final
-
overlay
→ WidgetStateProperty<
Color?> ? -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape → ShapeBorder?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PressRegion> -
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
Constants
- focusOverlay → const _StateOverlay
- Shows keyboard and remote focus only.
- hoverOverlay → const _StateOverlay
- Shows a hover and keyboard or remote focus.
- pressOverlay → const _StateOverlay
- hoverOverlay with a press too, which Brightness decides the look of.