bodyContent method

List<Widget> bodyContent(
  1. double width,
  2. double height,
  3. String selectedLanguage,
  4. List<String> idDocumentTypeList,
  5. bool iosDevice,
)

Implementation

List<Widget> bodyContent(double width, double height, String selectedLanguage,
    List<String> idDocumentTypeList, bool iosDevice) {
  return [
    Container(
      margin: const EdgeInsets.only(top: 10, bottom: 40),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Padding(
            padding: const EdgeInsets.only(left: 15, right: 15),
            child: Text(
              titleText[selectedLanguage]!,
              textAlign: TextAlign.start,
              style: const TextStyle(
                  color: Color(0xFF1CA7EC),
                  fontSize: 20,
                  fontWeight: FontWeight.w600),
            ),
          ),
          const SizedBox(
            height: 13,
          ),
          Column(
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  Container(
                    width: 28,
                    height: 28,
                    decoration: BoxDecoration(
                      border: Border.all(
                        color: progressBarColor,
                        width: 2.0,
                      ),
                      shape: BoxShape.circle,
                      color: progressBarColor,
                    ),
                    child: const Center(
                      child: Text(
                        '1',
                        style: TextStyle(
                          color: white,
                          fontSize: 19,
                          fontWeight: FontWeight.w400,
                        ),
                      ),
                    ),
                  ),
                  Container(
                    decoration: const BoxDecoration(
                      color: progressBarColor,
                    ),
                    width: 103,
                    height: 2,
                  ),
                  Container(
                    width: 28,
                    height: 28,
                    decoration: BoxDecoration(
                      border: Border.all(
                        color: const Color(0xFFD3D3D3),
                        width: 2.0,
                      ),
                      shape: BoxShape.circle,
                      color: const Color(0xFFD3D3D3),
                    ),
                    child: const Center(
                      child: Text(
                        '2',
                        style: TextStyle(
                          color: Color(0xFF888989),
                          fontSize: 19,
                          fontWeight: FontWeight.w400,
                        ),
                      ),
                    ),
                  ),
                  Container(
                    color: const Color(0xFF888989),
                    width: 103,
                    height: 2,
                  ),
                  Container(
                      width: 28,
                      height: 28,
                      decoration: BoxDecoration(
                        border: Border.all(
                          color: const Color(0xFFD3D3D3),
                          width: 2.0,
                        ),
                        shape: BoxShape.circle,
                        color: const Color(0xFFD3D3D3),
                      ),
                      child: const Center(
                        child: Text(
                          '3',
                          style: TextStyle(
                            color: Color(0xFF888989),
                            fontSize: 19,
                            fontWeight: FontWeight.w400,
                          ),
                        ),
                      )),
                ],
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  Container(
                    margin: const EdgeInsets.only(top: 5),
                    width: 86,
                    child: Center(
                      child: Text(
                        stepOneText[selectedLanguage]!,
                        textAlign: TextAlign.center,
                        style: const TextStyle(
                          color: Color(0xFF232323),
                          fontSize: 16,
                          fontWeight: FontWeight.w400,
                        ),
                      ),
                    ),
                  ),
                  Container(
                      margin: const EdgeInsets.only(left: 58),
                      child: Center(
                        child: Text(
                          stepTwoText[selectedLanguage]!,
                          style: const TextStyle(
                              color: Color(0xFF888989), fontSize: 16),
                        ),
                      )),
                  Container(
                      margin: const EdgeInsets.only(
                        left: 80,
                      ),
                      child: Center(
                        child: Text(
                          stepThreeText[selectedLanguage]!,
                          textAlign: TextAlign.center,
                          overflow: TextOverflow.visible,
                          style: const TextStyle(
                              color: Color(0xFF888989), fontSize: 16),
                        ),
                      )),
                ],
              ),
            ],
          )
        ],
      ),
    ),
    Center(
      child: Container(
          margin: EdgeInsets.only(bottom: height / 5, left: 30, right: 30),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Container(
                  margin: const EdgeInsets.only(bottom: 6, left: 18),
                  child: Text(
                    nationalityLableText[selectedLanguage]!,
                    style: const TextStyle(
                      color: textGrey,
                      fontSize: 16,
                    ),
                  )),
              Container(
                height: 50,
                width: 400,
                padding: const EdgeInsets.only(right: 2, left: 0),
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(10),
                  border: Border.all(
                    color: const Color(0xFF1ca7ec).withOpacity(0.2),
                  ),
                  color: Colors.white,
                ),
                margin: const EdgeInsets.only(
                  bottom: 27,
                ),
                child: Row(
                  children: [
                    selectedNationalityValue != null
                        ? Padding(
                            padding: const EdgeInsets.only(left: 5),
                            child: Image.network(
                              selectedNationalityValue == 'Japanese' ||
                                      selectedNationalityValue == 'Jepang'
                                  ? japanFlag
                                  : indonesiaFlag,
                              width: 28,
                              height: 28,
                            ),
                          )
                        : const SizedBox(
                            width: 0,
                          ),
                    Expanded(
                      child: NationalityChoice(
                        list: nationalityList[selectedLanguage]!,
                        selectTitle: nationalityLableText[selectedLanguage]!,
                        selectedValues: selectedNationalityValue,
                        getValue: selectedNationalityDropdown,
                        disabled: false,
                      ),
                    )
                  ],
                ),
              ),
              disabled
                  ? const SizedBox(
                      height: 100,
                    )
                  : Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Container(
                            margin:
                                const EdgeInsets.only(bottom: 6, left: 18),
                            child: Text(
                              documnetTypeLabelText[selectedLanguage]!,
                              style: const TextStyle(
                                color: textGrey,
                                fontSize: 16,
                              ),
                            )),
                        Container(
                          height: 50,
                          width: 400,
                          padding: const EdgeInsets.only(right: 2, left: 0),
                          decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(10),
                            border: Border.all(
                              color: const Color(0xFF1ca7ec).withOpacity(0.2),
                            ),
                            color: Colors.white,
                          ),
                          margin: const EdgeInsets.only(
                            bottom: 27,
                          ),
                          child: selectedNationalityValue! ==
                                  nationalityList[selectedLanguage]![0]
                              ? JpDocumentChoice(
                                  list: documentList,
                                  selectTitle: documnetTypeLabelText[
                                      selectedLanguage]!,
                                  selectedValues:
                                      japanSelectedIdDocumentValue,
                                  getValue: selectedIdDocumentTypeDropdown,
                                  disabled: disabled,
                                )
                              : IndoDocumentChoice(
                                  list: documentList,
                                  selectTitle: documnetTypeLabelText[
                                      selectedLanguage]!,
                                  selectedValues:
                                      indonesianSelectedIdDocumentValue,
                                  getValue: selectedIdDocumentTypeDropdown,
                                  disabled: disabled,
                                ),
                        ),
                      ],
                    )
            ],
          )),
    ),
    Column(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Container(
          width: double.infinity,
          margin: const EdgeInsets.only(right: 20, left: 20, bottom: 15),
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(5),
            gradient: LinearGradient(
              colors: selectedIdDocumentValue != null
                  ? const [
                      Color(0xFF1CA7EC),
                      Color(0xFF4ADEDE),
                    ]
                  : [disabledColor, disabledColor],
            ),
          ),
          height: 62,
          child: TextButton(
            onPressed: () {
              if (selectedIdDocumentValue != null) {
                context.read<VerificationBloc>().add(
                      VerificationEvent.assignDocumentAndNationality(
                        changeDocumentLanguage(
                            selectedIdDocumentValue.toString()),
                        changeNationalityLanguage(selectedNationalityValue!),
                      ),
                    );
                Navigator.of(context).push(
                  MaterialPageRoute(
                    builder: (routeContext) => PhotoRequirementsPage(
                      documentType: selectedIdDocumentValue.toString(),
                    ),
                  ),
                );
              }
            },
            child: Text(
              buttonTextContent[selectedLanguage]!,
              style: const TextStyle(fontSize: 16, color: Colors.white),
            ),
          ),
        ),
        SizedBox(
          height: height / (iosDevice ? 30 : 13),
        ),
        sloganWidget,
      ],
    )
  ];
}