ActionButton<T> constructor
ActionButton<T> ({
- Key? key,
- required ValueGetter<
FutureOr< onAction,T> > - ValueChanged<
T> ? onActionResult, - bool autofocus = false,
- ObservableData<
bool> ? enabled, - ActionButtonBuilder buttonBuilder = buttonText,
- Object? label,
- Widget? child,
- WidgetBuilder? builder,
Implementation
ActionButton({
super.key,
required this.onAction,
this.onActionResult,
this.autofocus = false,
this.enabled,
this.buttonBuilder = buttonText,
Object? label,
Widget? child,
WidgetBuilder? builder,
}) : assert(
[builder != null || child != null || label != null].count(true) == 1,
'exactly one of [builder, child, label] must be defined',
),
contentBuilder = builder ?? ((context) => child ?? Text(label.toString()));