Skip to content

leadingCheckBox not selected when pressed on it #12

@heshesh2010

Description

@heshesh2010

Hi ,

when i press on row the row is selected and also leadingCheckBox selected as well ,

but when i hit on (leadingCheckBox) only the row doesn't updating

`Expanded(
                          flex: 5,
                          child: MultiSelectCheckList(
                            isMaxSelectableWithPerpetualSelects: true,
                            //      maxSelectableCount: 5,
                            textStyles: const MultiSelectTextStyles(
                                selectedTextStyle: TextStyle(
                                    color: Colors.white,
                                    fontWeight: FontWeight.bold)),
                            itemsDecoration: MultiSelectDecorations(
                                selectedDecoration: BoxDecoration(
                                    color: Colors.indigo.withOpacity(0.8))),
                            listViewSettings: ListViewSettings(
                                separatorBuilder: (context, index) =>
                                    const Divider(
                                      height: 0,
                                    )),
                            controller: _controller,
                            items: List.generate(
                                controller.packagesList.value.data?.length ?? 0,
                                (index) => CheckListCard(
                                  leadingCheckBox: true,
                                    enabled: true,
                                    value: controller
                                            .packagesList.value.data?[index] ??
                                        PackageData(),
                                    title: Row(
                                      mainAxisAlignment:
                                          MainAxisAlignment.spaceBetween,
                                      children: [
                                        Text(controller
                                                .packagesList
                                                .value
                                                .data?[index]
                                                .title?[langCode] ??
                                            ""),
                                        Column(
                                          children: [
                                            Text(
                                              "${controller.packagesList.value.data?[index].price.toString() ?? ""}EGP/${controller.packagesList.value.data?[index].priceType ?? ""}",
                                            ),
                                            Row(
                                              mainAxisAlignment:
                                                  MainAxisAlignment
                                                      .spaceBetween,
                                              children: <Widget>[
                                                ElevatedButton(
                                                  style:
                                                      ElevatedButton.styleFrom(
                                                          backgroundColor:
                                                              Colors.white),
                                                  onPressed: () {
                                                    controller.incement(index);
                                                  },
                                                  child: const Icon(Icons.add,
                                                      color: Colors.black87),
                                                ),
                                                const SizedBox(
                                                  width: 10,
                                                ),
                                                Obx(() => Text(
                                                      '${controller.numberOfItems[index]}',
                                                      style: const TextStyle(
                                                          fontSize: 18.0),
                                                    )),
                                                const SizedBox(
                                                  width: 10,
                                                ),
                                                ElevatedButton(
                                                  style:
                                                      ElevatedButton.styleFrom(
                                                          backgroundColor:
                                                              Colors.white),
                                                  onPressed: () {
                                                    controller.decrement(index);
                                                  },
                                                  child: const Icon(
                                                    Icons.remove,
                                                    color: Colors.black87,
                                                  ),
                                                )
                                              ],
                                            ),
                                          ],
                                        ),
                                      ],
                                    ),
                                    subtitle: Text(
                                        "${controller.packagesList.value.data?[index].points.toString() ?? ""}  Points "),
                                    selectedColor: Colors.white,
                                    checkColor: Colors.indigo,
                                    //   selected: index == 1,

                                    checkBoxBorderSide:
                                        const BorderSide(color: Colors.blue),
                                    shape: RoundedRectangleBorder(
                                        borderRadius:
                                            BorderRadius.circular(5)))),
                            onChange: (List<PackageData?> allSelectedItems,
                                PackageData? selectedItem) {
                              controller.setSelectedPackageData(
                                  selectedItem, allSelectedItems);
                            },
                            onMaximumSelected:
                                (List<PackageData?> allSelectedItems,
                                    PackageData? selectedItem) {
                              // CustomSnackBar.showInSnackBar(
                              //     'The limit has been reached', context);
                            },
                          ));`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions