Focus and press
Every kit control shows keyboard focus the same way, and compact controls answer a press the same way. Both are built in: you get them by using the widgets, with nothing to configure.


Focus ring
Section titled “Focus ring”When a control has keyboard focus, the kit draws an outline around it:
- 2 px wide, 2 px outside the control, following its corner radius.
- Ink on light, paper on dark. The ring uses
textPrimary, never the accent or brand color, so it reads as focus and not as selection. Over a picture, such as the video player’s play button, it is white. - Keyboard only. It shows only when the platform is in keyboard (traditional) highlight mode, Flutter’s equivalent of the web’s
:focus-visible. A tap never draws it. - Painted, not laid out. The ring is drawn over the control and outside its bounds, so focusing never moves anything on screen.
- Replaces Material’s focus fill. Buttons, rows and tabs do not also tint their background on focus. Their pressed and hovered states are unchanged.
Because the ring sits outside the control, leave at least 4 px between a kit control and any ancestor that clips, such as a ClipRRect or a scroll view with clipping. Otherwise the ring is cut off. Rows that run edge to edge, like PaymentTabs, clip only at their sides, so their rings still show above and below.
Which widgets draw it
Section titled “Which widgets draw it”Buttons, action rows, the action menu button, checkbox, radio and switch rows, tabs, payment method rows, navigation items, the expandable section header, copy buttons, the sheet close button, promotion actions, the video controls, and the edit actions on the verification review. Text fields show focus their own way: a 2 px accent border.
Press scale
Section titled “Press scale”Compact controls shrink to 0.96 while held and return to full size on release, over 100 ms (PaymentMotion.press). The scale releases when the touch moves past the platform’s touch slop, so a control returns to full size when scrolling starts. Disabled controls don’t scale. Because there is no press delay inside scroll views, the scale can appear briefly before a scroll begins.
- Compact only. Copy buttons, the sheet close button, tabs, promotion actions, the video controls and the review’s edit actions scale.
- Full-width buttons and rows do not. Scaling a 320 dp slab moves its edges by several pixels, which reads as a lurch rather than a press. They use Material’s pressed layer instead.
- Reduced motion turns it off. Under reduced motion
pressedScaleis 1.
Press splash
Section titled “Press splash”Press splash is host-owned through ThemeData.splashFactory. The kit inherits it. The example turns the splash off on iOS, including iPadOS, and keeps InkSparkle on Android:
import 'package:flutter/foundation.dart';import 'package:flutter/material.dart';
final theme = ThemeData( splashFactory: switch (defaultTargetPlatform) { TargetPlatform.iOS => NoSplash.splashFactory, TargetPlatform.android when !kIsWeb => InkSparkle.splashFactory, _ => null, },);ThemeData.platform also defaults to defaultTargetPlatform. A null splash factory keeps the SDK default on other platforms.
NoSplash removes the ripple, but the iOS pressed highlight remains. It still fades in over the SDK’s 200 ms, even under reduced motion. This is an SDK ink exception under D67. Target sizes stay the same.
In your own screens
Section titled “In your own screens”The ring and press widgets are internal to the package. To match them on your own controls:
- Keep Material’s default focus handling, or draw a 2 px outline in your ink color 2 px outside the control. Never use the brand color for focus.
- Do not scale full-width controls on press.
- Test with a hardware keyboard: Tab through the screen and check every control shows the ring and nothing moves.
See also
Section titled “See also”- Motion for the press duration and reduced motion.
- Accessibility for keyboard and screen-reader behavior.
- Color for
textPrimary.
Focus contract
Section titled “Focus contract”| Token / rule | Value | Source |
|---|---|---|
| Focus ring | 2 px stroke, 2 px outside the control, radius +3, in textPrimary (white on pictures), keyboard highlight mode only |
focus_ring.dart:6-12, 101-110 |
| Text input focus | 2 px accent border, never also the ring |
D1 |
| Press, compact controls (≤ 48 dp wide icon buttons, links, tabs) | PaymentPressScale → 0.96 over press |
focus_ring.dart:118-162, controls.dart:398 |
| Press, full-width buttons and rows | Material pressed layer, no scale | primitives.dart:423-426 |
| Hover/focus fill | Removed by PaymentFocusRing.withoutFocusFill; pressed and hovered layers are kept |
focus_ring.dart:32-44 |
| Clearance | ≥ 4 px between a focusable control and any clipping ancestor | focus_ring.dart:11-12, PaymentTabs side clip controls.dart:353-361 |
| The control is… | Feedback |
|---|---|
| A focused text field | accent border only |
| Any other keyboard-focused control | textPrimary ring |
| A compact control being pressed | pressedScale |
| A full-width button or row being pressed | Material pressed layer |
Leave 4 dp clearance around the focus ring and avoid adding a second ring to a field. PaymentSize changes visual size while keeping targets at least 48×48 dp. The ring and press helpers are internal; host controls can follow the guidance above.
Text inputs, including history search, use the accent border only.
Haptics
Section titled “Haptics”The host owns native haptics. The kit only calls Dart callbacks and plays no haptic itself.
| Event | Host wiring |
|---|---|
| Press | Play press feedback from Pay/Confirm onPressed. |
| Copy success | Play feedback from onCopy after the host’s copy succeeds. |
| Selection | Play a selection tick from PaymentSwitch, PaymentCheckbox, PaymentRadio onChanged, or chart onSelectionChanged. |
| Success or error | The host produces the result and chooses its feedback. |
PaymentDateField.onChanged reports the accepted date after its sheet closes, rather than every wheel tick.
Chart callbacks report a new period index, or null on return to rest. Skip the haptic for null. Data-driven resets do not call the host. See Bar chart for host wiring.
Feedback.forTap and Feedback.forLongPress from Material controls and tooltip long presses are SDK-owned behaviour. They stay enabled by the SDK; they are separate from host-authored haptics.