import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';

Widget filterBottomSheetWidget({
  required Rx<Jalali> fromDate,
  required Function(Jalali jalali) onChangedFromDate,
  required Rx<Jalali> toDate,
  required Function(Jalali jalali) onChangedToDate,
  required VoidCallback onSubmit,
}) {
  return BaseBottomSheet(
    height: 200,
    child: Column(
      spacing: 16,
      children: [
        Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
        Row(
          spacing: 8,
          children: [
            Expanded(
              child: dateFilterWidget(date: fromDate, onChanged: onChangedFromDate),
            ),
            Expanded(
              child: dateFilterWidget(isFrom: false, date: toDate, onChanged: onChangedToDate),
            ),
          ],
        ),

        RElevated(
          height: 40,
          isFullWidth: true,
          backgroundColor: AppColor.greenNormal,
          text: 'اعمال فیلتر',
          onPressed: () {
            onSubmit();
            Get.back();
          },
        ),

      ],
    ),
  );
}
