Home > Net >  Flutter: A RenderFlex overflowed by 282 pixels on the bottom
Flutter: A RenderFlex overflowed by 282 pixels on the bottom

Time:09-17

I want tyo scroll only bottom of custom stepper page but i got the error, I can't fix this error please help me I want tyo scroll only bottom of custom stepper page but i got the error, I can't fix this error please help me I want tyo scroll only bottom of custom stepper page but i got the error, I can't fix this error please help me I want tyo scroll only bottom of custom stepper page but i got the error, I can't fix this error please help me

This is my code

import 'package:evillage_app/screens/businessPages/customStepperPage.dart';
import 'package:evillage_app/screens/businessPages/shop_certification.dart';
import 'package:evillage_app/style/style.dart';
import 'package:evillage_app/widget/button.dart';
import 'package:evillage_app/widget/button2.dart';
import 'package:evillage_app/widget/my_appbar_noSearch.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';

class ShopDetailsPage extends StatefulWidget {
  const ShopDetailsPage({Key? key}) : super(key: key);

  @override
  _ShopDetailsPageState createState() =>
      _ShopDetailsPageState();
}

class _ShopDetailsPageState extends State<ShopDetailsPage> {
  String? _selectedState;
  String? _selectedTehsil;
  String? _selectedShopCategory;

  TextEditingController _shopNameController = TextEditingController();
  TextEditingController _contactNumController = TextEditingController();
  TextEditingController _websiteController = TextEditingController();
  TextEditingController _addressController = TextEditingController();
  TextEditingController _areaController = TextEditingController();
  TextEditingController _pinocodeController = TextEditingController();
  TextEditingController _landmarkController = TextEditingController();
  TextEditingController _aboutShopController = TextEditingController();


  @override
  Widget build(BuildContext context) {
    return  Scaffold(
      appBar: MyAppbarNoSearch(),
      body: Container(
          child: Column(
            children: [
              Container(
                color: mPrimaryColor,
                height: MediaQuery.of(context).size.height / 23,
                width: MediaQuery.of(context).size.width,
                child: Row(
                  children: [
                    SizedBox(
                      width: 15,
                    ),
                    InkWell(
                      onTap: () {
                        Navigator.pop(context);
                      },
                      child: Container(
                        height: MediaQuery.of(context).size.height / 23,
                        width: 30,
                        child: Icon(
                          Icons.arrow_back_ios_rounded,
                          size: 20,
                          color: whitetext,
                        ),
                      ),
                    ),
                    Expanded(
                      child: Text(
                        "BUSINESS REGISTRATION".tr(),
                        style: headingWhite(),
                        textAlign: TextAlign.center,
                      ),
                    ),
                    SizedBox(
                      width: 40,
                    )
                  ],
                ),
              ),

              CustomStepper(selectedIndex: 1,),
              SingleChildScrollView(

                child: Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 8,vertical: 15),
                  child: Column(

                    children: [
                      // SizedBox(height: 30,),
                      Container(
                        height: 40,
                        width: MediaQuery.of(context).size.width,
                        child: TextFormField(
                          controller: _shopNameController,
                          keyboardType: TextInputType.text,
                          decoration: InputDecoration(
                              hintText: 'ENTER SHOP NAME',
                              contentPadding: EdgeInsets.symmetric(
                                  horizontal: 10, vertical: 0),
                              enabledBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(color: greyc, width: 0),
                              ),
                              focusedBorder: OutlineInputBorder(
                                  borderSide: BorderSide(
                                      color: mPrimaryColor, width: 1.0),
                                  borderRadius: BorderRadius.circular(8.0))),
                          onChanged: (value) {},
                        ),
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      Container(
                        height: 40,
                        width: MediaQuery.of(context).size.width,
                        child: TextFormField(
                          controller: _contactNumController,
                          keyboardType: TextInputType.text,
                          decoration: InputDecoration(
                              hintText: 'ENTER CONTACT NO',
                              contentPadding: EdgeInsets.symmetric(
                                  horizontal: 10, vertical: 0),
                              enabledBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(color: greyc, width: 0),
                              ),
                              focusedBorder: OutlineInputBorder(
                                  borderSide: BorderSide(
                                      color: mPrimaryColor, width: 1.0),
                                  borderRadius: BorderRadius.circular(8.0))),
                          onChanged: (value) {},
                        ),
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      Container(
                        height: 40,
                        width: MediaQuery.of(context).size.width,
                        child: TextFormField(
                          controller: _websiteController,
                          keyboardType: TextInputType.text,
                          decoration: InputDecoration(
                              hintText: 'ENTER WEBSITE',
                              contentPadding: EdgeInsets.symmetric(
                                  horizontal: 10, vertical: 0),
                              enabledBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(color: greyc, width: 0),
                              ),
                              focusedBorder: OutlineInputBorder(
                                  borderSide: BorderSide(
                                      color: mPrimaryColor, width: 1.0),
                                  borderRadius: BorderRadius.circular(8.0))),
                          onChanged: (value) {},
                        ),
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      TextFormField(
                        controller: _addressController,
                        decoration: InputDecoration(
                            hintText: "ENTER FULL ADDRESS",
                            contentPadding: EdgeInsets.symmetric(
                                horizontal: 10, vertical: 10),
                            enabledBorder: OutlineInputBorder(
                              borderRadius: BorderRadius.circular(8),
                              borderSide: BorderSide(color: greyc, width: 0),
                            ),
                            focusedBorder: OutlineInputBorder(
                                borderSide:
                                    BorderSide(color: mPrimaryColor, width: 1.0),
                                borderRadius: BorderRadius.circular(8.0))),
                        keyboardType: TextInputType.multiline,
                        maxLines: 4,
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      Row(
                        children: [
                          Container(
                            height: 40,
                            width: MediaQuery.of(context).size.width / 2.43,
                            child: TextFormField(
                              controller: _areaController,
                              keyboardType: TextInputType.text,
                              decoration: InputDecoration(
                                  hintText: 'ENTER AREA',
                                  contentPadding: EdgeInsets.symmetric(
                                      horizontal: 10, vertical: 0),
                                  enabledBorder: OutlineInputBorder(
                                    borderRadius: BorderRadius.circular(8),
                                    borderSide:
                                        BorderSide(color: greyc, width: 0),
                                  ),
                                  focusedBorder: OutlineInputBorder(
                                      borderSide: BorderSide(
                                          color: mPrimaryColor, width: 1.0),
                                      borderRadius: BorderRadius.circular(8.0))),
                              onChanged: (value) {},
                            ),
                          ),
                          SizedBox(
                            width: 15,
                          ),
                          Container(
                            height: 40,
                            width: MediaQuery.of(context).size.width / 2.43,
                            child: TextFormField(
                              controller: _pinocodeController,
                              keyboardType: TextInputType.text,
                              decoration: InputDecoration(
                                  hintText: 'ENTER PINCODE',
                                  contentPadding: EdgeInsets.symmetric(
                                      horizontal: 10, vertical: 0),
                                  enabledBorder: OutlineInputBorder(
                                    borderRadius: BorderRadius.circular(8),
                                    borderSide:
                                        BorderSide(color: greyc, width: 0),
                                  ),
                                  focusedBorder: OutlineInputBorder(
                                      borderSide: BorderSide(
                                          color: mPrimaryColor, width: 1.0),
                                      borderRadius: BorderRadius.circular(8.0))),
                              onChanged: (value) {},
                            ),
                          ),
                        ],
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      Row(
                        children: [
                          Expanded(
                            child: Container(
                              height: 35,
                              padding:
                                  EdgeInsets.only(top: 0, left: 4, bottom: 0),
                              decoration: BoxDecoration(
                                  borderRadius: BorderRadius.circular(8),
                                  border: Border.all(color: greyc, width: 0.5)),
                              child: DropdownButtonHideUnderline(
                                child: DropdownButton<String>(
                                  focusColor: Colors.red,
                                  hint: Text(
                                    "State".tr(),
                                    style: TextStyle(
                                        fontSize: 13,
                                        fontWeight: FontWeight.w500),
                                    overflow: TextOverflow.ellipsis,
                                  ),
                                  value: _selectedState,
                                  isExpanded: true,
                                  elevation: 2,
                                  icon: Icon(
                                    // Add this
                                    Icons.arrow_drop_down, // Add this
                                    color: mPrimaryColorLight, // Add this
                                  ),
                                  items: <String>[
                                    'Maharashtra'.tr(),
                                    'Gujrat'.tr()
                                  ].map((String value) {
                                    return DropdownMenuItem<String>(
                                      value: value,
                                      child: new Text(
                                        value,
                                        style: TextStyle(
                                            fontSize: 13,
                                            fontWeight: FontWeight.w500),
                                        overflow: TextOverflow.ellipsis,
                                      ),
                                    );
                                  }).toList(),
                                  onChanged: (String? val) {
                                    setState(() {
                                      _selectedState = val;
                                    });
                                  },
                                ),
                              ),
                            ),
                          ),
                          SizedBox(
                            width: 15,
                          ),
                          Expanded(
                            child: Container(
                              height: 35,
                              padding:
                                  EdgeInsets.only(top: 0, left: 4, bottom: 0),
                              decoration: BoxDecoration(
                                  borderRadius: BorderRadius.circular(8),
                                  border: Border.all(color: greyc, width: 0.5)),
                              child: DropdownButtonHideUnderline(
                                child: DropdownButton<String>(
                                  focusColor: Colors.red,
                                  hint: Text(
                                    "Tehsil".tr(),
                                    style: TextStyle(
                                        fontSize: 13,
                                        fontWeight: FontWeight.w500),
                                    overflow: TextOverflow.ellipsis,
                                  ),
                                  value: _selectedTehsil,
                                  isExpanded: true,
                                  elevation: 2,
                                  icon: Icon(
                                    // Add this
                                    Icons.arrow_drop_down, // Add this
                                    color: mPrimaryColorLight, // Add this
                                  ),
                                  items: <String>[
                                    'Waghle'.tr(),
                                    'Jawhar pada'.tr()
                                  ].map((String value) {
                                    return DropdownMenuItem<String>(
                                      value: value,
                                      child: new Text(
                                        value,
                                        style: TextStyle(
                                            fontSize: 13,
                                            fontWeight: FontWeight.w500),
                                        overflow: TextOverflow.ellipsis,
                                      ),
                                    );
                                  }).toList(),
                                  onChanged: (String? val) {
                                    setState(() {
                                      _selectedTehsil = val;
                                    });
                                  },
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      Container(
                        height: 40,
                        width: MediaQuery.of(context).size.width,
                        child: TextFormField(
                          controller: _landmarkController,
                          keyboardType: TextInputType.text,
                          decoration: InputDecoration(
                              hintText: 'LANDMARK',
                              contentPadding: EdgeInsets.symmetric(
                                  horizontal: 10, vertical: 0),
                              enabledBorder: OutlineInputBorder(
                                borderRadius: BorderRadius.circular(8),
                                borderSide: BorderSide(color: greyc, width: 0),
                              ),
                              focusedBorder: OutlineInputBorder(
                                  borderSide: BorderSide(
                                      color: mPrimaryColor, width: 1.0),
                                  borderRadius: BorderRadius.circular(8.0))),
                          onChanged: (value) {},
                        ),
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      Row(
                        children: [
                          Text(
                            "SHOP LOCATION",
                            style: cardTitleGreen(),
                          ),
                          SizedBox(
                            width: 8,
                          ),
                          Expanded(
                            child: Container(
                              padding: EdgeInsets.symmetric(horizontal: 2,vertical: 12),
                              alignment: Alignment.center,
                              height: 45.0,
                              // width: MediaQuery.of(context).size.width / 1.8,
                              decoration: BoxDecoration(
                                  gradient: buttongradient,
                                  borderRadius: BorderRadius.circular(12.0)),
                              child: Text(
                                 "PICK A SHOP LOCATION",
                                  overflow: TextOverflow.ellipsis,
                                  textAlign: TextAlign.center,
                                  style:
                                  boldRedTitle().copyWith(color: Colors.white),
                              ),
                            ),
                          ),
                        ],
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      Row(
                        children: [
                          Expanded(
                            child: Container(
                              height: 35,
                              padding:
                                  EdgeInsets.only(top: 0, left: 4, bottom: 0),
                              decoration: BoxDecoration(
                                  borderRadius: BorderRadius.circular(8),
                                  border: Border.all(color: greyc, width: 0.5)),
                              child: DropdownButtonHideUnderline(
                                child: DropdownButton<String>(
                                  focusColor: Colors.red,
                                  hint: Text(
                                    "SELECT SHOP CATEGORY".tr(),
                                    style: TextStyle(
                                        fontSize: 13,
                                        fontWeight: FontWeight.w500),
                                    overflow: TextOverflow.ellipsis,
                                  ),
                                  value: _selectedShopCategory,
                                  isExpanded: true,
                                  elevation: 2,
                                  icon: Icon(
                                    // Add this
                                    Icons.arrow_drop_down, // Add this
                                    color: mPrimaryColorLight, // Add this
                                  ),
                                  items: <String>['Bakery'.tr(), 'Bookshop'.tr()]
                                      .map((String value) {
                                    return DropdownMenuItem<String>(
                                      value: value,
                                      child: new Text(
                                        value,
                                        style: TextStyle(
                                            fontSize: 13,
                                            fontWeight: FontWeight.w500),
                                        overflow: TextOverflow.ellipsis,
                                      ),
                                    );
                                  }).toList(),
                                  onChanged: (String? val) {
                                    setState(() {
                                      _selectedShopCategory = val;
                                    });
                                  },
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      TextFormField(
                        controller: _aboutShopController,
                        decoration: InputDecoration(
                            hintText: "ABOUT YOUR SHOP IN SHORT",
                            contentPadding: EdgeInsets.symmetric(
                                horizontal: 10, vertical: 10),
                            enabledBorder: OutlineInputBorder(
                              borderRadius: BorderRadius.circular(8),
                              borderSide: BorderSide(color: greyc, width: 0),
                            ),
                            focusedBorder: OutlineInputBorder(
                                borderSide:
                                    BorderSide(color: mPrimaryColor, width: 1.0),
                                borderRadius: BorderRadius.circular(8.0))),
                        keyboardType: TextInputType.multiline,
                        maxLines: 4,
                      ),
                      SizedBox(
                        height: 25,
                      ),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          CustomButton2(
                            onPressed: (){

                              Navigator.of(context).push(MaterialPageRoute(builder: (context)=>ShopCertificationPage()));
                            },
                            text: "SAVE & NEXT",
                            textStyle:
                                boldRedTitle().copyWith(color: Colors.white),
                            gradient: buttongradient,
                          ),
                        ],
                      ),
                      SizedBox(
                        height: 30,
                      )
                    ],
                  ),
                ),
              )
            ],
          ),

      ),
    );
  }
}

enter image description here

SingleChildScrollView is not working

CodePudding user response:

Replace column with ListView or Wrap column with SingleChildScrollView, Either of them allows you to scroll.

CodePudding user response:

Remove SingleChildScrollView try with ListView and use shrinkWrap and physics

ListView(
            shrinkWrap: true,
            physics: ScrollPhysics(),
            children: [],
          )

Hope to work it

CodePudding user response:

Add your Column inside SingleChildScrollView() or Expanded() Widget

SingleChildScrollView(
    child:
      Column(
         children:[
             //Your Widgtes here
          ],
        ),
       ),

CodePudding user response:

Expanded(child:ListView(
            shrinkWrap: true,
            physics: ScrollPhysics(),
            children: [],
          ))

Its work for me , and thank you for everyone for doing my help

And This is a Answer

  • Related