showGenericDialogForMultiSelection function

void showGenericDialogForMultiSelection({
  1. required String headerText,
  2. required RxList<DropDownResponse> listItems,
  3. required Rxn<List<DropDownResponse>> selectedValues,
  4. required dynamic onItemsSelected(
    1. List<DropDownResponse>
    ),
})

Implementation

void showGenericDialogForMultiSelection({
  required String headerText,
  required RxList<DropDownResponse> listItems,
  required Rxn<List<DropDownResponse>> selectedValues,
  required Function(List<DropDownResponse>) onItemsSelected,
}) {
  if (GetPlatform.isMobile) {
    AppUtils.showActionBottomSheet(
        Get.context!,
        Padding(
          padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
          child: DropDownMultiSelection(
            listItems: listItems,
            selectedValues: selectedValues,
            onItemsSelected: onItemsSelected,
          ),
        ),
        isScrollControlled: true);
  } else {
    Get.dialog(GenericDropDownDialogBox(
      headerText: headerText,
      content: DropDownMultiSelection(
        listItems: listItems,
        selectedValues: selectedValues,
        onItemsSelected: onItemsSelected,
      ),
    ));
  }
}