Skip to content

Commit 67a9f61

Browse files
committed
Fix macOS-specific bug affecting emoji and paint editors
Resolved an issue in the Flutter application that impacted the functionality of the emoji and paint editors on macOS. Adjustments were made to the layer and loading widgets, along with corresponding tests, to ensure smooth operation and consistency across platforms.
1 parent 267563e commit 67a9f61

File tree

7 files changed

+37
-31
lines changed

7 files changed

+37
-31
lines changed

example/.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":true,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"file_picker","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\file_picker-6.1.1\\\\","native_build":true,"dependencies":[]},{"name":"image_editor_common","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\image_editor_common-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.3.1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.3.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"vibration","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\vibration-1.8.4\\\\","native_build":true,"dependencies":["device_info_plus"]}],"android":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":true,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"file_picker","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\file_picker-6.1.1\\\\","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_plugin_android_lifecycle-2.0.17\\\\","native_build":true,"dependencies":[]},{"name":"image_editor_common","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\image_editor_common-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.2\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_android-2.2.1\\\\","native_build":true,"dependencies":[]},{"name":"vibration","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\vibration-1.8.4\\\\","native_build":true,"dependencies":["device_info_plus"]}],"macos":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":true,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"image_editor_common","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\image_editor_common-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.3.1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.3.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":false,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_linux-2.3.2\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":false,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.2.1\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_windows-2.3.2\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","dependencies":[]},{"name":"file_picker","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\file_picker-6.1.1\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_web-2.2.2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"emoji_picker_flutter","dependencies":["shared_preferences"]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"image_editor","dependencies":["image_editor_common"]},{"name":"image_editor_common","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"vibration","dependencies":["device_info_plus"]}],"date_created":"2024-01-02 17:03:09.633454","version":"3.16.5"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":true,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"file_picker","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\file_picker-6.1.1\\\\","native_build":true,"dependencies":[]},{"name":"image_editor_common","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\image_editor_common-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.3.1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.3.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"vibration","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\vibration-1.8.4\\\\","native_build":true,"dependencies":["device_info_plus"]}],"android":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":true,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"file_picker","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\file_picker-6.1.1\\\\","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_plugin_android_lifecycle-2.0.17\\\\","native_build":true,"dependencies":[]},{"name":"image_editor_common","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\image_editor_common-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.2\\\\","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_android-2.2.1\\\\","native_build":true,"dependencies":[]},{"name":"vibration","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\vibration-1.8.4\\\\","native_build":true,"dependencies":["device_info_plus"]}],"macos":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":true,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"image_editor_common","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\image_editor_common-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.3.1\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_foundation-2.3.4\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":false,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_linux-2.3.2\\\\","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","native_build":false,"dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.2.1\\\\","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_windows-2.3.2\\\\","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.1\\\\","dependencies":[]},{"name":"emoji_picker_flutter","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\emoji_picker_flutter-1.6.3\\\\","dependencies":[]},{"name":"file_picker","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\file_picker-6.1.1\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"C:\\\\Users\\\\AlexF\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\shared_preferences_web-2.2.2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"emoji_picker_flutter","dependencies":["shared_preferences"]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"image_editor","dependencies":["image_editor_common"]},{"name":"image_editor_common","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"vibration","dependencies":["device_info_plus"]}],"date_created":"2024-01-02 21:33:11.350489","version":"3.16.5"}

lib/modules/emoji_editor.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'dart:math';
22

33
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
4-
import 'package:flutter/foundation.dart';
54
import 'package:flutter/material.dart';
65

76
import '../models/editor_configs/emoji_editor_configs.dart';
@@ -103,7 +102,7 @@ class EmojiEditorState extends State<EmojiEditor> {
103102
Config _buildEmojiPickerConfig(BoxConstraints constraints) {
104103
return Config(
105104
columns: _calculateColumns(constraints),
106-
emojiSizeMax: _calculateEmojiSize(),
105+
emojiSizeMax: 32,
107106
skinToneDialogBgColor: widget.imageEditorTheme.emojiEditor.skinToneDialogBgColor,
108107
skinToneIndicatorColor: widget.imageEditorTheme.emojiEditor.skinToneIndicatorColor,
109108
bgColor: widget.imageEditorTheme.emojiEditor.background,
@@ -134,7 +133,4 @@ class EmojiEditorState extends State<EmojiEditor> {
134133

135134
/// Calculates the number of columns for the EmojiPicker.
136135
int _calculateColumns(BoxConstraints constraints) => max(1, 10 / 400 * constraints.maxWidth - 1).floor();
137-
138-
/// Calculates the maximum emoji size.
139-
double _calculateEmojiSize() => 32 * (defaultTargetPlatform == TargetPlatform.iOS ? 1.30 : 1.0);
140136
}

lib/modules/paint_editor/paint_editor.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ class PaintingEditorState extends State<PaintingEditor> {
735735
fit: StackFit.expand,
736736
children: widget.layers!.map((layerItem) {
737737
return LayerWidget(
738+
designMode: widget.designMode,
738739
layerHoverCursor: widget.imageEditorTheme.layerHoverCursor,
739740
padding: widget.paddingHelper ?? EdgeInsets.zero,
740741
layerData: layerItem,

lib/pro_image_editor_main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,7 @@ class ProImageEditorState extends State<ProImageEditor> {
17111711
emojiTextStyle: widget.configs.emojiEditorConfigs.textStyle,
17121712
enabledHitDetection: _enabledHitDetection,
17131713
freeStyleHighPerformanceScaling: _freeStyleHighPerformanceScaling,
1714+
designMode: widget.configs.designMode,
17141715
onTap: (layer) async {
17151716
if (layer is TextLayerData) {
17161717
_onTextLayerTap(layer);

0 commit comments

Comments
 (0)