hm21 / pro_image_editor

The pro_image_editor is a Flutter widget designed for image editing within your application. It provides a flexible and convenient way to integrate image editing capabilities into your Flutter project.
https://hm21.github.io/pro_image_editor/
BSD 3-Clause "New" or "Revised" License
94 stars 59 forks source link

[Bug]: Keyboard Issues in google_font_example #182

Closed iOSyan closed 1 month ago

iOSyan commented 1 month ago

Package Version

4.3.3

Flutter Version

3.22.1

Platforms

Android, iOS

How to reproduce?

In the google_font_example, when you click on the already entered text again, the keyboard does not pop up.

Logs (optional)

No response

Example code (optional)

No response

Device Model (optional)

No response

hm21 commented 1 month ago

I just tested it on native devices (Samsung Galaxy S10 and iPhone 10) but in my case everything works fine. Can you give more details on how to reproduce it? On which device you have this issue? Is it on native devices or only in the simulator?

iOSyan commented 1 month ago

I reproduced this issue on the Redmi 7 phone, and I did not encounter this problem when using the previous version 4.1.0

hm21 commented 1 month ago

But when you click on the text, does it still show the cursor inside the text or does it also not show the cursor?

iOSyan commented 1 month ago

I found that the keyboard doesn't pop up easily when I click on it for the first time, but it can pop up on the second time. This issue only appears on the Redmi 7 phone, and no other testing machines have encountered it.

https://github.com/user-attachments/assets/7014eb27-d583-47a8-9de0-6b34c5c93e8a

hm21 commented 1 month ago

That's interesting. I don't have a native Redmi 7 phone to reproduce the issue. However, I suspect there is a problem with the hero animation, which may not be setting the state to complete. In the code, I typically wait for the hero animation to finish before calling focusNode.requestFocus() to make the keyboard visible.

However, I have just released version 4.3.6, which allows you to access the focusNode from the text editor. You can then try to manually force the keyboard to appear in the callbacks, as shown below.

return ProImageEditor.asset(
      ExampleConstants.of(context)!.demoAssetPath,
      key: editorKey,
      callbacks: ProImageEditorCallbacks(
        textEditorCallbacks: TextEditorCallbacks(
          /// onInit: () {
          ///   editorKey.currentState!.textEditor.currentState!.focusNode
          ///       .requestFocus();
          /// },
          onAfterViewInit: () {
            editorKey.currentState!.textEditor.currentState!.focusNode
                .requestFocus();
          },
        ),
github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 3 days with no activity.

iOSyan commented 1 month ago

Sorry, I've been busy these days and haven't had time to test it yet.

There is a new issue now, in the latest version 5.0.3, when running the example, an error occurs:

../lib/widgets/extended/extended_pop_scope.dart:42:9: Error: Type 'PopInvokedWithResultCallback' not found.

hm21 commented 1 month ago

This is not just an issue; it involves breaking changes, as detailed in the changelog here.

Breaking Changes
The package now supports Flutter 3.24, which modifies the onPopInvoked method.
A new loading dialog has been introduced as a singleton class.

This means that if you use version >= 5.0.0, it is mandatory to also use the latest version of Flutter.