AlertDialogAction<T> constructor
AlertDialogAction<T> ({
- Key? key,
- ValueGetter<
FutureOr< ? onAction,T> > - T? value,
- OnActionResult<
T> ? onResult = popResult, - bool autofocus = false,
- LiveData<
bool> ? enabled, - ButtonStyleBuilder buttonBuilder = buttonText,
- Object? label,
- Widget? child,
- WidgetBuilder? builder,
Implementation
AlertDialogAction({
super.key,
this.onAction,
this.value,
this.onResult = popResult,
this.autofocus = false,
this.enabled,
this.buttonBuilder = buttonText,
Object? label,
Widget? child,
WidgetBuilder? builder,
}) : assert(value is T || onAction != null, 'exactly one of [value, onAction] must be defines'),
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()));