Тэги:
#flutter #fluttertutorial #firebase #dart #flutter-quill #flutter-rich-text-editorКомментарии:
if anyone struggling in implementing QuillEditor in version flutter_quill: ^10.8.5
use this code for QuillEditor
Expanded(
child: QuillEditor.basic(
controller: quillController,
configurations: const QuillEditorConfigurations(
placeholder: 'Write note here...',
expands: true,
),
focusNode: focusNode,
),
),
and for readOnly in initState
@override
void initState() {
super.initState();
quillController = QuillController.basic(); // Initialize controller
focusNode = FocusNode();
if (widget.isNewNote) {
focusNode.requestFocus();
readOnly = false;
quillController.readOnly = readOnly;
} else {
readOnly = true;
quillController.readOnly = readOnly;
}
}
and for readOnly in NoteIconButtonOutlined
NoteIconButtonOutlined(
icon: readOnly ? FontAwesomeIcons.pen : FontAwesomeIcons.bookOpen,
onPressed: () {
setState(() {
readOnly = !readOnly;
quillController.readOnly = readOnly;
if (readOnly) {
FocusScope.of(context).unfocus();
} else {
focusNode.requestFocus();
}
});
},
),
hope this will help 😁
i use flutter quil new version 10.8.5 how to solf eror my project if i follow ur video or ur project
Ответитьsir could you please show us how to add an image function to that note app
ОтветитьI spotted a small bug : when clicking on TextField Widget on readOnly mode it gets focused even if readOnly is set to true, the solution is to add this code in the textfield : canRequestFocus: readOnly ? false : true,
ОтветитьGood job 👍 Keep up ! For those having issue with the Quill package like I did just upgrade your flutter binary to the last version (3.16) everything resolves.
ОтветитьCan u make functional PDF app
ОтветитьGood tutorial
Ответить