我们创建了一个笔记应用程序,并实现了Flutter Quill作为我们的文本编辑器。
我们面临的问题是,当用户键入时,屏幕不跟随新行。用户必须手动向下滚动才能看到他们的文本。
任何帮助将是伟大的!
Flutter Quill - https://pub.dev/packages/flutter_quill
SliverToBoxAdapter(
child: Padding(
padding: EdgeInsets.fromLTRB(
0,
0.0,
0,
0,
),
child: Container(
constraints:
BoxConstraints(minHeight: 400.0),
height: 10000,
child: CustomShowcaseWidget(
globalKey: keyFour,
description:
"Type in text here!",
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16),
child: Quill.QuillEditor.basic(
controller:
this.contentController!,
readOnly:
false, // true for view only mode
),
)),
),
),
),
有" padding ";和";scrollBottomInset"属性。
QuillEditor(
controller: _controller!,
scrollController: ScrollController(),
scrollable: true,
focusNode: _focusNode,
autoFocus: false,
readOnly: false,
placeholder: 'Add content',
expands: false,
padding: EdgeInsets.only(
bottom: 10),
scrollBottomInset: 150,
customStyles: DefaultStyles(
link: TextStyle().copyWith(color: Colors.blue),
paragraph: DefaultTextBlockStyle(
const TextStyle().copyWith(
fontSize: 17,
color: Color(0xFF292929),
height: 1.3,
),
const Tuple2(0, 0),
const Tuple2(0, 0),
null)))