CustomSingleSearchSelect<T> constructor

CustomSingleSearchSelect<T>({
  1. required List<T> items,
  2. required String title,
  3. required void onSelect(
    1. dynamic value
    ),
  4. double? dialogWidth,
  5. double? dialogHeight,
  6. InputDecoration? decoration,
  7. InputDecoration? searchDecoration,
  8. T? valueSelected,
  9. Color selectedItemColor = Colors.redAccent,
  10. String? cancelText,
  11. Color? cancelBackgroundColor,
  12. TextStyle? cancelTextStyle,
  13. TextStyle? titleTextStyle,
  14. Color? itemBackgroundColor,
  15. Color? titleBackgroundColor,
  16. Color? separatorColor,
  17. double? separatorHeight,
  18. TextStyle? itemTextStyle,
  19. TextStyle? searchStyle,
  20. bool? isBarrierDismissible,
  21. TextStyle? selectedItemTextStyle,
})

Implementation

CustomSingleSearchSelect(
    {required this.items,
    required this.title,
    required this.onSelect,
    this.dialogWidth,
    this.dialogHeight,
    this.decoration,
    this.searchDecoration,
    this.valueSelected,
    this.selectedItemColor = Colors.redAccent,
    this.cancelText,
    this.cancelBackgroundColor,
    this.cancelTextStyle,
    this.titleTextStyle,
    this.itemBackgroundColor,
    this.titleBackgroundColor,
    this.separatorColor,
    this.separatorHeight,
    this.itemTextStyle,
    this.searchStyle,
    this.isBarrierDismissible,
    this.selectedItemTextStyle})
    : super(
          initialValue: valueSelected,
          builder: (FormFieldState<T> state) {
            CustomSingleSearchSelectView<T> field =
                CustomSingleSearchSelectView<T>(
              title: title,
              items: items,
              width: dialogWidth,
              height: dialogHeight,
              onSelect: onSelect,
              decoration: decoration,
              searchDecoration: searchDecoration,
              initialValue: valueSelected,
              selectedItemColor: selectedItemColor,
              cancelText: cancelText,
              cancelBackgroundColor: cancelBackgroundColor,
              cancelTextStyle: cancelTextStyle,
              titleTextStyle: titleTextStyle,
              itemBackgroundColor: itemBackgroundColor,
              titleBackgroundColor: titleBackgroundColor,
              separatorColor: separatorColor,
              separatorHeight: separatorHeight,
              itemTextStyle: itemTextStyle,
              searchStyle: searchStyle,
              isBarrierDismissible: isBarrierDismissible!,
              selectedItemTextStyle: selectedItemTextStyle,
              state: state,
            );
            return CustomSingleSearchSelectView<T>._withState(field, state);
          });