首页 > 解决方案 > 如何使用 SingleChildScrollView 和反向控制 DraggableScrollableSheet

问题描述

我需要使用DraggableScrollableSheetwithSingleChildScrollView和 setreverse来跳转TextField

但是在我设置reverse为true之后,DraggableScrollableSheet也是反转了,我该如何解决这个问题?

DraggableScrollableSheet(
        minChildSize: 0.73,
        maxChildSize: 0.83,
        initialChildSize: 0.73,
        builder: (context, scroll) => SingleChildScrollView(
              reverse: true,
              padding: EdgeInsets.only(
                  bottom: MediaQuery.of(context).viewInsets.bottom),
              controller: scroll,
              child: Column(
                children: <Widget>[
                  TextFormField(
                    decoration: InputDecoration(),
                  ),
                  TextFormField(
                    decoration: InputDecoration(),
                  ),
                  TextFormField(
                    decoration: InputDecoration(),
                  ),
                ],
              ),
            ))

标签: flutterflutter-layout

解决方案


推荐阅读