EJSelectorButton<T> constructor

EJSelectorButton<T>({
  1. Key? key,
  2. required List<EJSelectorItem<T>> items,
  3. T? value,
  4. bool useValue = true,
  5. Widget? hint,
  6. double dialogWidth = 80,
  7. double? dialogHeight,
  8. Widget buttonBuilder(
    1. Widget child,
    2. T? value
    )?,
  9. Widget selectedWidgetBuilder(
    1. T valueOfSelected
    )?,
  10. void onChange(
    1. T value
    )?,
  11. Widget? divider,
  12. VoidCallback? onTap,
  13. bool? alwaysShowScrollBar,
  14. bool disable = false,
  15. VoidCallback? onDisableTap,
})

Implementation

EJSelectorButton({
  Key? key,
  required this.items,
  this.value,
  this.useValue = true,
  this.hint,
  this.dialogWidth = 80,
  this.dialogHeight,
  this.buttonBuilder,
  this.selectedWidgetBuilder,
  this.onChange,
  this.divider,
  this.onTap,
  this.alwaysShowScrollBar,
  this.disable = false,
  this.onDisableTap,
})  : assert(
        items.isEmpty ||
            value == null ||
            items.where((item) => item.value == value).length == 1,
        "There should be exactly one item with [item]'s value: "
        '$value.\n'
        'Either zero or 2 or more [item]s were detected '
        'with the same value',
      ),
      assert(T.runtimeType != Widget,
          '{EJSelectorButton}\'s type can\'t be {Widget}'),
      super(key: key);