ActionButton<T> constructor

ActionButton<T>({
  1. Key? key,
  2. required ValueGetter<FutureOr<T>> onAction,
  3. ValueChanged<T>? onActionResult,
  4. bool autofocus = false,
  5. ObservableData<bool>? enabled,
  6. ActionButtonBuilder buttonBuilder = buttonText,
  7. Object? label,
  8. Widget? child,
  9. 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()));