build method

  1. @override
Component build(
  1. BuildContext context
)

Describes the part of the user interface represented by this component.

Implementation

@override
Component build(BuildContext context) {
  final st = context.simutilTheme;
  return Column(
    crossAxisAlignment: crossAxisAlignment,
    mainAxisSize: MainAxisSize.min,
    children: [
      Text(' $label', style: groupFocused ? st.label : st.body),
      SizedBox(height: spacing),
      Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          Text('  ', style: st.body),
          ...List.generate(pinControllers.length, (index) {
            return Row(
              children: [
                _PinCell(
                  controller: pinControllers[index],
                  focused: groupFocused && focusedPinIndex == index,
                  onChanged: (value) => onPinChanged(index, value),
                  onSubmitted: onSubmitted,
                  onKeyEvent: (event) => onPinKeyEvent(index, event),
                ),
                if (index < pinControllers.length - 1)
                  SizedBox(width: cellSpacing),
              ],
            );
          }),
        ],
      ),
    ],
  );
}