Placeholder String doesn't take control characters in string.
Is there an existing issue for this?
- [X] I have searched the existing issues
Flutter Quill version
9.3.4
Steps to reproduce
placeholder: '''Here are a few ideas:
• Daily Goals • Client Insights...
Make the most of it!''',
or: placeholder: 'Here are a few ideas:\n\n• Daily Goals\n• Client Insights...\n\nMake the most of it!',
Expected results
Actual results
Code sample
Code sample
Column(
children: [
Expanded(
child: QuillEditor.basic(
configurations: QuillEditorConfigurations(
controller: _controller,
readOnly: false,
placeholder: '''Here are a few ideas:
• Daily Goals
• Client Insights...
Make the most of it!''',
customStyles: DefaultStyles(
placeHolder: DefaultListBlockStyle(
TextStyle(
fontSize: 16,
color:
Colors.grey.withOpacity(.7)),
const VerticalSpacing(1, 1),
const VerticalSpacing(1, 1),
null,
null)),
sharedConfigurations:
const QuillSharedConfigurations(
locale: Locale('en')),
),
),
),
QuillToolbar.simple(
configurations: QuillSimpleToolbarConfigurations(
controller: _controller,
sharedConfigurations:
const QuillSharedConfigurations(
locale: Locale('en'),
),
),
),
],
)
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Your problem is due to \n. When placed intrinsically in the string, the string will add or print new lines (whatever we want, but causing problems) as it should. But you need to pass a string like:
r"Here are some ideas:\n\n• Daily goals\n• Client insights...\n\nMake the most of it!'"
Either
"Here are some ideas:\\n\\n• Daily goals\\n• Client insights...\\n\\nMake the most of it!'"
With these ropes you can solve this problem. This happens because the delta needs to have only \n as characters, in the string instead of intrinsic newlines.