Flutter-滚动时如何取消SelectionControls



我在SingleChildScrollView中使用SelectableText。

SingleChildScrollView(
child: Container(
padding: const EdgeInsets.all(20.0),
child: SelectableText(loremipsum),
),
);

在selectionControls中,当我选择名为ToolBarItemControl.copy的属性时,混乱随之而来。如果你看一下这里的视频,你可以看到确切的问题。滚动时如何取消SelectionControls?

为此,只需将keyboardDismissBehavior添加到SingleChildScrollView中。像这样:

SingleChildScrollView(
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
child: Container(
padding: const EdgeInsets.all(20.0),
child: SelectableText(loremipsum),
),
);

最新更新