ComicPressable class
An accessible press target for a custom control.
builder receives the current widget states. Hover and press animate a plain tint across the face. plate gives the face a hard ink shadow and lets it sink when pressed. Keyboard focus draws an outline around the face. Enter and Space activate it. A null onPressed disables it.
Supply label to name the control or omit it to merge the child's semantics. busy temporarily suspends activation while retaining focus.
ComicPressable(onPressed: open, label: 'Issue 12', child: tile)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ComicPressable
Constructors
-
ComicPressable({Key? key, Widget? child, Widget builder(BuildContext context, Set<
WidgetState> states)?, VoidCallback? onPressed, VoidCallback? onLongPress, String? label, String? hint, String? value, bool button = true, bool link = false, bool? selected, bool? checked, bool mixed = false, bool? toggled, bool inGroup = false, bool? expanded, bool error = false, FocusNode? focusNode, bool autofocus = false, WidgetStatesController? statesController, double radius = 0, bool ring = true, bool wash = true, Color? washColor, bool sink = true, bool plate = false, bool target = false, AlignmentGeometry targetAlignment = AlignmentDirectional.center, bool busy = false, KeyEventResult keys(FocusNode node, KeyEvent event)?, WidgetStateProperty<OutlinedBorder?> ? outline, WidgetStateProperty<Color?> ? overlay, MouseCursor? mouseCursor}) -
Creates a ComicPressable.
const
Properties
- autofocus → bool
-
Whether it takes the focus when it first shows.
final
-
builder
→ Widget Function(BuildContext context, Set<
WidgetState> states)? -
A face that draws its own states.
final
- busy → bool
-
Waiting: takes no press, keeps its focus and its face.
final
-
Read as a button. False for a face that is no button: a tile, a row.
final
- checked → bool?
-
Ticked, for a checkbox or a radio. Null: it is neither.
final
- child → Widget?
-
The face. Give this or builder.
final
- error → bool
-
What it holds is wrong: the face is told (WidgetState.error).
final
- expanded → bool?
-
Open, for a disclosure. Null: it opens nothing.
final
- focusNode → FocusNode?
-
An optional focus node to use as the focus node for this widget.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hint → String?
-
What a press does, read after the name: 'Opens the menu'. Null: none.
final
- inGroup → bool
-
One of a set where only one is selected: a radio.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keys → KeyEventResult Function(FocusNode node, KeyEvent event)?
-
More keys, on top of Enter and Space: arrows on a radio group, a slider.
final
- label → String?
-
The control's one name. Null: its own words are its name.
final
- link → bool
-
Read as a link: it goes somewhere.
final
- mixed → bool
-
A checkbox partly ticked.
final
- mouseCursor → MouseCursor?
-
The pointer over the part. Null: SystemMouseCursors.click while it takes presses,
SystemMouseCursors.basic while it is disabled or busy.
final
- onLongPress → VoidCallback?
-
Called on a long press. Null: none.
final
- onPressed → VoidCallback?
-
Called on a press: a tap, Enter or Space. Null is disabled.
final
-
outline
→ WidgetStateProperty<
OutlinedBorder?> ? -
A styled part's outline, for its states: the pop and the wash follow it in place of radius. Null keeps radius.
final
-
overlay
→ WidgetStateProperty<
Color?> ? -
A styled part's wash for its states, as
ButtonStyle.overlayColor: drawn as given in place of the look's ink at 10% under the press (and nothing under the pointer). Null for a state keeps the look's.final - plate → bool
-
Whether the face rises on an ink shadow and sinks when pressed.
final
- radius → double
-
A corner its pop and wash follow when outline is null; 0 takes the theme's control step (
shapes.small).final - ring → bool
-
False when the face draws its focus itself.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected → bool?
-
Chosen, for a tab or an option. Null: it is no choice.
final
- sink → bool
-
The face lands a pixel under the finger.
final
- statesController → WidgetStatesController?
-
The states, when the caller watches or drives them.
final
- target → bool
-
A face under 44: its target is 44 round it on every platform (48 where a finger reaches it, as every press).
final
- targetAlignment → AlignmentGeometry
-
Where the face stands in its target when the target is larger: centred, or on the edges named
(AlignmentDirectional.centerStart keeps a bare face on its column's start keyline), the target growing away
from them. A tap anywhere in the target reaches the face.
final
- toggled → bool?
-
On, for a switch. Null: it is no switch.
final
- value → String?
-
Its value, read after the name: '3 new'. Null: none.
final
- wash → bool
-
Whether hover and press tint the face.
final
- washColor → Color?
-
The tint on a face that isn't paper: the letters' colour.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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