android - 如何在Flutter中创建超链接图标?

标签 android flutter dart icons

我想在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/

相关文章:

java - Android 应用随设备语言变化而变化

java - 使用 Glide 修复图像内存泄漏

flutter - 在 flutter sqflite 中加入和计数查询

dart - Dart中的单元测试PODO构造函数异常

flutter - 创建一个没有空格的用户名验证器

android - EditText 在提供的照片中为该指针使用颜色强调

java - Firebase 数据库在服务中运行

flutter - 在 Flutter web 中没有得到任何错误输出

dart - 广告未在iOS设备上展示

javascript - Dart 互操作 : How correctly to make a wrapper?