如何使用SingleChildScrollView和反向控制DraggableScrollableSheet

时间:2020-08-06 11:14:34

标签: flutter flutter-layout

我需要将DraggableScrollableSheetSingleChildScrollView一起使用,并将reverse设置为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(),
                  ),
                ],
              ),
            ))

0 个答案:

没有答案