打开键盘时如何显示完整的showModalBottomSheet

时间:2019-10-03 12:01:27

标签: flutter dart flutter-layout

我使用了isScrollControlled: trueSingleChildScrollView小部件。.打开键盘时如何打开整张纸?

  onPressed: () {
                              showModalBottomSheet(
                                  context: context,
                                  builder: (BuildContext context) {
                                    return BottomSheet(
                                        camera: camera,
                                      subPost: widget.subPost
                                    );
                                  },isScrollControlled: true);
                            },

BottomSheet类

class _BottomSheetState extends State<BottomSheet> {

  @override
  Widget build(BuildContext context) {
    return
      SingleChildScrollView(
      child:
      Container(
        child: Padding(
          padding:
          EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
          child: Column(

我的输出

my output

我需要这样 I need like this

1 个答案:

答案 0 :(得分:0)

您的屏幕没有滚动,因为您的底页没有 可滚动。

尝试以下代码:

 showModalBottomSheet(
      context: context,
      isScrollControlled: true,
...