Home > Software design >  How to fix A RenderFlex overflowed by 2772 pixels on the bottom
How to fix A RenderFlex overflowed by 2772 pixels on the bottom

Time:11-10

enter image description here

Hello can anyone help me how to solve the issue of RenderFlex overflowed by 2772 pixels on the bottom.

This is my code.

Container(
                                width: MediaQuery.of(context).size.width >= 1000
                                    ? 1000
                                    : MediaQuery.of(context).size.width,
                                child: Column(
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  crossAxisAlignment:
                                      CrossAxisAlignment.start,
                                  children: [
                                    Text('Insurance & Takaful/Out patient',
                                        style: TextStyle(
                                            fontSize: 16,
                                            fontWeight: FontWeight.bold)),
                                    SizedBox(height: 30),
                                    Row(
                                      children: [
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPPanel,
                                              'Panel',
                                              1,
                                              true),
                                        ),
                                        SizedBox(width: 15),
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPPolicyNumber,
                                              'Policy number',
                                              1,
                                              true),
                                        ),
                                        SizedBox(width: 15),
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPPolicyEffectiveDate,
                                              'Policy effective date',
                                              1,
                                              true),
                                        ),
                                      ],
                                    ),
                                    SizedBox(height: 10),
                                    Row(
                                      children: [
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPPolicyExpireDate,
                                              'Policy expiry date',
                                              1,
                                              true),
                                        ),
                                        SizedBox(width: 15),
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPGPLimit,
                                              'GP limit',
                                              1,
                                              true),
                                        ),
                                        SizedBox(width: 15),
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPGPUtilised,
                                              'GP utilised',
                                              1,
                                              true),
                                        )
                                      ],
                                    ),
                                    SizedBox(height: 10),
                                    Row(
                                      children: [
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPGPBalance,
                                              'GP balance',
                                              1,
                                              true),
                                        ),
                                        SizedBox(width: 15),
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPSPLimit,
                                              'SP limit',
                                              1,
                                              true),
                                        ),
                                        SizedBox(width: 15),
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPSPUtilised,
                                              'SP utilised',
                                              1,
                                              true),
                                        )
                                      ],
                                    ),
                                    SizedBox(height: 10),
                                    Row(
                                      children: [
                                        Expanded(
                                          flex: 1,
                                          child: textformfieldBuild(
                                              insuranceOPSPBalance,
                                              'SP balance',
                                              1,
                                              true),
                                        ),
                                        SizedBox(width: 15),
                                        Expanded(
                                          flex: 1,
                                          child: Container(),
                                        ),
                                        SizedBox(width: 15),
                                        Expanded(
                                          flex: 1,
                                          child: Container(),
                                        )
                                      ],
                                    ),
                                    SizedBox(height: 10),
                                  ],
                                ),
                              ),

How to solve this problem without using the SingleChildScrollView widget? Or this is the only solution available to solve this problem? I hope someone can help me to solve this problem. Thank you.

CodePudding user response:

Remove your column and add ListView Widget and add scrollDirection: Axis.horizontal,

CodePudding user response:

i think the best way to slove this by just adding SingleChildScrollView

  • Related