Flutter - Keyboard Raises On Screen FloatingActionButton

I used TextField, but the keyboard picks up FloatingActionButton. I wonder if the keyboard can not lift FloatingActionButton?

In the code below, I put two in FloatingActionButtontwo different ways, but it goes up in both keyboards, which prevents the fields from filling out, since the FABs are on the same line as TextFieldin accordance with the gif below.

Is there any way to solve this?

enter image description here

import 'package:flutter/material.dart';
import 'dart:ui' as ui;

void main() {
  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(      
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    final ui.Size logicalSize = MediaQuery.of(context).size;
    final double _width = logicalSize.width;
    return new Scaffold(
      appBar: new AppBar(backgroundColor: new Color(0xFF26C6DA)),        
      body: new Stack(
        children: <Widget>[
          new ListView(
            children: <Widget>[
              new TextField(
                decoration: const InputDecoration(
                  labelText: "Description",
                ),
                style: Theme.of(context).textTheme.title,
              ),
              new TextField(
                decoration: const InputDecoration(
                  labelText: "Description",
                ),
                style: Theme.of(context).textTheme.title,
              ),
              new TextField(
                decoration: const InputDecoration(
                  labelText: "Description",
                ),
                style: Theme.of(context).textTheme.title,
              ),
            ],
          ),
          new Positioned(
            bottom: 16.0,
            left: (_width / 2) - 28,   
            child: new FloatingActionButton(
              backgroundColor: new Color(0xFFE57373),
              child: new Icon(Icons.check),
              onPressed: (){}
            ),            
          )
        ],        
      ),
      floatingActionButton: new FloatingActionButton(
        backgroundColor: new Color(0xFFE57373),
        child: new Icon(Icons.check),
      ),
    );
  }
}
+4
source share
1 answer

It looks like you are developing a full-screen dialog.

, , . , , .

FloatingActionButton AppBar FlatButton actions, :

save

Flutter .

+3

Source: https://habr.com/ru/post/1684780/


All Articles