微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

E/flutter (3719): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] 未处理的异常:无法启动 https://www.google.gr/?hl=el

如何解决E/flutter (3719): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] 未处理的异常:无法启动 https://www.google.gr/?hl=el

单击 FloatingActionButton 时出现错误。你能帮我吗? 当我从物理设备上按下按钮时,我的程序停止了,我必须从调试工具中恢复它。 这是我的代码

class _MyHomePageState extends State<MyHomePage> {
  
  @override
  Widget build(BuildContext context) {
    final mediaQuery = MediaQuery.of(context);
    final appbar = appbarBuilder();

    return Scaffold(
      appBar: appbar,body: body,floatingActionButton: FloatingActionButton(
        backgroundColor: Colors.blue,onpressed: () async {
          const url = 'https://www.google.gr/?hl=el';
          if (await canLaunch(url)) {
            await launch(url);
          } else {
            throw 'Could not launch $url';
          }
        },child: Image.asset(
          'assets/instagram.png',color: Colors.black,),);
  }
}

解决方法

你应该恢复你的模拟器..我遇到了这个问题,我只是恢复了这个模拟器

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。