AlertControllerObject.singleAction constructor

AlertControllerObject.singleAction({
  1. required VoidCallback onCancellation,
  2. required String alertTitle,
  3. required String alertBody,
  4. required IconData alertIcon,
  5. required List<AlertControllerAction>? actions,
  6. bool? canUserExit = true,
})

A constructor that takes one item through the actions list, and otherwise throws an error

Implementation

AlertControllerObject.singleAction({
  required this.onCancellation,
  required this.alertTitle,
  required this.alertBody,
  required this.alertIcon,
  required this.actions,
  this.canUserExit = true,
}) : assert(actions!.length == 1);