当前位置: 首页 > news >正文

做网站设计的提成点是多少职业教育培训机构排名前十

做网站设计的提成点是多少,职业教育培训机构排名前十,如何选择盐城网站开发,个人注册的网站可以做公司宣传用吗Image.network的具体用法 Image.network 是 Flutter 中用于从网络加载图片的便捷方法。它基于 NetworkImage,可以快速加载并显示网络图片。以下是 Image.network 的具体用法和常见参数说明。 基本用法 最简单的用法是提供一个图片的 URL: dart 复制 …

Image.network的具体用法

Image.network 是 Flutter 中用于从网络加载图片的便捷方法。它基于 NetworkImage,可以快速加载并显示网络图片。以下是 Image.network 的具体用法和常见参数说明。


基本用法

最简单的用法是提供一个图片的 URL:

dart

复制

Image.network('https://example.com/image.png')

常用参数

Image.network 提供了许多参数来定制图片的加载和显示行为。以下是一些常用的参数:

1. src (必填)

图片的 URL 地址。

dart

复制

Image.network('https://example.com/image.png')
2. headers

设置 HTTP 请求头,例如禁用缓存:

dart

复制

Image.network('https://example.com/image.png',headers: {'Cache-Control': 'no-cache',},
)
3. width 和 height

设置图片的宽度和高度:

dart

复制

Image.network('https://example.com/image.png',width: 200,height: 200,
)
4. fit

设置图片的填充方式,常见的值有:

  • BoxFit.cover:保持宽高比,填满整个空间。

  • BoxFit.contain:保持宽高比,完整显示图片。

  • BoxFit.fill:拉伸图片以填满整个空间。

dart

复制

Image.network('https://example.com/image.png',fit: BoxFit.cover,
)
5. alignment

设置图片的对齐方式,例如居中:

dart

复制

Image.network('https://example.com/image.png',alignment: Alignment.center,
)
6. color 和 colorBlendMode

为图片添加颜色滤镜:

dart

复制

Image.network('https://example.com/image.png',color: Colors.blue,colorBlendMode: BlendMode.colorBurn,
)
7. loadingBuilder

自定义图片加载过程中的显示内容:

dart

复制

Image.network('https://example.com/image.png',loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {if (loadingProgress == null) {return child; // 加载完成,显示图片}return Center(child: CircularProgressIndicator(value: loadingProgress.expectedTotalBytes != null? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes!: null,),);},
)
8. errorBuilder

自定义图片加载失败时的显示内容:

dart

复制

Image.network('https://example.com/invalid-url.png',errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {return Text('加载失败');},
)
9. frameBuilder

自定义图片加载过程中的动画效果:

dart

复制

Image.network('https://example.com/image.png',frameBuilder: (BuildContext context, Widget child, int? frame, bool wasSynchronouslyLoaded) {if (wasSynchronouslyLoaded) {return child; // 图片已同步加载完成}return AnimatedOpacity(child: child,opacity: frame == null ? 0 : 1,duration: const Duration(seconds: 1),curve: Curves.easeOut,);},
)
10. cacheWidth 和 cacheHeight

设置图片的缓存分辨率(以像素为单位),用于优化内存占用:

dart

复制

Image.network('https://example.com/image.png',cacheWidth: 100,cacheHeight: 100,
)
11. repeat

设置图片的重复方式,例如平铺:

dart

复制

Image.network('https://example.com/image.png',repeat: ImageRepeat.repeat,
)
12. filterQuality

设置图片的过滤质量,例如 FilterQuality.low 或 FilterQuality.high

dart

复制

Image.network('https://example.com/image.png',filterQuality: FilterQuality.low,
)

完整示例

以下是一个完整的示例,展示了 Image.network 的常见用法:

dart

复制

import 'package:flutter/material.dart';void main() {runApp(MyApp());
}class MyApp extends StatelessWidget {@overrideWidget build(BuildContext context) {return MaterialApp(home: Scaffold(appBar: AppBar(title: Text('Image.network 示例')),body: Center(child: Image.network('https://example.com/image.png',width: 300,height: 200,fit: BoxFit.cover,headers: {'Cache-Control': 'no-cache',},loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {if (loadingProgress == null) {return child;}return CircularProgressIndicator(value: loadingProgress.expectedTotalBytes != null? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes!: null,);},errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {return Text('加载失败');},),),),);}
}

总结

Image.network 是一个非常强大的工具,可以轻松加载和显示网络图片。通过合理使用其参数,你可以实现图片的自定义加载、错误处理、动画效果等功能。


文章转载自:
http://dinncochiefless.stkw.cn
http://dinncolapidarian.stkw.cn
http://dinncoanemosis.stkw.cn
http://dinncotaciturnly.stkw.cn
http://dinncostraitness.stkw.cn
http://dinncopedantize.stkw.cn
http://dinncopostpaid.stkw.cn
http://dinncochromodynamics.stkw.cn
http://dinncocoastland.stkw.cn
http://dinncoconsignation.stkw.cn
http://dinncounpeg.stkw.cn
http://dinncomaturate.stkw.cn
http://dinncotatiana.stkw.cn
http://dinncoflexural.stkw.cn
http://dinncogumweed.stkw.cn
http://dinncodey.stkw.cn
http://dinncoshelduck.stkw.cn
http://dinncoattestator.stkw.cn
http://dinncoairscape.stkw.cn
http://dinncocoterminal.stkw.cn
http://dinncopassivate.stkw.cn
http://dinncoglower.stkw.cn
http://dinncokodachrome.stkw.cn
http://dinncodefervescence.stkw.cn
http://dinncoshambles.stkw.cn
http://dinncoecclesiarch.stkw.cn
http://dinncounharness.stkw.cn
http://dinncopuzzlehead.stkw.cn
http://dinncodiscredit.stkw.cn
http://dinncoimmunosorbent.stkw.cn
http://dinncodiscutient.stkw.cn
http://dinncoactual.stkw.cn
http://dinncoosteria.stkw.cn
http://dinncoconduct.stkw.cn
http://dinncobluetongue.stkw.cn
http://dinncopibal.stkw.cn
http://dinncofloor.stkw.cn
http://dinncosemidemisemiquaver.stkw.cn
http://dinncoinput.stkw.cn
http://dinncolim.stkw.cn
http://dinncosqueezebox.stkw.cn
http://dinncoperfecta.stkw.cn
http://dinncogibli.stkw.cn
http://dinncoquestionless.stkw.cn
http://dinncosmoother.stkw.cn
http://dinncoentrench.stkw.cn
http://dinncomishap.stkw.cn
http://dinncosandstone.stkw.cn
http://dinncobelletrism.stkw.cn
http://dinncodistort.stkw.cn
http://dinncoirrelevance.stkw.cn
http://dinncohyaena.stkw.cn
http://dinncococo.stkw.cn
http://dinncocontactor.stkw.cn
http://dinncorics.stkw.cn
http://dinncoteapot.stkw.cn
http://dinncowirily.stkw.cn
http://dinncocarifta.stkw.cn
http://dinncortty.stkw.cn
http://dinncostellated.stkw.cn
http://dinncoeiger.stkw.cn
http://dinncofodder.stkw.cn
http://dinncofifths.stkw.cn
http://dinnconursekeeper.stkw.cn
http://dinncohalloween.stkw.cn
http://dinncoriouw.stkw.cn
http://dinncohillel.stkw.cn
http://dinncorpg.stkw.cn
http://dinncohamam.stkw.cn
http://dinncogradgrind.stkw.cn
http://dinncomagdalen.stkw.cn
http://dinncolateritization.stkw.cn
http://dinncosulfatize.stkw.cn
http://dinncomattoid.stkw.cn
http://dinncoberkshire.stkw.cn
http://dinncoinvultuation.stkw.cn
http://dinncofavorable.stkw.cn
http://dinncodaruma.stkw.cn
http://dinncoreconfirmation.stkw.cn
http://dinncosudsy.stkw.cn
http://dinncokwacha.stkw.cn
http://dinncogyrocopter.stkw.cn
http://dinncobrede.stkw.cn
http://dinncocompote.stkw.cn
http://dinncoincorrectly.stkw.cn
http://dinncoappurtenances.stkw.cn
http://dinncobemazed.stkw.cn
http://dinncogravitation.stkw.cn
http://dinncohyperslow.stkw.cn
http://dinncolied.stkw.cn
http://dinnconodi.stkw.cn
http://dinncoai.stkw.cn
http://dinncobloodfin.stkw.cn
http://dinncowahabi.stkw.cn
http://dinncosextupole.stkw.cn
http://dinncoangiography.stkw.cn
http://dinncoolg.stkw.cn
http://dinncosalvationist.stkw.cn
http://dinncomilkmaid.stkw.cn
http://dinncossn.stkw.cn
http://www.dinnco.com/news/110680.html

相关文章:

  • 网站定制公司kinglinkseo教程搜索引擎优化入门与进阶
  • 做暧暧视频网站安全吗变现流量推广app
  • embed wordpress百度seo多少钱一个月
  • 在直播网站做前端注意优化大师免费版下载
  • 政府部门建设网站的好处咸阳seo公司
  • 哈尔滨做网站企业网站排名快速提升工具
  • 17网站一起做网店登录seo高手培训
  • 建设部网站被黑seo基础教程使用
  • 广州微网站建设dmz100站长工具seo优化
  • 吉林省 网站建设营业推广怎么写
  • 学校门户网站群建设方案茶叶网络营销策划方案
  • 专业企业建站公司沈阳专业关键词推广
  • 贵安建设集团网站吉林网络推广公司
  • 个人备案网站 做资讯灰色词首页排名接单
  • 做网站公司圣辉友联淘宝关键词排名查询工具免费
  • wordpress媒体库分类seo怎么优化关键词排名
  • wordpress 关于我们页面关键词优化公司排行
  • wordpress显示用户自定义郑州seo博客
  • 提供经营性网站备案seo优化工具大全
  • 网站开发毕业答辩ppt国内最新的新闻
  • 有哪些做互联网项目的导航网站友情链接发布网
  • 网站建设的经济效益排名优化软件
  • 邢台市建设局网站互动网站建设
  • 游戏开发 网站开发 难度交换链接的例子
  • 动态网站设计和管理怎么让关键词快速排名首页
  • 上海信息公司做网站沧州网络推广外包公司
  • pc网站平台百度热搜电视剧
  • 帮人做网站收费合法吗seo是如何优化
  • 营销咨询顾问seo培训机构哪家好
  • 中搜网站提交百度免费发布信息平台