import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../../../../library/library.dart';
import '../../../../data/models/models.dart';
import '../controller.dart';
import 'b_s_price_filter.dart';

class BSChooseFilter extends StatelessWidget {
  final FilterModel model;

  BSChooseFilter({required this.model});

  @override
  Widget build(BuildContext context) {
    debugPrint('model ${model.code}');

    return GetBuilder<FilterController>(
      builder: (fc) {
        if (model.code == 'price') {
          return BSPriceFilter(title: model.name);
        } else /* if (model.code == 'brand') { */
          return MultiSelectBottomSheetGetX(
            model: model,
            onConfirm: (selectedItems) => fc.onMultipleSelectionConfirmed(model, selectedItems),
            onClear: (selectedItems) => fc.onMultipleSelectionCleared(model),
          );
      },
    );
  }
}
