DesignTapTargets class

The least area a tap must reach on a control, by what reaches it: 44 by 44 for a finger (Apple's Human Interface Guidelines), 24 by 24 for a pointer (WCAG 2.2, success criterion 2.5.8, level AA).

A look may raise either (Android's 48 for a finger, 44 for a pointer that a look keeps roomy) and declares its floors with a DesignTapTargetScope round the app, in its theme; DesignTapTarget lays a control out at the floor, and DesignTapTargetCheck holds every screen to it. Density never moves the floor: a compact face stands in the same target, with more room round it.

DesignTapTargetScope(
  targets: const DesignTapTargets(touch: Size.square(48)),
  child: app,
)

See also:

Mixed-in types
Annotations

Constructors

DesignTapTargets({Size touch = const Size.square(44), Size pointer = const Size.square(24), DesignInput? input})
Floors for touch and pointer; input null reads the platform's.
const

Properties

hashCode → int
The hash code for this object.
no setteroverride
input → DesignInput?
What reaches the controls; null: by the platform (DesignInput.forPlatform).
final
pointer → Size
The least area a pointer's click reaches.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
touch → Size
The least area a finger's tap reaches.
final

Methods

copyWith({Size? touch, Size? pointer, DesignInput? input}) → DesignTapTargets
This with the given fields changed.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
floorFor(DesignInput input) → Size
The floor for input.
floorOn([TargetPlatform? platform]) → Size
The floor for what reaches the controls on platform (the running one when null).
inputOn([TargetPlatform? platform]) → DesignInput
What reaches the controls on platform (the running one when null).
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
toStringShort() → String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

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

Static Methods

maybeOf(BuildContext context) → DesignTapTargets?
The nearest DesignTapTargetScope's floors, or null when there is none.
of(BuildContext context) → DesignTapTargets
The floors in effect at context: the nearest DesignTapTargetScope's, else fallback.

Constants

fallback → const DesignTapTargets
The floors with no look's own: 44 for a finger, 24 for a pointer, the input by platform.