我想在Icon中创建一个超链接:
IconButton(
icon: Icon(Icons.ac_unit,),
onPressed: ()=>launch('https://github.com/himanshusharma89'),
)
我们怎样才能做到这一点?
错误:
Exception has occurred.
MissingPluginException (MissingPluginException(No implementation found for method launch on channel plugins.flutter.io/url_launcher))
最佳答案
这是解决方案,这要感谢:Pavel
IconButton(
icon: Icon(Icons.ac_unit,),
onPressed: () async {
const url = 'https://github.com/himanshusharma89';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
)
关于android - 如何在Flutter中创建超链接图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59520122/