build method

  1. @override
Widget build(
  1. BuildContext context,
  2. TState state,
  3. TContext workflowContext
)
override

Implementation

@override
Widget build(BuildContext context, TState state, TContext workflowContext) {
  final values = items(state, workflowContext);
  final selected = selectedIdentity(state, workflowContext);
  return CarpenterCard(
    child: values.isEmpty
        ? CarpenterEmptyState(
            descriptor: CarpenterEmptyStateDescriptor(title: emptyMessage),
          )
        : Column(
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              for (var index = 0; index < values.length; index++) ...[
                itemBuilder(
                  context,
                  values[index],
                  identity(values[index]) == selected,
                  () => onSelected(values[index]),
                ),
                if (index < values.length - 1) const SizedBox(height: 8),
              ],
            ],
          ),
  );
}