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
269 stars 101 forks source link

SelectableLinkify : SelectableText only supports TextSpan; Other type of InlineSpan is not allowed #82

Closed deacon78 closed 3 years ago

deacon78 commented 3 years ago

Hello I have this issue :

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════ The following assertion was thrown building SelectableText(dirty, state: _SelectableTextState#a9446): SelectableText only supports TextSpan; Other type of InlineSpan is not allowed 'package:flutter/src/material/selectable_text.dart': Failed assertion: line 560 pos 12: '() { return _controller._textSpan.visitChildren((InlineSpan span) => span.runtimeType == TextSpan); }()'

My code :

SelectableLinkify( onOpen: (link) async { if (await canLaunch(link.url)) { await launch(link.url); } else { throw 'Could not launch $link'; } }, text: this.listeNotes[position].note, //textScaleFactor: 1.0,//not supported by "SelectableLinkify" :( style:TextStyle(fontFamily: "BerlinSansFBRegular",fontSize: 10,), options: LinkifyOptions(humanize: false),//pour afficher le http ),

MohamedEL-Torky commented 3 years ago

Please check #79

Cretezy commented 3 years ago

This appears to be fixed with https://github.com/Cretezy/flutter_linkify/pull/80, which has a remaining requested change. Will merge ASAP

Duplicate of https://github.com/Cretezy/flutter_linkify/issues/79