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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 11.21.1
- **FEAT**(text-editor): Add `resizeToAvoidBottomInset` config to control whether the editor resizes when the keyboard appears.
- **FIX**(paint-editor): Resolve issue where erasing would randomly remove other layers.

## 11.21.0
- **FIX**(keyboard-shortcuts): Block Ctrl-based shortcuts when Alt is pressed to prevent conflicts with keyboard layouts (e.g., Polish) where Ctrl+Alt+Z is used for typing characters. More details in PR [#757](https://github.com/hm21/pro_image_editor/pull/757).

Expand Down
13 changes: 12 additions & 1 deletion lib/core/models/editor_configs/text_editor_configs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class TextEditorConfigs
this.style = const TextEditorStyle(),
this.icons = const TextEditorIcons(),
this.widgets = const TextEditorWidgets(),
this.enableImageBoundaryTextWrap = false})
this.enableImageBoundaryTextWrap = false,
this.resizeToAvoidBottomInset = true})
: assert(initFontSize > 0, 'initFontSize must be positive'),
assert(maxScale >= minScale,
'maxScale must be greater than or equal to minScale');
Expand Down Expand Up @@ -216,6 +217,13 @@ class TextEditorConfigs
/// Enable automatic text wrapping when text reach the image boundaries
final bool enableImageBoundaryTextWrap;

/// Whether the Scaffold should resize to avoid the bottom inset (keyboard).
///
/// When `true` (default), the editor will resize when the keyboard appears.
/// When `false`, the editor will not resize and the keyboard may overlap
/// the content.
final bool resizeToAvoidBottomInset;

/// Creates a copy of this `TextEditorConfigs` object with the given fields
/// replaced with new values.
///
Expand Down Expand Up @@ -252,6 +260,7 @@ class TextEditorConfigs
TextEditorIcons? icons,
TextEditorWidgets? widgets,
bool? enableImageBoundaryTextWrap,
bool? resizeToAvoidBottomInset,
}) {
return TextEditorConfigs(
layerFractionalOffset:
Expand Down Expand Up @@ -291,6 +300,8 @@ class TextEditorConfigs
widgets: widgets ?? this.widgets,
enableImageBoundaryTextWrap:
enableImageBoundaryTextWrap ?? this.enableImageBoundaryTextWrap,
resizeToAvoidBottomInset:
resizeToAvoidBottomInset ?? this.resizeToAvoidBottomInset,
);
}
}
5 changes: 2 additions & 3 deletions lib/features/paint_editor/paint_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1132,9 +1132,8 @@ class PaintEditorState extends State<PaintEditor>
onRemovePartialStart: () {
LayerCopyManager copyManager = LayerCopyManager();

final updatedList =
activeHistory.layers.whereType<PaintLayer>().map((layer) {
return copyManager.createCopyPaintLayer(layer);
final updatedList = activeHistory.layers.map((layer) {
return copyManager.copyLayer(layer);
});

while (canRedo) {
Expand Down
2 changes: 2 additions & 0 deletions lib/features/text_editor/text_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ class TextEditorState extends State<TextEditor>
left: textEditorConfigs.safeArea.left,
right: textEditorConfigs.safeArea.right,
child: Scaffold(
resizeToAvoidBottomInset:
textEditorConfigs.resizeToAvoidBottomInset,
backgroundColor: textEditorConfigs.style.background,
appBar: _buildAppBar(constraints),
body: _buildBody(),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pro_image_editor
description: "A Flutter image editor: Seamlessly enhance your images with user-friendly editing features."
version: 11.21.0
version: 11.21.1
homepage: https://github.com/hm21/pro_image_editor/
repository: https://github.com/hm21/pro_image_editor/
documentation: https://github.com/hm21/pro_image_editor/
Expand Down