Мы создали приложение для заметок и внедрили 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
),
)),
),
),
),
Решение проблемы
В QuillEditor есть свойства «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)))
Комментариев нет:
Отправить комментарий