FocusNavigator constructor
Creates a new focus navigation state.
itemCount is the total number of focusable items.
initialIndex is the starting focus (defaults to 0).
Implementation
FocusNavigator({
required int itemCount,
int initialIndex = 0,
}) : _itemCount = max(0, itemCount),
_focusedIndex = 0,
_errors =
List<String?>.filled(max(0, itemCount), null, growable: true) {
_focusedIndex = itemCount > 0 ? initialIndex.clamp(0, itemCount - 1) : 0;
}