Flutter 如何使用SingleChildScrollView和reverse控制DragableScrollableSheet
我需要将Flutter 如何使用SingleChildScrollView和reverse控制DragableScrollableSheet,flutter,flutter-layout,Flutter,Flutter Layout,我需要将DraggableScrollableSheet与SingleChildScrollView一起使用,并设置reverse以跳转TextField 但是在我将reverse设置为true之后,DraggableScrollableSheet也会被反转,我如何解决这个问题呢 DraggableScrollableSheet( minChildSize: 0.73, maxChildSize: 0.83, initialChildSize: 0
DraggableScrollableSheet
与SingleChildScrollView
一起使用,并设置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(),
),
],
),
))
DraggableScrollableSheet(
minChildSize:0.73,
maxChildSize:0.83,
初始儿童尺寸:0.73,
生成器:(上下文,滚动)=>SingleChildScrollView(
相反:是的,
填充:仅限边缘设置(
底部:MediaQuery.of(context.viewInsets.bottom),
控制器:滚动,
子:列(
儿童:[
TextFormField(
装饰:输入装饰(),
),
TextFormField(
装饰:输入装饰(),
),
TextFormField(
装饰:输入装饰(),
),
],
),
))
这是不可能的,因为ScrollController
在DragableScrollableSheet
和SingleChildScrollView
@Mobina之间共享,我用NotificationListener解决了这个问题,如果ScrollStartNotification反转为false,这是不可能的,因为ScrollController
在DragableScrollTableSheet
和SingleChildScrollView
@Mobina之间共享,如果ScrollStartNotification反转为false,我将使用NotificationListener修复此问题