flutter webview加载本地文件出现跨域解决方案

一直报错

[INFO:CONSOLE(17)] "Access to image at 'file:///android_asset/flutter_assets/assets/jump/box_bottom.png' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-untrusted, https.", source: file:///android_asset/flutter_assets/assets/jump/index.html (17) 

flutter 的webview封装

下面的是加载本地html文件为网页展示

..loadFlutterAsset("assets/jump/index.html");

 但是打包后的网页内图片访问 就出上面的问题了

想要解决

将图片转换成dataUrl 替换进前端代码中去

在线转换生成DataURL\DataUri、图片转为DataURL\DataUri--查错网

去掉file-loader 

const box_bottom ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbwAAAAyBAMAAADVU3PwAAAAMFBMVEVerGr+bmH/xgD///9osXL/dmr/ySXo8+n/6uf/9+H/2XCUx5r/n5aTx5n/nZX/ySDNqwUbAAABPklEQVRo3u3arUoFURTF8Q1OE8NBponhCDdY/FjqvdcvBgwG02AxmKZp1WYUm00wGBUEm6BgFhGMgk8gPoIv4OQ565ziLfew/nHDCr++DVkn3jhnwE3ju/UeAAzvfdDxFeIDXNauW/kBYPDugg7PEwOcVdateAHQf7agvZP4wDBsfFivZVx70hHig0HtwsqWceFIB4lBv7KwomWcGmk3PjCse9YdcMvu84gPNh3rDXhl95nEYMNYT8CjkSbjA8OaZ/0CDbsvID5Ydax9oGb3MjFYMdYOUBmpiA8My541B3ga4oMlx5oGHC0xWDTWBGC06EA88cQTTzzxxBNPPPHEE0888cQTTzzxxBNPPPHEE0888cQTTzzx/s3L/3VgdI8f2471A3yz+2xisGWsL+DTSFPRQf5vO5k/XWWdeOPcH7PNWv+r2q/BAAAAAElFTkSuQmCC";const box_middle ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbwAAAAyCAYAAAAnfW7DAAAEDWlDQ1BJQ0MgUHJvZmlsZQAAOI2NVV1oHFUUPrtzZyMkzlNsNIV0qD8NJQ2TVjShtLp/3d02bpZJNtoi6GT27s6Yyc44M7v9o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QCSyiwhAJLKLCEAksosIRyBQYWWPq5AgMLLP1cgYEFln6uwMACSz9XYGCBpZ8rMLDA0s8VGFhg6ecKDCyw9HMFBhZY+rkCA0sJy5FMYAkFllBgCQXWX/buoAgAGIhBYCb+RVdCv1yGtYAADjHWIcY6xFiHGOsrHJWxdoSjMtaOcFTG2hGOylg7wlEZa0c4KmPtCEdlrB3hqIy1IxyVsXaEozLWjnBUxtoRjspYO8JRGWtHOCpj7QhHZawd4aiMtSMclbF2hKMy1o5wVMbaEY7KWDvCURlrRzgqY+0IR2WsHeGojLUjHJWxdoSjMtaOcFTG2hGOylg7wlEZa0c4KmPtCEdlrB3hqIy1IxyVsXaEo2CMwX04Hjt1jOswCERRNNB4F8j7X+X/U6AYKenyYqScW42h42jcd6otH+MYfYMe+9Q3ahx9VlTVBsv12Kf+3cb71y+e8zJXl5N+T7+MVa//uvO5Sa3mWfHWbb+n38ZauNq6SnVXMGtnncC6Aasak+j8n3vVjtncqjVYd2HNf1sbc1yAYG2GVUbjMsHaGmsJFqxPBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAsWrESwYMFKBAvW30YjixZgMEUWAJ/J/UQDNhRSAAAAAElFTkSuQmCC";export { box_bottom, box_middle, box_top, Dot, express };

使用

import { express } from "../res/dataUrl";

import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';import 'package:webview_flutter/webview_flutter.dart';enum GameStatus {ready,start,stop,
}class JumpGame extends StatefulWidget {const JumpGame({super.key});@overrideState<JumpGame> createState() => _LocalViewState();
}class _LocalViewState extends State<JumpGame> {late WebViewController controller;GameStatus curStatus = GameStatus.ready;@overridevoid initState() {super.initState();controller = WebViewController()..setJavaScriptMode(JavaScriptMode.unrestricted)..setBackgroundColor(const Color(0x00000000))..setNavigationDelegate(NavigationDelegate(onProgress: (int progress) {// Update loading bar.},onPageStarted: (String url) {},onPageFinished: (String url) {},onWebResourceError: (WebResourceError error) {},),)..addJavaScriptChannel('App', onMessageReceived: onMessageReceived)..loadFlutterAsset("assets/jump/index.html");}void onMessageReceived(JavaScriptMessage message) async {final messageJson = json.decode(message.message);print(messageJson);final messageMethod = messageJson["method"];final messageData = messageJson["data"] ?? {};switch (messageMethod) {case "start":show(Column(mainAxisSize: MainAxisSize.min,children: [Text("开始"),ElevatedButton(onPressed: () {SmartDialog.dismiss();},child: Text("开始"))],),);break;case 'jumpSuccess':// await Future.delayed(const Duration(milliseconds: 500));show(Center(child: Column(mainAxisSize: MainAxisSize.min,children: [ElevatedButton(style:ElevatedButton.styleFrom(backgroundColor: Colors.orange),onPressed: () {SmartDialog.dismiss();},child: Text("继续"),),],),),);break;case 'gameOver':// await Future.delayed(const Duration(milliseconds: 500));// Get.bottomSheet(//   isScrollControlled: true,//   ignoreSafeArea: true,//   isDismissible: false,//   backgroundColor: Colors.transparent,//   enableDrag: false,//   Container(//     height: 1.sh,//     width: double.infinity,//     color: Colors.red,//     child://   ),// );show(Center(child: Column(mainAxisSize: MainAxisSize.min,children: [ElevatedButton(style: ElevatedButton.styleFrom(backgroundColor: Colors.orange),onPressed: () {SmartDialog.dismiss();controller.reload();},child: Text("重新开始"),),],),));break;}// ScaffoldMessenger.of(context).showSnackBar(//   SnackBar(content: Text(message.message)),// );}void show(Widget child) {SmartDialog.show(builder: (context) {return Container(height: 1.sh,width: 1.sw,color: Colors.black26,alignment: Alignment.center,child: child,);});}@overrideWidget build(BuildContext context) {return SafeArea(top: false,bottom: false,child: Scaffold(appBar: AppBar(title: const Text('跳一跳',style: TextStyle(color: Color(0xff333333)),),),body: WebViewWidget(controller: controller),),);}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/14239.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

带你玩转OpenHarmony AI:打造智能语音子系统

简介 AI时代&#xff0c;智者当先&#xff0c;判断一个终端设备是否智能&#xff0c;语音能力是必不可缺的。智能家居、智慧厨房、智能汽车等等&#xff0c;一切衣食住行都在往智能方向发展&#xff0c;那我们该如何在OpenAtom OpenHarmony&#xff08;简称“OpenHarmony”&am…

未来十年,IT行业的无限可能!

未来十年&#xff0c;IT行业的无限可能&#xff01; &#x1f604;生命不息&#xff0c;写作不止 &#x1f525; 继续踏上学习之路&#xff0c;学之分享笔记 &#x1f44a; 总有一天我也能像各位大佬一样 &#x1f3c6; 博客首页 怒放吧德德 To记录领地 &#x1f31d;分享学…

多联机分户计费控制系统

中央空调多联机分户计费控制系统&#xff0c;针对国内常见几种品牌的多联机空调系统实行&#xff0c;远程控制与计费管理。系统采用MQTT网络协议&#xff0c;以订阅/发布模式实行设备感知&#xff0c;实现对室外机、室内机的状态监测、实时故障报警、累计分摊费用的实时数据传导…

AI - 各类AI针对Excel分析对比

一个水果销量表&#xff0c;Excel包含多个年份sheet&#xff0c;需要提取某个品种的水果每年的销量&#xff0c;看看几个AI的分析结果吧 1、文心一言3.5&#xff08;不支持Excel&#xff09; 不支持上传Excel文件 2、 通义千问2.5&#xff08;完成★&#xff09; 顺利完成…

C++-函数

函数&#xff08;Function&#xff09;&#xff1a;是一个提前封装好的、可重复使用的、完成特定功能的独立代码单元。 特点&#xff1a;提前封装、可重复使用的、完成特定功能 将针对特定功能的、有重复使用需求的代码&#xff0c;提前封装到函数内&#xff0c; 在需要的时候…

游戏陪玩/在线租号/任务系统网站源码

源码介绍 游戏陪玩系统/在线租号系统/小姐姐陪玩任务系统/网游主播任务威客平台源码/绝地吃鸡LOL在线下单/带手机端/声优线上游戏任务系统网站源码 界面美观,功能齐全,已对接支付,安装教程放源码压缩包里了! 界面截图 源码下载 https://download.csdn.net/download/huayula…

【计算机网络原理】浅谈应用层协议的自定义和传输层UDP协议的总结

˃͈꒵˂͈꒱ write in front ꒰˃͈꒵˂͈꒱ ʕ̯•͡˔•̯᷅ʔ大家好&#xff0c;我是xiaoxie.希望你看完之后,有不足之处请多多谅解&#xff0c;让我们一起共同进步૮₍❀ᴗ͈ . ᴗ͈ აxiaoxieʕ̯•͡˔•̯᷅ʔ—CSDN博客 本文由xiaoxieʕ̯•͡˔•̯᷅ʔ 原创 CSDN 如…

如何在cPanel面板中开启双因素身份验证

本周有一个客户&#xff0c;购买Hostease的主机&#xff0c; 客户购买的是Linux虚拟主机&#xff0c;带cPanel面板的。询问我们的在线客服&#xff0c;如何加强他的cPanel的安全性。cPanel的双因素身份验证功能可以帮助帮客户加固安全性。 双因素身份验证(2FA)是一种增强安全性…

【虚拟机软件】 VMware Workstation Pro 17 新建 Linux 虚拟机教程(CentOS 7 版本)

文章目录 下载安装 VMware Workstation Pro 17 软件下载 Linux 的 ISO 映像文件Linux版本选择 新建虚拟机准备配置新建安装 后续设置文章导航 我是一名立志把细节说清楚的博主&#xff0c;欢迎【关注】&#x1f389; ~ 原创不易&#xff0c; 如果有帮助 &#xff0c;记得【点赞…

slam14讲(第8讲、前端里程计)LK光流、直接法

直接法的引出 因为第7讲大部分都是讲特征点法&#xff0c;通过提取orb特征点和点的描述子&#xff0c;来构建两帧图像之间的特征点对应关系。这种方法会有缺点&#xff1a; 关键点和描述子提取计算耗时&#xff0c;如果相机的频率高&#xff0c;则slam算法大部分耗时被占。特…

【MySQL精通之路】InnoDB(10)-行格式

目录 1.表数据结构 1.1 聚集索引数据结构 1.2 辅助索引数据结构 2.行格式 2.1 REDUNDANT行格式 2.2 REDUNDANT存储特性 2.3 COMPACT行格式 2.4 COMPACT存储特性 2.5 DYNAMIC行格式 2.6 DYNAMIC存储特性 2.7 COMPRESSED行格式 2.8 COMPRESSED存储特性 3.定义表格的…

数组-区间合并

一、题目描述 二、题目思路 这里提供满足基本要求的解题思路&#xff1a; 1.先对列表内按照start大小升序排序&#xff0c;这里创建Comparator接口的实现类&#xff0c;重写compare方法。 2.遍历intervals&#xff0c;设置laststart、lastend两个变量与当前区间相比较&#…

Ansible实战YAML语言完成apache的部署,配置,启动全过程

&#x1f3e1;作者主页&#xff1a;点击&#xff01; &#x1f3dd;️Ansible专栏&#xff1a;点击&#xff01; ⏰️创作时间&#xff1a;2024年5月24日15点59分 目录 &#x1f4af;趣站推荐&#x1f4af; &#x1f38a;前言 ✨️YAML语言回顾 &#x1f386;1.编写YAML文…

k近邻和kd树

K近邻 选取k值的时候可以采用交叉验证的方法 一般采用欧氏距离 kd树 采用树这个特殊的数据结构来实现k近邻算法 先假设是二维的情况 下面讲解kd树的完整构造过程 找这个中位数是按照每棵子树来创建的 前提是已经有了一棵kd树,然后来一个实例点

Python UDP编程简单实例

TCP是建立可靠的连接&#xff0c;并且通信双方都可以以流的形式发送数据。 相对于TCP&#xff0c;UDP则是面向无连接的协议&#xff0c;不需要建立连接&#xff0c;只需要知道对方IP地址和端口号&#xff0c;就可以直接发送数据包。但是只管发送不保证到达。 虽然UDP传输数据…

Docker快速部署Seata的TC服务以及微服务引入Seata教程

目录 一、使用docker部署Seata的TC服务 1、拉取TC服务镜像 2、创建并运行容器 ​3、修改配置文件 4、在Nacos中添加TC服务的配置 5、重启TC服务 二、微服务集成Seata 1、引入依赖 2、修改配置文件 Seata是阿里的一个开源的分布式事务解决方案&#xff0c;能够为分布…

STM32学习和实践笔记(31):输入捕获实验

1.输入捕获介绍 在定时器中断实验章节中我们介绍了通用定时器具有多种功能&#xff0c;输入捕获就是其中一种。STM32F1除了基本定时器TIM6和TIM7&#xff0c;其他定时器都具有输入捕获功能。输入捕获可以对输入的信号的上升沿&#xff0c;下降沿或者双边沿进行捕获&#xff0c;…

Redis系统架构中各个处理模块是干什么的?no.19

Redis 系统架构 通过前面的学习&#xff0c;相信你已经掌握了 Redis 的原理、数据类型及访问协议等内容。本课时&#xff0c;我将进一步分析 Redis 的系统架构&#xff0c;重点讲解 Redis 系统架构的事件处理机制、数据管理、功能扩展、系统扩展等内容。 事件处理机制 Redis…

SSMP整合案例第一步 制作分析模块创建与开发业务实体类

制作分析 我们要实现一个模块的增删改查 实际开发中mybatisplus用的不多&#xff0c;他只能对没有外键的单表进行简单的查询 但在这个案例中我们还是选择mybatisplus开发 模块创建 我们把所有服务器都放在一起 就不用前后端分离 我们尝试用后端开发进行全栈开发 新建项目添…

Thinkphp3.2.3网站后台不能访问如何修复

我是使用Thinkphp3.2.3新搭建的PHP网站&#xff0c;但是网站前台可以访问&#xff0c;后台访问出现如图错误&#xff1a; 由于我使用的Hostease的Linux虚拟主机产品默认带普通用户权限的cPanel面板&#xff0c;对于上述出现的问题不清楚如何处理&#xff0c;因此联系Hostease的…