Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showcase highlight not correctly highlighting child widget on smartphone #275

Closed
keitheyre opened this issue Oct 6, 2022 · 13 comments
Closed

Comments

@keitheyre
Copy link

Describe the bug
image

To Reproduce
Steps to reproduce the behavior:

  1. Wrap FAB in Showcase widget
  2. Open on smartphone (Android A7 smartphone)
  3. See error (View attached image above)

Expected behavior
Highlight FloatingActionbutton

Screenshots
image

Smartphone (please complete the following information):

  • Device: Samsung A7
  • OS: Android 8.1
  • Browser N/A

Additional context
Seems to work perfectly with no overlayPadding required, but for smartphone, it is WAY off.

@cool2apps
Copy link

I have the same problem. This problem exits on non FAB widgets too. Any solution?

@keitheyre
Copy link
Author

I have the same problem. This problem exits on non FAB widgets too. Any solution?

I haven’t found a solution yet. Waiting for tan to see this issue. Hopefully sooner rather than later

@cool2apps
Copy link

Sometimes this workaround solves the problem, but not every time.

use this

      await Future.delayed(const Duration(milliseconds: 500));
      ShowCaseWidget.of(context).startShowCase(Shared.globalKeys);

instead of this

      WidgetsBinding.instance.addPostFrameCallback((_) => ShowCaseWidget.of(context).startShowCase(Shared.globalKeys));

@vatsaltanna
Copy link
Collaborator

Hello Guys, This issue has been solved and it will be available with next release.

@cool2apps
Copy link

When next release will be published?

@naitbrahim
Copy link

Hello Guys, This issue has been solved and it will be available with next release.

Can you please an estimate date for the next release ? thank you very much.

@vatsaltanna
Copy link
Collaborator

Please expect a new release withing 24 to 48 hours.

@vatsaltanna
Copy link
Collaborator

Please note that if you are wrapping showcase view to an animated widget then you need to add some delay before it starts. for example in the first case of the issue it's FAB which has it's own animation. so start a showcase with some delay until it gets to it's actual position.

@cool2apps
Copy link

cool2apps commented Nov 2, 2022

Please note that if you are wrapping showcase view to an animated widget then you need to add some delay before it starts. for example in the first case of the issue it's FAB which has it's own animation. so start a showcase with some delay until it gets to it's actual position.

How should we implement this delay? Is this code ok for a delay?

await Future.delayed(const Duration(milliseconds: 500));
ShowCaseWidget.of(context).startShowCase(globalKeys);

or should we use like this:

await Future.delayed(const Duration(milliseconds: 500));
WidgetsBinding.instance.addPostFrameCallback((_) => ShowCaseWidget.of(context).startShowCase(globalKeys));

@vatsaltanna
Copy link
Collaborator

Hi @cool2apps , if you are using FAB and it's the first one to get highlighted then I think below code should work.

    WidgetsBinding.instance.addPostFrameCallback((_) async {
      await Future.delayed(const Duration(milliseconds: 500));
      ShowCaseWidget.of(context).startShowCase(globalKeys);
    });

@vatsaltanna
Copy link
Collaborator

Hello Guys, New version of showcaseview: ^2.0.0+1 is available, It should fix the positioning issue for non animated widgets.

Closing this issue for now. Feel free to reopen this if the issue still persist on the latest version.

@cool2apps
Copy link

cool2apps commented Nov 3, 2022

Hi @cool2apps , if you are using FAB and it's the first one to get highlighted then I think below code should work.

    WidgetsBinding.instance.addPostFrameCallback((_) async {
      await Future.delayed(const Duration(milliseconds: 500));
      ShowCaseWidget.of(context).startShowCase(globalKeys);
    });

lint gave me Do not use BuildContexts across async gaps. warning but it looks like working. I don't know if this warning will cause a problem or not.

@naitbrahim
Copy link

Thank you @vatsaltanna it's working like a charm now ;)
it's a time saving, thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants