CupertinoFocusHalo.withRect constructor

const CupertinoFocusHalo.withRect({
  1. required Widget child,
  2. Key? key,
})

Creates a rectangular CupertinoFocusHalo around the child.

For example, to highlight a rectangular section of the widget tree when any button inside that section has focus, one could write:

CupertinoFocusHalo.withRect(
  child: Column(
    children: <Widget>[
      CupertinoButton(child: const Text('Child 1'), onPressed: () {}),
      CupertinoButton(child: const Text('Child 2'), onPressed: () {}),
    ],
  ),
)

Implementation

const CupertinoFocusHalo.withRect({required this.child, super.key})
  : _borderRadius = BorderRadius.zero;