[ADD] ability to add placeholder textstyle#2698
Open
hardiklakhalani wants to merge 1 commit intosingerdmx:masterfrom
Open
[ADD] ability to add placeholder textstyle#2698hardiklakhalani wants to merge 1 commit intosingerdmx:masterfrom
hardiklakhalani wants to merge 1 commit intosingerdmx:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for customizing the placeholder text style (including font size) in the Flutter Quill editor. Previously, the placeholder text style was hardcoded with a fontSize of 20 and could not be customized by users.
Current Behavior:
fontSize: 20defined inDefaultStyles.getInstance()DefaultStylesviacustomStyles, which is cumbersomeNew Behavior:
placeholderStyleparameter toQuillEditorConfigandQuillRawEditorConfigTextStyleto customize placeholder appearance (fontSize, color, fontStyle, etc.)placeholderStyleis merged with the default placeholder style, allowing partial customizationMotivation:
Many users need to customize placeholder text appearance to match their app's design system. Currently, this requires creating a complete
DefaultStylesoverride just to change the placeholder font size, which is overly complex for such a common use case.Related Issues
Type of Change
Changes Made
Files Modified
lib/src/editor/config/editor_config.dartplaceholderStyleparameter (optionalTextStyle?) toQuillEditorConfigcopyWith()method to includeplaceholderStylelib/src/editor/raw_editor/config/raw_editor_config.dartplaceholderStyleparameter (optionalTextStyle?) toQuillRawEditorConfiglib/src/editor/editor.dartplaceholderStylefromQuillEditorConfigtoQuillRawEditorConfiglib/src/editor/raw_editor/raw_editor_state.dartdidChangeDependencies()to merge customplaceholderStylewith default placeholder styleDefaultStyles.merge()to update only the placeholder styleUsage Example
Testing
placeholderStyle)fontSizeonlyBackward Compatibility
✅ Fully backward compatible
placeholderStyleis optional (nullable)