SingleValuePickerDialog<T> constructor

SingleValuePickerDialog<T>({
  1. String? title,
  2. Widget? titleWidget,
  3. TextStyle? titleStyle,
  4. Color? titleBackgroundColor,
  5. required List<T> items,
  6. required Widget itemBuilder(
    1. BuildContext context,
    2. T value,
    3. int index
    ),
  7. DialogButton? dialogButton,
  8. bool barrierDismissible = true,
  9. bool showCloseIcon = false,
  10. double elevation = 10.0,
  11. double? dialogWidth,
  12. double? dialogHeight,
  13. double titleHeight = 60.0,
  14. double dialogBorderRadius = 4.0,
})

Creates a SingleValuePickerDialog instance with the specified parameters.

This constructor allows you to create a new SingleValuePickerDialog instance with the required and optional parameters. You can customize the appearance and behavior of the dialog by providing values for title, titleWidget, titleStyle, titleBackgroundColor, items, itemBuilder, dialogButton, barrierDismissible, showCloseIcon, elevation, dialogWidth, dialogHeight, titleHeight, and dialogBorderRadius.

Example:

var singleValuePickerDialog = SingleValuePickerDialog<String>(
  title: 'Select Item',
  items: ['Item 1', 'Item 2', 'Item 3'],
  itemBuilder: (context, value) => Text(value),
  // ... other parameters ...
);

Implementation

SingleValuePickerDialog({
  this.title,
  this.titleWidget,
  this.titleStyle,
  this.titleBackgroundColor,
  required this.items,
  required this.itemBuilder,
  this.dialogButton,
  this.barrierDismissible = true,
  this.showCloseIcon = false,
  this.elevation = 10.0,
  this.dialogWidth,
  this.dialogHeight,
  this.titleHeight = 60.0,
  this.dialogBorderRadius = 4.0,
}) : assert(
        (titleWidget == null ||
            (title == null &&
                titleBackgroundColor == null &&
                !showCloseIcon &&
                titleStyle == null)),
        "if titleWidget is provided,"
        " then title, titleBackgroundColor, showCloseIcon, titleStyle should not be provided",
      );