void onSelectAllChange(bool? value) {
    setState(() {
      selectAllCheckboxValue = value;
      // Set the checkbox value for each quotation in the list
      for (var quotation in branchmanagerQuotationsList) {
        quotation.isChecked = value!;
        int? quotationId = quotation.id;
        if (quotationId != null) {
          if (value!) {
            if (!quotationsChecked.contains(quotationId)) {
              quotationsChecked.add(quotationId);
            }
          } else {
            quotationsChecked.remove(quotationId);
          }
        }
        debugPrint('quotationsChecked inside onSelectALl: $quotationsChecked');
      }
      debugPrint('quotationsChecked inside onSelectALl: $quotationsChecked');
    });
  } this is my function htat handle select ll fucntinoality and here is my child widget with the get checkbox import 'package:custom_pop_up_menu/custom_pop_up_menu.dart';
import 'package:emis_mobile/constants/enums.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:responsive_sizer/responsive_sizer.dart';

class BranchmanagerQuotationWidget extends StatelessWidget {
  BranchmanagerQuotationWidget({
    super.key,
    required this.itemName,
    required this.scrollController,
    required this.child,
    required this.itemInfoPopupChild,
    required this.quoteStatus,
    this.quoteSyncStatus,
    this.isFirstIndex = false,
    required this.checkboxValue,
    this.selectAllCheckboxValue,
    this.unFoundQuote,
    required this.onCheckboxChange,
    required this.selectAll,
    this.onSelectAllChange,
    this.onAcceptPressed,
    this.onRejectPressed,
    this.isChecked = false,
    this.quotationSubclassIndex,
    this.subclassCode,
  });

  final String itemName;
  final ScrollController scrollController;
  final Widget child;
  final Widget itemInfoPopupChild;
  final CustomPopupMenuController _controller = CustomPopupMenuController();
  final QuotationStatus? quoteStatus;
  final String? quoteSyncStatus;
  bool isChecked; // Add isChecked property
  final bool isFirstIndex;
  final bool? checkboxValue;
  final bool? selectAllCheckboxValue;
  final bool selectAll;
  final Function(bool?)? onSelectAllChange;
  final Function(bool?)? onCheckboxChange;
  final String? unFoundQuote;

  final Function()? onRejectPressed;
  final Function()? onAcceptPressed;

  final int? quotationSubclassIndex; // Define quotationSubclassIndex variable
  final String? subclassCode; // Define subclassCode variable

  BoxShadow getBoxShadow() {
    switch (quoteStatus) {
      // case QuotationStatus.SUPERVISOR_APPROVED:
      //   return const BoxShadow(
      //       color: Colors.green, blurRadius: 3, offset: Offset(1, -4));
      // case QuotationStatus.STATISTICIAN_APPROVED:
      //   return const BoxShadow(
      //       color: Colors.green, blurRadius: 3, offset: Offset(1, -4));
      // case QuotationStatus.REJECTED:
      //   return const BoxShadow(
      //       color: Colors.red, blurRadius: 3, offset: Offset(1, -4));
      // case QuotationStatus.PENDING:
      //   return BoxShadow(
      //       color: Colors.grey.shade300.withOpacity(0.4),
      //       blurRadius: 10,
      //       offset: const Offset(2, 5));
      // default:
      //   return BoxShadow(
      //       color: Colors.grey.shade300.withOpacity(0.4),
      //       blurRadius: 10,
      //       offset: const Offset(2, 5));
      case QuotationStatus.BRANCH_APPROVED:
        return const BoxShadow(
            color: Colors.green, blurRadius: 3, offset: Offset(1, -4));
      case QuotationStatus.REJECTED:
        return const BoxShadow(
            color: Colors.red, blurRadius: 3, offset: Offset(1, -4));
      case QuotationStatus.STATISTICIAN_APPROVED:
        return BoxShadow(
            color: Colors.grey.shade300.withOpacity(0.4),
            blurRadius: 10,
            offset: const Offset(2, 5));
      default:
        return BoxShadow(
            color: Colors.grey.shade300.withOpacity(0.4),
            blurRadius: 10,
            offset: const Offset(2, 5));
    }
  }

  Widget getStatusWidget() {
    switch (quoteStatus) {
      // case QuotationStatus.SUPERVISOR_APPROVED:
      //   return Container(
      //     decoration: const BoxDecoration(),
      //     child: Row(
      //       children: [
      //         Text('Approved',
      //             style:
      //                 TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w600)),
      //         SizedBox(width: 1.w),
      //         SvgPicture.asset('assets/tick.svg', height: 3.h, width: 5.w),
      //       ],
      //     ),
      //   );
      // case QuotationStatus.STATISTICIAN_APPROVED:
      //   return Container(
      //     decoration: const BoxDecoration(),
      //     child: Row(
      //       children: [
      //         Text('Approved',
      //             style:
      //                 TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w600)),
      //         SizedBox(width: 1.w),
      //         SvgPicture.asset('assets/tick.svg', height: 3.h, width: 5.w),
      //       ],
      //     ),
      //   );
      case QuotationStatus.BRANCH_APPROVED:
        return Container(
          decoration: const BoxDecoration(),
          child: Row(
            children: [
              Text('Approved',
                  style:
                      TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w600)),
              SizedBox(width: 1.w),
              SvgPicture.asset('assets/tick.svg', height: 3.h, width: 5.w),
            ],
          ),
        );
      case QuotationStatus.REJECTED:
        return Container(
          decoration: const BoxDecoration(),
          child: Row(
            children: [
              Text('Rejected',
                  style:
                      TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w600)),
              SizedBox(width: 1.w),
              SvgPicture.asset('assets/cross.svg', height: 3.h, width: 5.w),
            ],
          ),
        );
      // case QuotationStatus.PENDING:
      //   return Container(
      //     decoration: const BoxDecoration(),
      //     child: const Row(
      //       children: [],
      //     ),
      //   );
      case QuotationStatus.STATISTICIAN_APPROVED:
        return Container(
          decoration: const BoxDecoration(),
          child: Row(
            children: const [],
          ),
        );
      default:
        return const SizedBox.shrink();
    }
  }

  // Widget getCheckbox() {
  //   {
  //     if (quoteStatus == QuotationStatus.STATISTICIAN_APPROVED ||
  //         quoteStatus == QuotationStatus.BRANCH_APPROVED ||
  //         quoteStatus == QuotationStatus.REJECTED) {
  //       return const SizedBox.shrink();
  //     } else {
  //       return Checkbox(
  //         value: checkboxValue,
  //         onChanged: onCheckboxChange,
  //       );
  //       // return Row(
  //       //   children: [
  //       //     Visibility(
  //       //       visible: selectAll, // Show the "Select All" checkbox
  //       //       child: Checkbox(
  //       //         value: selectAll ? selectAllCheckboxValue : false,
  //       //         onChanged: onSelectAllChange,
  //       //       ),
  //       //     ),
  //       //     Visibility(
  //       //       visible:
  //       //           !selectAll, // Show the individual checkbox if "Select All" is unchecked
  //       //       child: Checkbox(
  //       //         value: !selectAll ? checkboxValue : false,
  //       //         onChanged: onCheckboxChange,
  //       //       ),
  //       //     ),
  //       //   ],
  //       // );

  //       // if (selectAll) {
  //       //   // Show the "Select All" checkbox
  //       //   return Checkbox(
  //       //     value: checkboxValue,
  //       //     onChanged: onSelectAllChange,
  //       //   );
  //       // } else {
  //       //   // Show the individual checkbox if "Select All" is unchecked
  //       //   return Checkbox(
  //       //     value: checkboxValue,
  //       //     onChanged: onCheckboxChange,
  //       //   );
  //       // }
  //     }
  //   }
  // }

  Widget getCheckbox() {
    if (
        // quoteStatus == QuotationStatus.STATISTICIAN_APPROVED ||
        quoteStatus == QuotationStatus.BRANCH_APPROVED ||
            quoteStatus == QuotationStatus.REJECTED) {
      return const SizedBox.shrink();
    } else {
      if (selectAll) {
        // Show the "Select All" checkbox
        return Checkbox(
          value: selectAllCheckboxValue ?? false,
          onChanged: onSelectAllChange,
        );
      } else {
        // Show the individual checkbox if "Select All" is unchecked
        return Checkbox(
          value: checkboxValue ?? false,
          onChanged: onCheckboxChange,
        );
      }
    }
  }

  Widget getApproveRejectBtns() {
    if (quoteStatus == QuotationStatus.BRANCH_APPROVED ||
        quoteStatus == QuotationStatus.REJECTED) {
      return const SizedBox.shrink();
    } else {
      return Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          InkWell(
            onTap: onRejectPressed,
            child: SvgPicture.asset(
              'assets/cross.svg',
              height: 3.h,
              width: 5.w,
            ),
          ),
          SizedBox(width: 3.w),
          InkWell(
            onTap: onAcceptPressed,
            child: SvgPicture.asset(
              'assets/tick.svg',
              height: 3.h,
              width: 5.w,
            ),
          ),
        ],
      );
    }
  }

  @override
  Widget build(BuildContext context) {
    debugPrint('BranchmanagerQuotationWidget Screen');
    return Stack(
      children: [
        Container(
          padding: EdgeInsets.symmetric(horizontal: 2.w),
          margin: EdgeInsets.only(top: isFirstIndex ? 1.h : 0),
          decoration: BoxDecoration(
            // color: Colors.white,
            // boxShadow: [getBoxShadow()],
            borderRadius: BorderRadius.circular(10.0),
          ),
          child: SizedBox(
            height: 18.h,
            // height: 21.h,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                //
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    //
                    // getCheckbox(),
                    SizedBox(
                      width: 95.w,
                      child: Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          //
                          Row(
                            crossAxisAlignment: CrossAxisAlignment.center,
                            children: [
                              //* checkbox for multiple selection
                              getCheckbox(),
                              Text(itemName,
                                  style: TextStyle(
                                      fontSize: 15.sp,
                                      fontWeight: FontWeight.w600,
                                      color: Colors.black)),
                              SizedBox(width: 1.w),
                              CustomPopupMenu(
                                menuBuilder: () => ClipRRect(
                                    borderRadius: BorderRadius.circular(5),
                                    child: itemInfoPopupChild),
                                pressType: PressType.singleClick,
                                verticalMargin: -10,
                                controller: _controller,
                                child: const Icon(Icons.info),
                              ),
                            ],
                          ),

                          Row(
                            crossAxisAlignment: CrossAxisAlignment.center,
                            children: [
                              // quoteSyncStatus != null
                              //     ? const SizedBox.shrink()
                              //     :
                              Row(
                                children: [
                                  quoteStatus !=
                                              QuotationStatus
                                                  .SUPERVISOR_APPROVED ||
                                          quoteStatus ==
                                              QuotationStatus.REJECTED ||
                                          quoteStatus ==
                                              QuotationStatus
                                                  .STATISTICIAN_APPROVED ||
                                          quoteStatus ==
                                              QuotationStatus.BRANCH_APPROVED
                                      // quoteSyncStatus != null
                                      ? const SizedBox.shrink()
                                      : Row(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.center,
                                          children: [
                                            InkWell(
                                                onTap: onRejectPressed,
                                                child: SvgPicture.asset(
                                                    'assets/cross.svg',
                                                    height: 3.h,
                                                    width: 5.w)),
                                            SizedBox(width: 3.w),
                                            InkWell(
                                                onTap: onAcceptPressed,
                                                child: SvgPicture.asset(
                                                    'assets/tick.svg',
                                                    height: 3.h,
                                                    width: 5.w)),
                                          ],
                                        ),
                                  getStatusWidget(),
                                  getApproveRejectBtns(),
                                ],
                              ),
                            ],
                          )
                          //
                        ],
                      ),
                    ),
                  ],
                ),
                const Divider(color: Colors.black),
                SizedBox(height: 1.h),
                //
                child
                //
              ],
            ),
          ),
        ),
      ],
    );
  }
}
now in my branchComponenet when i get the checkbox  Checkbox(
                                    value: selectAllCheckboxValue ?? false,
                                    // onChanged: (value) {
                                    //   setState(() {
                                    //     for (var quotation
                                    //         in branchmanagerQuotationsList) {
                                    //       quotation.isChecked = value!;
                                    //     }
                                    //     isAllSelected = value!;
                                    //   });
                                    // },
                                    onChanged: (value) {
                                      setState(() {
                                        selectAllCheckboxValue = value;
                                        for (var quotation
                                            in branchmanagerQuotationsList) {
                                          quotation.isChecked = value!;
                                          int? quotationId = quotation.id;

                                          if (quotationId != null) {
                                            if (value!) {
                                              if (!quotationsChecked
                                                  .contains(quotationId)) {
                                                quotationsChecked
                                                    .add(quotationId);
                                              }
                                            } else {
                                              quotationsChecked
                                                  .remove(quotationId);
                                            }
                                          }
                                        }
                                      });

                                      debugPrint(
                                          'Selected quotations: $quotationsChecked');
                                      debugPrint(
                                          'Select All checkbox new value: $value');
                                    },
                                  ),
                                 selecting the top level check box also selects the subclasses in the list of subclasses but the valuse in quotationsChecked is of the initial subclass selected, so how do i fix the ui from displaying other subclasses as selected