skip to Main Content

When I build my Flutter project in release on iOS, when a ListTile appears inside the ListView I get a grey container instead of the actual listTile.
I suspect it has to do with the size of the ListView.
ListView

2

Answers


  1. Chosen as BEST ANSWER
                                      SizedBox(
                                      width: 100.w,
                                      child: Obx(() {
                                        return ListView.builder(
                                            shrinkWrap: true,
                                            itemCount: splitBillingController
                                                .splitUsers.length,
                                            itemBuilder: (context, int index) {
                                              return Padding(
                                                padding: const EdgeInsets.symmetric(
                                                    vertical: 8),
                                                child: splitBillingController
                                                        .isLoading.value
                                                    ? const Center(
                                                        child:
                                                            CircularProgressIndicator(
                                                          color: primaryColor,
                                                        ),
                                                      )
                                                    : Dismissible(
                                                        direction: DismissDirection
                                                            .endToStart,
                                                        confirmDismiss:
                                                            (direction) async {
                                                          // return null;
                                                          return await splitBillingController
                                                              .removeSplitter(
                                                                  splitBillingController
                                                                              .splitUsers[
                                                                          index]![
                                                                      "userId"]);
                                                        background: Container(
                                                          padding: const EdgeInsets
                                                                  .symmetric(
                                                              horizontal: 30),
                                                          alignment:
                                                              AlignmentDirectional
                                                                  .centerEnd,
                                                          color: Colors.red,
                                                          child: const Icon(
                                                            Icons.delete,
                                                            color: Colors.white,
                                                          ),
                                                        ),
                                                        key: Key(
                                                            splitBillingController
                                                                    .splitUsers[
                                                                index]!["userId"]),
                                                        child: ListTile(
                                                          textColor: buttonColor,
                                                          selected:
                                                              splitBillingController
                                                                          .splitUsers[
                                                                      index]![
                                                                  "isUnlocked"],
                                                          selectedColor:
                                                              Colors.white,
                                                          selectedTileColor:
                                                              buttonColor,
                                                          onTap: () async {
                                                            await splitBillingController
                                                                .approveUser(
                                                                    splitBillingController
                                                                            .splitUsers[
                                                                        index]);
                                                          },
                                                          shape:
                                                              RoundedRectangleBorder(
                                                            borderRadius:
                                                                BorderRadius
                                                                    .circular(24),
                                                          ),
                                                          tileColor: Colors.white,
                                                          // const Icon(Icons.credit_card),
                                                          leading:
                                                              CircularProfileAvatar(
                                                            splitBillingController
                                                                    .splitUsers[
                                                                index]!["photo"],
                                                            radius: 20,
                                                            borderWidth: 0,
                                                            placeHolder: (context,
                                                                    url) =>
                                                                SvgPicture.asset(
                                                              'assets/images/armadillo.svg',
                                                              height: 20,
                                                            ),
                                                          ),
                                                          title: Text(
                                                            splitBillingController
                                                                    .splitUsers[
                                                                index]!["userName"],
                                                            style: const TextStyle(
                                                                fontFamily:
                                                                    mainFontBold),
                                                          ),
                                                          subtitle: const Text(
                                                              "Passenger"),
                                                          trailing: Text(
                                                            "${splitBillingController.splitUsers[index]!["amount"].toStringAsFixed(2)}€",
                                                            style: const TextStyle(
                                                              fontSize: 22,
                                                              fontFamily:
                                                                  mainFontBold,
                                                            ),
                                                          ),
                                                        ),
                                                      ),
                                              );
                                            });
                                      }),
                                    ),```
    

  2. Connect the phone to the laptop and run the following in the terminal

    flutter run –release

    And then open this screen. I am sure you will find something in terminal

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search