EJSelectorButton<T> constructor
EJSelectorButton<T> ({
- Key? key,
- required List<
EJSelectorItem< items,T> > - T? value,
- bool useValue = true,
- Widget? hint,
- double dialogWidth = 80,
- double? dialogHeight,
- Widget buttonBuilder(
- Widget child,
- T? value
- Widget selectedWidgetBuilder(
- T valueOfSelected
- void onChange(
- T value
- Widget? divider,
- VoidCallback? onTap,
- bool? alwaysShowScrollBar,
- bool disable = false,
- 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);