I want a selectable text that is clickable, in this case I'm using Flutter Web and the html library, I have a clickable phone number which allows the user to select an app from the browser to phone with.
My issue is that when hovering over this text, the cursor is that of "text" from the selectable text, but I want the cursor to change to a "pointer"/"link select". In other words, I want it to work how "real" HTML does by default.
class Example extends StatelessWidget{
@override
Widget build(BuildContext context) {
return Column(
children: [
SelectableText(
'Phone us:',
style: TextStyle(fontSize: 24),
),
SelectableText(
'Tel: +123 1231 231',
style: TextStyle(fontSize: 20),
onTap: ()=>{html.window.location.href = "tel:+1231231231"},
),
],
);
}
}
I tried wrapping the selectable text in a MouseRegion(), but this didn't work either.
class Example extends StatelessWidget{
@override
Widget build(BuildContext context) {
return Column(
children: [
SelectableText(
'Phone us:',
style: TextStyle(fontSize: 24),
),
MouseRegion(
cursor: SystemMouseCursors.click,
child: SelectableText(
'Tel: +123 1231 231',
style: TextStyle(fontSize: 20),
onTap: ()=>{html.window.location.href = "tel:+1231231231"},
),
),
],
);
}
}
Aucun commentaire:
Enregistrer un commentaire