From 4b09d1edfe7788882d28361bf2bdc3bf6131c751 Mon Sep 17 00:00:00 2001 From: hm21 Date: Wed, 4 Feb 2026 09:36:29 +0100 Subject: [PATCH 1/2] fix(paint-editor): update layer copying logic --- lib/features/paint_editor/paint_editor.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/features/paint_editor/paint_editor.dart b/lib/features/paint_editor/paint_editor.dart index 57c860ac..4e888be3 100644 --- a/lib/features/paint_editor/paint_editor.dart +++ b/lib/features/paint_editor/paint_editor.dart @@ -1132,9 +1132,8 @@ class PaintEditorState extends State onRemovePartialStart: () { LayerCopyManager copyManager = LayerCopyManager(); - final updatedList = - activeHistory.layers.whereType().map((layer) { - return copyManager.createCopyPaintLayer(layer); + final updatedList = activeHistory.layers.map((layer) { + return copyManager.copyLayer(layer); }); while (canRedo) { From 888d1b6415d847a72eba373560b451132f4b7bbe Mon Sep 17 00:00:00 2001 From: hm21 Date: Wed, 4 Feb 2026 09:36:32 +0100 Subject: [PATCH 2/2] feat(text-editor): add resizeToAvoidBottomInset config and update version to 11.21.1 --- CHANGELOG.md | 4 ++++ .../models/editor_configs/text_editor_configs.dart | 13 ++++++++++++- lib/features/text_editor/text_editor.dart | 2 ++ pubspec.yaml | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf4b86e..beb35b5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). diff --git a/lib/core/models/editor_configs/text_editor_configs.dart b/lib/core/models/editor_configs/text_editor_configs.dart index 71d67b00..c8138e8d 100644 --- a/lib/core/models/editor_configs/text_editor_configs.dart +++ b/lib/core/models/editor_configs/text_editor_configs.dart @@ -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'); @@ -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. /// @@ -252,6 +260,7 @@ class TextEditorConfigs TextEditorIcons? icons, TextEditorWidgets? widgets, bool? enableImageBoundaryTextWrap, + bool? resizeToAvoidBottomInset, }) { return TextEditorConfigs( layerFractionalOffset: @@ -291,6 +300,8 @@ class TextEditorConfigs widgets: widgets ?? this.widgets, enableImageBoundaryTextWrap: enableImageBoundaryTextWrap ?? this.enableImageBoundaryTextWrap, + resizeToAvoidBottomInset: + resizeToAvoidBottomInset ?? this.resizeToAvoidBottomInset, ); } } diff --git a/lib/features/text_editor/text_editor.dart b/lib/features/text_editor/text_editor.dart index 3e99a7bf..9d0ee6eb 100644 --- a/lib/features/text_editor/text_editor.dart +++ b/lib/features/text_editor/text_editor.dart @@ -352,6 +352,8 @@ class TextEditorState extends State left: textEditorConfigs.safeArea.left, right: textEditorConfigs.safeArea.right, child: Scaffold( + resizeToAvoidBottomInset: + textEditorConfigs.resizeToAvoidBottomInset, backgroundColor: textEditorConfigs.style.background, appBar: _buildAppBar(constraints), body: _buildBody(), diff --git a/pubspec.yaml b/pubspec.yaml index d1d517f8..f605bbfc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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/