Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 文本字段中的文本由键盘覆盖_Flutter_Dart_Layout_Flutter Layout - Fatal编程技术网

Flutter 文本字段中的文本由键盘覆盖

Flutter 文本字段中的文本由键盘覆盖,flutter,dart,layout,flutter-layout,Flutter,Dart,Layout,Flutter Layout,单击“添加”按钮时,底部的工作表显示,单击“写入”时,我有一个文本字段。文本字段隐藏在键盘后面。 那我能做什么呢? 我尝试使用SingleChildScrollView,但没有用 检查图片和代码: 选中此项……。只需在showModalBottomSheet中将IsScrolledControl属性设置为true,并在上面的命令中将MainAxisSize设置为min import 'dart:ui'; import 'package:flutter/material.dart'; clas

单击“添加”按钮时,底部的工作表显示,单击“写入”时,我有一个文本字段。文本字段隐藏在键盘后面。 那我能做什么呢? 我尝试使用SingleChildScrollView,但没有用

检查图片和代码:

选中此项……。只需在showModalBottomSheet中将IsScrolledControl属性设置为true,并在上面的命令中将MainAxisSize设置为min
import 'dart:ui';

import 'package:flutter/material.dart';

class AddTaskScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Color(0xff757575),
      child: Container(
        padding: EdgeInsets.only(top: 20, left: 50, right: 50),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            Center(
              child: Text(
                'Add Task',
                style: TextStyle(
                    color: Colors.lightBlueAccent,
                    fontSize: 40,
                    fontWeight: FontWeight.w500),
              ),
            ),
            TextField(
              textAlign: TextAlign.center,
              cursorColor: Colors.lightBlueAccent,
              decoration: InputDecoration(fillColor: Colors.red),
              autofocus: true,
            ),
            SizedBox(
              height: 20,
            ),
            FlatButton(
              color: Colors.lightBlueAccent,
              onPressed: () {
                print('');
              },
              child: Text(
                'Add',
                style: TextStyle(fontSize: 20, color: Colors.white),
              ),
            )
          ],
        ),
        decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(20), topRight: Radius.circular(20))),
      ),
    );
  }
}