flutter BoxDecoration设置背景 image 报错:type ‘Image‘ is not a subtype of type ‘ImageProvider<Object> 解决方法
问题:
flutter BoxDecoration 设置页面背景图片报错代码如下:
decoration:BoxDecoration( image: DecorationImage(image: _image) ),
给image属性指定的图片为Image.asset:
get _image => Image.asset('asset/images/loginpageback.jpg');
报错:
type 'Image' is not a subtype of type 'ImageProvider<Object>
解决方法:
把ImageAsset改成AssetImage:
image: DecorationImage(image: AssetImage('asset/images/loginpage/loginpageback.jpg'),fit: BoxFit.cover
),
这样就不会报错了
flutter BoxDecoration设置背景 image 报错:type ‘Image‘ is not a subtype of type ‘ImageProvider<Object> 解决方法相关推荐
- MySQL无法启用/etc/my.cnf配置文件,重启报错Warning: World-writable config file ‘/etc/my.cnf’ is ignored的解决方法
MySQL无法启用/etc/my.cnf配置文件,重启报错Warning: World-writable config file '/etc/my.cnf' is ignored的解决方法 问题分析 ...
- nodejs连接mysql数据库,报错Client does not support authentication protocol requested by server的解决方法
nodejs连接mysql数据库,报错Client does not support authentication protocol requested by server的解决方法 参考文章: (1 ...
- MyBatis多个接口参数报错:Available parameters are [0, 1, param1, param2], 及解决方法
MyBatis多个接口参数报错:Available parameters are [0, 1, param1, param2], 及解决方法 参考文章: (1)MyBatis多个接口参数报错:Avai ...
- 安装thinkphp 报错Could not find package topthink/think with stability stable.的解决方法
安装thinkphp执行命令 composer create-project topthink/think tp5 --prefer-dist 报错 [InvalidArgumentException ...
- 【Keil MDK中工程报错Browse information of one of more files is not available解决方法】
[Keil MDK中工程报错Browse information of one of more files is not available解决方法] 今天在进行工程编写时,出现了这个错误Browse ...
- 【Git】Git commit至Gitee报错‘remote: error: hook declined to update refs/heads/master‘的解决方法
Git commit至Gitee报错'remote: error: hook declined to update refs/heads/master'的解决方法 进入到Gitee的邮箱管理中,取消勾 ...
- python 报错 UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd3 in position 解决方法
在使用urllib获取reqest的response的时候,还要进行解码 content = urllib.request.urlopen(request).read().decode() 当执行该语 ...
- Jquery Datatable 数据填充报错:requested unknown parameter ‘XXX‘ for row xx, column xx 解决方法
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 报错如图: 解决方法见官网:https://datatables.net/manual/tech-n ...
- idea测试连接mysql报错08001_IDEA连接MySQL(版本8)数据库失败的解决方法(报错08001)...
在IDEA自带的数据库连接工具中,可以连接MySQL数据库,但是有的时候连接出现08001错误,连接不上数据库. 1.一般配置如下所示 Database处填写数据库名字:User处填写mysql设置好 ...
- 【YOLOv5报错】AssertionError: Label class 4 exceeds nc=4 in /xxxxxx解决方法
一般是由于数据集的标签文件出现的类别数与自己设置的nc类别数不符. 例如我原本要检测5类目标,则标签序号为0.1.2.3.4,nc数设置为5,如图: 而'4'这一类mAP太低,所以想去掉,于是只把nc ...
最新文章
- linux 删除小于、大于固定大小的文件
- python3.6程序实例_Python3.6学习笔记(三)
- 【题解】luogu p1111 修复公路
- Installshield x:实现序列号检验,获取用户信息并写入指定_ini文件1 - 子夜 MySpace聚友博客...
- 使用反射获得jar包中的类、方法、参数、返回值类型,然后动态加载jar包运行方法
- 被坑的过来人告诉你,为什么数据中台永远都搞不成?
- 敏捷开发中的MoSCoW优先级排序方法
- 一元线性回归的前因后果
- 二叉树期CRR权定价模型-python
- Ubuntu 16 永久修改ulimit中的max file open限制
- 人脸识别技术及其各种用例
- java 庖丁解牛api_Java 微信支付 APIv3 平台证书的命令行下载工具
- 汽车研发的五大阶段及制造的四大工艺
- 学计算机用商务本还是游戏本,工作学习游戏?这 8 款最具性价比的笔记本电脑,总有一款适合你...
- 计算机微课用什么音乐,有关微课音乐课堂教学
- idea jdk版本设置
- 【LiteOS】HUAWEI LiteOS 详解
- 网络游戏南北互通问题分析
- 点击文字或者按钮在本页面中弹出悬浮小窗口
- 网络安全等级保护测评高风险判定-安全通信网络-2