Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/core/models/styles/text_editor_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class TextEditorStyle {
Radius.circular(4),
),
this.inputTextFieldPadding = EdgeInsets.zero,
this.inputLetterSpacing = 0,
this.inputShadows = const [],
});

/// Background color of the app bar in the text editor.
Expand Down Expand Up @@ -129,6 +131,18 @@ class TextEditorStyle {
/// on various platforms. Set to null to use the default line height.
final double? textHeight;

/// Letter spacing applied to the text input field style.
///
/// Defaults to `0` to fix alignment issues with some fonts.
/// Set to `null` to use the font's default letter spacing.
final double? inputLetterSpacing;

/// Shadows applied to the text input field style.
///
/// Defaults to an empty list to prevent unwanted shadow rendering
/// with some fonts. Set to `null` to use the font's default shadows.
final List<Shadow>? inputShadows;

/// Controls how extra leading from the [TextStyle.height] multiplier is
/// distributed above and below the text glyph.
///
Expand Down Expand Up @@ -166,6 +180,8 @@ class TextEditorStyle {
EdgeInsets? textFieldMargin,
EdgeInsets? textFieldPadding,
TextStyle? fontSizeBottomSheetTitle,
double? inputLetterSpacing,
List<Shadow>? inputShadows,
}) {
return TextEditorStyle(
textHeight: textHeight ?? this.textHeight,
Expand All @@ -192,6 +208,8 @@ class TextEditorStyle {
textFieldPadding: textFieldPadding ?? this.textFieldPadding,
fontSizeBottomSheetTitle:
fontSizeBottomSheetTitle ?? this.fontSizeBottomSheetTitle,
inputLetterSpacing: inputLetterSpacing ?? this.inputLetterSpacing,
inputShadows: inputShadows ?? this.inputShadows,
);
}
}
7 changes: 4 additions & 3 deletions lib/features/text_editor/widgets/text_editor_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,16 @@ class _TextEditorInputState extends State<TextEditorInput> {
hintStyle: widget.selectedTextStyle.copyWith(
color: widget.configs.style.inputHintColor,
fontSize: widget.textFontSize,
shadows: [],
letterSpacing: widget.configs.style.inputLetterSpacing,
shadows: widget.configs.style.inputShadows,
),
backgroundColor: widget.backgroundColor,
style: widget.selectedTextStyle.copyWith(
color: widget.textColor,
fontSize: widget.textFontSize,
letterSpacing: 0,
letterSpacing: widget.configs.style.inputLetterSpacing,
shadows: widget.configs.style.inputShadows,
decoration: TextDecoration.none,
shadows: [],
),

/// If we edit an layer we focus to the textfield after the
Expand Down
Loading