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

Hyperlink - add pointer cursor by default, important for Flutter web. #316

Closed
slavap opened this issue Sep 18, 2020 · 11 comments
Closed

Hyperlink - add pointer cursor by default, important for Flutter web. #316

slavap opened this issue Sep 18, 2020 · 11 comments
Assignees
Labels
question Further information is requested
Milestone

Comments

@slavap
Copy link

slavap commented Sep 18, 2020

Something like that when standard widget for hyperlink is building:

MouseRegion(
  cursor: SystemMouseCursors.click,
  child: ...
@daohoangson
Copy link
Owner

This can be done for link that is an image or some widget but won't work for inline link because TextSpan doesn't allow us to specify a cursor.

@slavap
Copy link
Author

slavap commented Sep 24, 2020

@daohoangson MouseRegion can take TextSpan as child I believe.

@daohoangson
Copy link
Owner

I have just double checked, MouseRegion only takes Widget as child so it's definitely won't work.

You are probably confused between:

  • TextSpan (which is an InlineSpan)
  • and Text / RichText (which are widgets)?

@slavap
Copy link
Author

slavap commented Sep 24, 2020

@daohoangson
Yep, I see. There is issue for adding hover gesture recognizer flutter/flutter#33312
When it is fixed, I think it will be possible to fix this one as well.

@daohoangson
Copy link
Owner

Yes, in the mean time I have added mouse region for widgets. You can try it here:

https://example-c0xyfny5z.vercel.app/#/images

This inline image as link should have the cursor on hover:

Screen Shot 2020-09-25 at 09 14 22

@daohoangson daohoangson added this to the 0.6 milestone Nov 27, 2020
@daohoangson daohoangson removed this from the 0.6 milestone May 21, 2021
@daohoangson
Copy link
Owner

A pre-release version has been published with support for mouse cursor, it requires Flutter 2.2 (that's why it's pre-release). Update your pubspec into something like this:

dependencies:
  flutter_widget_from_html: ^0.7.0-0

Let me know if it works for you.

@daohoangson daohoangson added question Further information is requested and removed enhancement New feature or request labels May 21, 2021
@slavap
Copy link
Author

slavap commented May 24, 2021

@daohoangson
Tested on flutter_widget_from_html_core: ^0.7.0-dev.2021052101
Works just fine, thank you!

@slavap
Copy link
Author

slavap commented May 25, 2021

@daohoangson Correction to my previous comment. Works fine in Flutter Web, but on Android - still no pointer cursor :-(

@daohoangson
Copy link
Owner

You connect a wireless mouse to your phone?

@slavap
Copy link
Author

slavap commented May 25, 2021

@daohoangson Sounds like you are right, I need to test on real Android with connected mouse, not on emulator.

@daohoangson
Copy link
Owner

Yes, I think you need a real device to test this.

@daohoangson daohoangson added this to the 0.7.0 milestone Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants