0

Necesito ayuda con esto al voltear el dispositivo en horizontal ocurre el siguiente error introducir la descripción de la imagen aquí

Esta es la estructura del codigo: [![introducir la descripción de la imagen aquí][2]][2]

 return new Scaffold(
    resizeToAvoidBottomPadding: false,
    appBar: new AppBar(
      backgroundColor: PrimaryColor,
      title: new Text('Registrar Vehiculo'),
    ),
    body: ListView.builder(
        itemCount: 1,
        itemBuilder: (context, index) {
          return Container(
            height: MediaQuery
                .of(context)
                .size
                .height,
            width: MediaQuery.of(context).size.width,
            margin: EdgeInsets.only(left: 20, right: 50, top: 10),
            child: Column(
              children: <Widget>[
                Container(
                  child: Row(
                    children: <Widget>[
                      Expanded(
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: <Widget>[
                            Container(
                              margin: EdgeInsets.only(bottom: 10),
                              width: MediaQuery
                                  .of(context)
                                  .size
                                  .width,
                              child: Text(
                                'Selecione marca',
                                textAlign: TextAlign.justify,
                                //overflow: TextOverflow.ellipsis, ...
                                style: TextStyle(
                                    fontWeight: FontWeight.bold,
                                    fontSize: 20.0),
                              ),
                            ),
                            AbsorbPointer(
                              absorbing: _isButtonDisabledmarca,
                              child: SizedBox(
                                width: MediaQuery
                                    .of(context)
                                    .size
                                    .width * .5,
                                child: FlatButton(
                                    child: Text(_valueMarca),
                                    //Valor a cambiar
                                    splashColor: Colors.black,
                                    padding: const EdgeInsets.all(20.0),
                                    textColor: Colors.white,
                                    color: PrimaryColor,
                                    onPressed: () {
                                      MarksDeVheiculo();
                                    }
                                ),

                              ),
                            ),
                            //==============ICONOOOO
                          ],
                        ),

                      ),
                      Image.asset(
                        'assets/images/icono_shell.png', width: 100,
                        height: 100,
                      ), //=====No va , icono de otra cosa
                    ],
                  ),
                ),
                //--------------------------------First Mark
                Container(
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: <Widget>[
                            Container(
                              margin: EdgeInsets.only(bottom: 10, top: 10),
                              width: MediaQuery.of(context).size.width,
                              child: Text(
                                'Seleccione Modelo',
                                textAlign: TextAlign.justify,
                                //overflow: TextOverflow.ellipsis, ...
                                style: TextStyle(
                                    fontWeight: FontWeight.bold,
                                    fontSize: 20.0),
                              ),
                            ),
                            AbsorbPointer(
                              absorbing: _isButtonDisabledmodel,

                              child: SizedBox(
                                width: MediaQuery.of(context).size.width * .5,
                                child: FlatButton(
                                    child: Text(_valueModel),
                                    splashColor: Colors.black,
                                    padding: const EdgeInsets.all(25.0),
                                    textColor: Colors.white,
                                    color: _activatebutton1
                                        ? Colors.grey
                                        : PrimaryColor,
                                    onPressed: () {
                                      cargarmodelos();
                                      ModelDeVheiculo();
                                      Modelosdecarro.clear();
                                    }
                                ),
                              ),
                            ),
                          ],
                        ),

                ),
                //--------------------------------Second Model
                Container(
                  child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: <Widget>[
                            Container(
                              margin: EdgeInsets.only(bottom: 20, top: 10),
                              width: MediaQuery
                                  .of(context)
                                  .size
                                  .width,
                              child: Text(
                                'Selecione Año',
                                textAlign: TextAlign.justify,
                                //overflow: TextOverflow.ellipsis, ...
                                style: TextStyle(
                                    fontWeight: FontWeight.bold,
                                    fontSize: 20.0),
                              ),
                            ),
                            AbsorbPointer(
                              absorbing: _isButtonDisabledyear,
                              child: SizedBox(
                                width: MediaQuery
                                    .of(context)
                                    .size
                                    .width * .5,
                                child: FlatButton(
                                    child: Text(_valueYear),
                                    splashColor: Colors.black,
                                    padding: const EdgeInsets.all(25.0),
                                    textColor: Colors.white,
                                    color: _activatebutton2
                                        ? Colors.grey
                                        : PrimaryColor,
                                    onPressed: () {
                                      cargaryears();
                                      YearsVehiculo();
                                      Yearsdecarros.clear();
                                    }
                                ),
                              ),
                            ),
                          ],
                        ),
                      ),

                Container(
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: <Widget>[
                            Container(
                              margin: EdgeInsets.only(bottom: 20, top: 10),
                              width: MediaQuery
                                  .of(context)
                                  .size
                                  .width,
                              child: Text(
                                'Litros De combustible',
                                textAlign: TextAlign.justify,
                                //overflow: TextOverflow.ellipsis, ...
                                style: TextStyle(
                                    fontWeight: FontWeight.bold,
                                    fontSize: 20.0),
                              ),
                            ),
                            AbsorbPointer(
                              absorbing: _isButtonDisabledcombustible,
                              child: SizedBox(
                                width: MediaQuery
                                    .of(context)
                                    .size
                                    .width * .5,
                                child: FlatButton(
                                    child: Text(_valueCombustible),
                                    splashColor: Colors.black,
                                    padding: const EdgeInsets.all(25.0),
                                    textColor: Colors.white,
                                    color: _activatebutton3
                                        ? Colors.grey
                                        : PrimaryColor,
                                    onPressed: () {
                                      CargarCombustible();
                                      ConbustibleVheiculo();
                                      Combustibledecarros.clear();
                                    }
                                ),
                              ),
                            ),
                          ],
                        ),

                      // Image.asset('assets/images/icono_gas.png',width: 80,height: 110,),
                ),
                Container(
                    margin: EdgeInsets.only(
                        left: 30.0, top: 50.0, right: 0.0),
                    child:AbsorbPointer(
                      absorbing:_isButtonDisabledSave,
                      child:  SizedBox(
                        width: MediaQuery.of(context).size.width,
                        child: RaisedButton(
                          padding: const EdgeInsets.all(30.0),
                          color:_activatesave ? Colors.grey : PrimaryColor,
                          elevation: 5.0,
                          textColor: Colors.white,
                          splashColor: Colors.black,

                          onPressed: () async {  },
                          child: Center(
                              child: Center(
                                  child: Text('Guardar Vehiculo',)

                              )
                          ),
                        ),
                      ),
                    )
                ),
              ],
            ),
          );
        }
    ),
  );
}

}

Como puedo solucionarlo

6
  • Podrías agregar el código en lugar de la segunda imagen, para poder hacer las correcciones el 29 mar. 2019 a las 15:38
  • Listo ya lo agregue el 29 mar. 2019 a las 15:49
  • hmm lo acabo de probar y funciona bien, no me sale ningún error de overflow, que versión de flutter tienes? en que emulador estas probando? yo lo probé en el simulador de iOS el 29 mar. 2019 a las 15:50
  • Tengo un emulador de android de AStudio, el nexxus 5 tengo la version 1.2 el 29 mar. 2019 a las 15:56
  • declaraste algo mas? en el manifest o en alguna clase dart para forzar la orientación ? el 29 mar. 2019 a las 15:58

1 respuesta 1

5

Puedes agregar SingleChildScrollView como wrapper del Column , quedaría así :

        itemBuilder: (context, index) {
          return Container(
          height: MediaQuery.of(context).size.height,
          width: MediaQuery.of(context).size.width,
          margin: EdgeInsets.only(left: 20, right: 50, top: 10),
          child: SingleChildScrollView(
                child: Column(
                    children: <Widget>[
                       Container(
                         child: Row(
                         ....
2
  • 1
    Gracias por tu respuesta, si sirvió, eres un crack!! el 29 mar. 2019 a las 16:30
  • no hay de que, no te olvides de marcar la respuesta como aceptada el 29 mar. 2019 a las 16:31

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.