switchStyle<T> static method

Widget switchStyle<T>({
  1. required List<T> items,
  2. T? value,
  3. required void onChanged(
    1. dynamic
    ),
  4. required Widget itemBuilder(
    1. T
    ),
  5. String? hintText,
  6. Color? activeColor,
})

Creates a single selection dropdown with switch style

Implementation

static Widget switchStyle<T>({
  required List<T> items,
  T? value,
  required void Function(dynamic) onChanged,
  required Widget Function(T) itemBuilder,
  String? hintText,
  Color? activeColor,
}) {
  return CustomAnimatedMultiDropDown<T>(
    animationType: DropdownAnimationType.liquid,
    items: items,
    value: value,
    onChanged: onChanged,
    itemBuilder: itemBuilder,
    hint: Text(hintText ?? 'Select an option'),
    config: MultiDropDownConfig(
      selectionMode: SelectionMode.single,
      highlightColor: activeColor ?? Colors.blue,
      selectorHeight: 56,
      indicatorConfig: IndicatorConfig.switchStyle(
        activeColor: activeColor ?? Colors.blue,
        size: 32,
      ),
    ),
  );
}