Cretezy / flutter_linkify

Turns text URLs and emails into clickable inline links in text for Flutter
https://pub.dartlang.org/packages/flutter_linkify
MIT License
263 stars 99 forks source link

New feature: change mouse cursor to pointer when hover #54

Closed muriloventuroso closed 3 years ago

muriloventuroso commented 3 years ago

I don't know if this plugin was designed for desktop and web support, but it works very well on both. However, for these environments it would be interesting for the mouse cursor to be changed to pointer when it is over the link. I use a solution for this in some projects and it might be interesting to implement this plugin.

The extension below can handle the mouse cursor change using the MouseRegion widget:

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

extension HoverExtensions on Widget {

  Widget get showCursorOnHover {
    return MouseRegion(
      child: this,
      // When the mouse enters the widget set the cursor to pointer
      cursor: SystemMouseCursors.click
      // When it exits set it back to default
    );
  }
}

And then just add the extension to the Widget:

Container().showCursorOnHover
Cretezy commented 3 years ago

I own the flutter_cursor library, so I can tell you that this isn't possible right now.

See other issue: https://github.com/Cretezy/flutter_linkify/issues/36

I know Web has been doing many updates with cursor stuff, so I'll take a look when it's more polished, but for now it's still a bit too early

Cretezy commented 3 years ago

It might now be possible with the new Flutter cursor changes. I will investiage

gsvano commented 3 years ago

Hi! Can you check #70? Possible it can help.

Cretezy commented 3 years ago

Fixed with https://github.com/Cretezy/flutter_linkify/pull/70 (release v4.1.0)