Padding makeSuggestions()

in frontend/frontend-flutter/lib/main.dart [1534:1715]


  Padding makeSuggestions(
      List<String> listRandomQuestions, int scenarioNumber) {
    print("Main: makeSuggestions() : START");
    TextToDocParameter.lastScenarioNumber = scenarioNumber;

    return Padding(
      padding: const EdgeInsets.only(bottom: 20),
      child: Container(
          width: screenSize!.width,
          //height: screenSize!.height / 20,
          color: Colors.white,
          child: Row(
              mainAxisAlignment: MainAxisAlignment.end,
              mainAxisSize: MainAxisSize.min,
              children: [
                if (listRandomQuestions.length >= 1 &&
                    listRandomQuestions[0] != "x:")
                  Expanded(
                    child: ConstrainedBox(
                      constraints: BoxConstraints(
                        minWidth: 100.0, // Set minimum width
                        maxWidth: 400.0, // Set maximum width
                      ),
                      child: InkWell(
                        onTap: () {
                          //textEditingController.text = "Can you provide the Top 10 pace platinum accounts with booking value and YOY growth %?";
                          textEditingController.text =
                              listRandomQuestions[0].split(":")[1];
                          _isFirstQuestionNotAskedYet = false;
                          BlocProvider.of<NewSuggestionCubit>(context)
                              .generateNewSuggestions(
                                  scenarioNumber, textEditingController.text,
                                  isACannedQuestion: false);
                          print(
                              "Main: makeSuggestions() : textEditingController.text = = ${textEditingController.text}");
                        },
                        child: Card(
                          elevation: 5,
                          shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(10),
                          ),
                          child: Padding(
                            padding: const EdgeInsets.all(5.0),
                            child: Row(
                              children: [
                                Image.asset(
                                  "assets/images/suggestions.png",
                                  height: 20,
                                  width: 20,
                                  fit: BoxFit.cover,
                                ),
                                Flexible(
                                  child: Text(
                                      //' Can you provide the Top 10 pace platinum accounts with booking value and YOY growth %? ',
                                      listRandomQuestions[0].split(":")[1],
                                      style: TextStyle(
                                        decoration: TextDecoration.underline,
                                        fontSize: 15,
                                      ),
                                      softWrap: true,
                                      overflow: TextOverflow.ellipsis,
                                      maxLines: 2),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                    ),
                  ),
                //Container(width: 10),
                if (listRandomQuestions.length >= 2 &&
                    listRandomQuestions[1] != "x:")
                  Expanded(
                    child: ConstrainedBox(
                      constraints: BoxConstraints(
                        minWidth: 100.0, // Set minimum width
                        maxWidth: 400.0, // Set maximum width
                      ),
                      child: InkWell(
                        onTap: () {
                          textEditingController.text =
                              listRandomQuestions[1].split(":")[1];
                          _isFirstQuestionNotAskedYet = false;
                          BlocProvider.of<NewSuggestionCubit>(context)
                              .generateNewSuggestions(
                                  scenarioNumber, textEditingController.text,
                                  isACannedQuestion: false);
                          print(
                              "Main: makeSuggestions() : textEditingController.text = = ${textEditingController.text}");
                        },
                        child: Card(
                          elevation: 5,
                          shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(10),
                          ),
                          child: Padding(
                            padding: const EdgeInsets.all(5.0),
                            child: Row(
                              children: [
                                Image.asset(
                                  "assets/images/suggestions.png",
                                  height: 20,
                                  width: 20,
                                  fit: BoxFit.cover,
                                ),
                                Flexible(
                                  child: Text(
                                      listRandomQuestions[1].split(":")[1],
                                      style: TextStyle(
                                        decoration: TextDecoration.underline,
                                        fontSize: 15,
                                      ),
                                      softWrap: true,
                                      overflow: TextOverflow.ellipsis,
                                      maxLines: 2),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                    ),
                  ),
                //Container(width: 10),
                if (listRandomQuestions.length >= 3 &&
                    listRandomQuestions[2] != "x:")
                  Expanded(
                    child: ConstrainedBox(
                      constraints: BoxConstraints(
                        minWidth: 100.0, // Set minimum width
                        maxWidth: 400.0, // Set maximum width
                      ),
                      child: InkWell(
                        onTap: () {
                          textEditingController.text =
                              listRandomQuestions[2].split(":")[1];
                          _isFirstQuestionNotAskedYet = false;
                          BlocProvider.of<NewSuggestionCubit>(context)
                              .generateNewSuggestions(
                                  scenarioNumber, textEditingController.text,
                                  isACannedQuestion: false);
                          print(
                              "Main: makeSuggestions() : textEditingController.text = = ${textEditingController.text}");
                        },
                        child: Card(
                          elevation: 5,
                          shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(10),
                          ),
                          child: Padding(
                            padding: const EdgeInsets.all(5.0),
                            child: Row(
                              children: [
                                Image.asset(
                                  "assets/images/suggestions.png",
                                  height: 20,
                                  width: 20,
                                  fit: BoxFit.cover,
                                ),
                                Flexible(
                                  child: Text(
                                      //' Can you add CM sold margin to above list? ',
                                      listRandomQuestions[2].split(":")[1],
                                      style: TextStyle(
                                        decoration: TextDecoration.underline,
                                        fontSize: 15,
                                      ),
                                      softWrap: true,
                                      overflow: TextOverflow.ellipsis,
                                      maxLines: 2),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
                    ),
                  ),
              ])),
    );
  }