Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leadingCheckBox not selected when pressed on it #12

Open
heshesh2010 opened this issue Sep 15, 2022 · 1 comment
Open

leadingCheckBox not selected when pressed on it #12

heshesh2010 opened this issue Sep 15, 2022 · 1 comment

Comments

@heshesh2010
Copy link

heshesh2010 commented Sep 15, 2022

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);
                            },
                          ));`
@jtcsProjHub
Copy link

I saw this same issue as well. I was messing around with it on Windows and thought that I had initialized the list incorrectly or something.

Not sure if this package is getting supported anymore. Hope it is, it's a handy one. Optional prefix/suffix icons on the list items like they have for the cards would be great, along with customization of the icons used for selection instead of it being locked to the "box and check" that it is now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants