Нижняя часть перекрывается пикселями при появлении программной клавиатуры - PullRequest
0 голосов
/ 19 сентября 2018

У меня возникает проблема, когда на экране появляется программная клавиатура для ввода текста в поле формы.Я только начал разрабатывать для флаттера.

Но когда я получил решение с использованием расширенного.но когда я использую расширенный, выравнивания виджетов изменены, я не знаю, как использовать, пожалуйста, кто-нибудь поделится, это мой пример кода, у меня есть столбец с 4 контейнерами, но когда я использую контейнер, он перекрывается, когда появляется программная клавиша.так получилось с расширенным, но когда я использую, что размеры виджетов меняются

  return new Scaffold(
  appBar: new AppBar(
    title: Text("craete story"),
  ),
  body: new Container(

    child: new Column(
      children: <Widget>[


       new Container(
         decoration: BoxDecoration(color: Colors.white),
                     child: new Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: <Widget>[
              new Expanded(child: new Container(



                child:  Image (image:new  AssetImage('assets/article.png'),
                  height: 30.0,
                  width: 30.0,
                ),


              ),
                flex: 1,
              ),
              new Expanded(child: new Container(



                child:  Image (image:new  AssetImage('assets/image/newspaper.png'),
                  height: 30.0,
                  width: 30.0,
                ),


              ),

              ),
              new Expanded(child: new Container(



                child:  Image (image:new  AssetImage('assets/image/script (1).png'),
                  height: 30.0,
                  width: 30.0,
                ),


              ),

              ),
              new Expanded(child: new Container(
                child:  Image (image:new  AssetImage('assets/image/idea.png'),
                  height: 30.0,
                  width: 30.0,
                ),
              ),
              ),
              new Expanded(child: new Container(
                child:  Image (image:new  AssetImage('assets/image/manager.png'),
                  height: 30.0,
                  width: 30.0,
                ),
              ),
              ),
              new Expanded(child: new Container(
                child:  Image (image:new  AssetImage('assets/image/talent-search.png'),
                  height: 30.0,
                  width: 30.0,
                ),
              ),
              ),
              new Expanded(child: new Container(
                child:  Image (image:new  AssetImage('assets/image/feedback.png'),
                  height: 30.0,
                  width: 30.0,
                ),
              ),
              ),
              new Expanded(child: new Container(
                child:  Image (image:new  AssetImage('assets/image/handshake.png'),
                  height: 30.0,
                  width: 30.0,
                ),
              ),
              ),
            ],
          ),
          height: 60.0,
          ),
        new Container
         (
          height: 100.0,
          decoration: BoxDecoration(border: Border.all(color: Colors.grey)),
         margin: const EdgeInsets.all(2.0),
          child: new Padding(padding: EdgeInsets.all(5.0),
            child:  new TextField(
              decoration: new InputDecoration(
                  border: InputBorder.none,
                  hintText: "share your thoughts"
              ),

            ),
          )
         ),

        Expanded(child:
        new Container(
          height: 80.0,
          margin: const EdgeInsets.only(top: 10.0),

         child: new Column(
           children: <Widget>[
             new Row(
               children: <Widget>[
                 new Expanded(child:     new IconButton(icon: new Icon(Icons.videocam,color: Colors.blueGrey,
                   size: 50.0,
                 ),
                     onPressed: ()
                     {

                     }
                 ),
                   flex: 1,
                 ),
                 new Expanded(child:     new IconButton(icon: new Icon(Icons.image,color: Colors.blueGrey,
                   size: 50.0,
                 ),
                     onPressed: ()
                     {

                     }
                 ),
                   flex: 1,
                 ),
                 new Expanded(child:     new IconButton(icon: new Icon(Icons.album ,color: Colors.blueGrey,
                   size: 50.0,
                 ),
                     onPressed: ()
                     {

                     }
                 ),
                   flex: 1,
                 )
               ],
             ),
             Expanded(child:  new Container(
               margin: EdgeInsets.only(top: 50.0),
               height: 100.0,
               child: Column(

                 children: [
                   Expanded(
                     child: new Align(
                         alignment: Alignment.topLeft,
                         child:

                         new Text("hello",style: TextStyle(color: Colors.black,fontWeight: FontWeight.bold),)
                     ),

                   ),
                   Expanded(
                       child: new Container(
                         child: new Align(
                           alignment: Alignment.bottomRight,
                           child:  ListView(
                             scrollDirection: Axis.horizontal,
                             children: new List.generate(100, (int index) {
                               return new Card(
                                 color: Colors.blue[index * 100],
                                 child: new Container(
                                   width: 20.0,
                                   height: 10.0,
                                   child: new Text("$index"),
                                 ),
                               );
                             }),
                           ),
                         ),
                       )
                   ),
                 ],
               ),
             ),

             ),
             Expanded(child: new Container(

               child:  new Align(
                 alignment: Alignment.center,

                 child: new RawMaterialButton(onPressed: (){
                 },

                   child: new Text("Post"),

                 ),
               ),

             )),
           ],


         )

        ),

        ),




      ],
    )
    ),

);

}

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...