minimalStateLayer function

Decoration minimalStateLayer(
  1. MinimalThemeData t,
  2. OutlinedBorder shape,
  3. Set<WidgetState> states, {
  4. bool inside = false,
  5. Color? overlay,
  6. Color? face,
  7. Color? faceInk,
  8. Color? ground,
})

The press wash and the keyboard ring over a part's face on shape: the ink at 8% while pressed (minimalPressInk), the focus ring while the keyboard is on it: minimalRingFrame's, outside the edge past a gap of ground (the page's background when null), or inside the edge with inside. A hovering pointer changes nothing. Always a decoration, so a container that wears it never re-parents its child as the states change.

A ring inside a filled face it would vanish into (under 3:1 against it) takes the face's own faceInk.

Implementation

Decoration minimalStateLayer(
  MinimalThemeData t,
  OutlinedBorder shape,
  Set<WidgetState> states, {
  bool inside = false,
  Color? overlay,
  Color? face,
  Color? faceInk,
  Color? ground,
}) {
  final wash =
      overlay ??
      (MinimalKitStates(states).down
          ? minimalPressInk(
              t,
              face: face,
              faceInk: faceInk,
            ).withValues(alpha: 0.08)
          : null);
  if (MinimalKitStates(states).ring && !inside) {
    return minimalRingFrame(
      shape,
      wash: wash,
      ring: t.ring,
      ground: ground ?? t.background,
      width: t.focusWidth,
    );
  }
  return minimalFrame(
    shape,
    fill: wash,
    side: MinimalKitStates(states).ring
        ? BorderSide(
            color: face != null && faceInk != null
                ? (_contrast(t.ring, face) < 3 ? faceInk : t.ring)
                : t.ring,
            width: t.focusWidth,
            strokeAlign: BorderSide.strokeAlignInside,
          )
        : BorderSide.none,
  );
}