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

注册网站刀具与钢材范围wordpress最大文件大小

注册网站刀具与钢材范围,wordpress最大文件大小,产品定制网站开发,响应式相册网站模板目录 图片组件的介绍 1.Image.network加载图片 1.1 Image scale图片缩小一倍 1.2 Image alignment使用 1.3 Image fit 属性的取值及说明 1.3.1 Contain 默认效果 1.3.2 Fill 图片会缩放至完全填满目标区域#xff08;宽高#xff09; 1.3.3 Fill 图片会缩放至完全填满目…目录 图片组件的介绍 1.Image.network加载图片    1.1 Image scale图片缩小一倍 1.2 Image alignment使用 1.3 Image fit 属性的取值及说明 1.3.1 Contain 默认效果  1.3.2 Fill 图片会缩放至完全填满目标区域宽高 1.3.3 Fill 图片会缩放至完全填满目标区域宽高 1.4 repeat 图片平铺 1.4.1 repeatX轴\Y轴都平铺 1.5. 实现圆角图片 1.5.1 Container 实现圆角图片 1.5.2 Container circular 圆角参数设置 1.6.1 使用ClipOval使用实现一个圆形图片 2.加载本地图片 2.1 要在 Flutter 中加载本地图片需要完成两个主要步骤        2.1.2 在 项目下创建images资源文件 2.1.2 在 pubspec.yaml 中配置图片资源路径 2.1.3 使用 Image.asset 或 Image 组件加载图片 图片组件的介绍 1.Image.network加载图片    import package:flutter/material.dart;void main() {runApp(MaterialApp(home: Scaffold(appBar: AppBar(title: Text(sss)), body: MyApp2()),),); }class MyApp2 extends StatefulWidget {overrideStateStatefulWidget createState() {return MyAppState();} }class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(height: 300,width: 300,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,),),);} }1.1 Image scale图片缩小一倍 class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(height: 300,width: 300,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,scale: 2, //图片缩小),),);} } 1.2 Image alignment使用 class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(height: 300,width: 300,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,scale: 2,//缩放alignment: Alignment.centerLeft,//位置),),);} }或者修改Container位置class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(alignment: Alignment.centerLeft, //位置height: 300,width: 300,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,scale: 2,//缩放// alignment: Alignment.centerLeft, //位置),),);} }1.3 Image fit 属性的取值及说明 属性名作用描述BoxFit.fill- 强制图片填满整个容器宽高均与容器一致。 - 可能导致图片变形宽高比被忽略。BoxFit.contain- 图片按原比例缩放完全包含在容器内宽或高中至少一边与容器边缘对齐。 - 可能在另一边留有空白。BoxFit.cover- 图片按原比例缩放覆盖整个容器宽和高均不小于容器。 - 超出容器的部分会被裁剪。BoxFit.fitWidth- 图片宽度与容器宽度一致高度按比例缩放。 - 可能超出容器高度或留有空白。BoxFit.fitHeight- 图片高度与容器高度一致宽度按比例缩放。 - 可能超出容器宽度或留有空白。BoxFit.none- 图片按原始尺寸显示不进行任何缩放。 - 若图片尺寸大于容器会被截断显示。BoxFit.scaleDown- 类似于 contain但只在图片尺寸大于容器时缩小不会放大图片。 - 保持原图清晰度避免低分辨率图片拉伸模糊。 1.3.1 Contain 默认效果  class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(// alignment: Alignment.centerRight, //位置height: 300,width: 300,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,// scale: 2,//缩放// alignment: Alignment.centerLeft, //位置fit: BoxFit.contain, //图片fit属性 默认),),);} }1.3.2 Fill 图片会缩放至完全填满目标区域宽高 1.3.3 Fill 图片会缩放至完全填满目标区域宽高 class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(// alignment: Alignment.centerRight, //位置height: 300,width: 300,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,// scale: 2,//缩放// alignment: Alignment.centerLeft, //位置fit: BoxFit.fitWidth, //图片fit属性 宽度充满),),);} } 1.4 repeat 图片平铺 class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(// alignment: Alignment.centerRight, //位置height: 300,width: 500,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,// scale: 2,//缩放// alignment: Alignment.centerLeft, //位置// fit: BoxFit.fitWidth, //图片fit属性 宽度充满repeat: ImageRepeat.repeatX, //X轴平铺),),);} } 1.4.1 repeatX轴\Y轴都平铺 class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(// alignment: Alignment.centerRight, //位置height: 300,width: 500,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,// scale: 2,//缩放// alignment: Alignment.centerLeft, //位置// fit: BoxFit.fitWidth, //图片fit属性 宽度充满repeat: ImageRepeat.repeat, //X轴\Y轴都平铺),),);} } 1.5. 实现圆角图片 1.5.1 Container 实现圆角图片 import package:flutter/material.dart;void main() {runApp(MaterialApp(home: Scaffold(appBar: AppBar(title: Text(sss)),body: Column(children: [MyApp2(), SizedBox(height: 20), Circular()]),),),); }class MyApp2 extends StatefulWidget {overrideStateStatefulWidget createState() {return MyAppState();} }class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(// alignment: Alignment.centerRight, //位置height: 300,width: 300,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,// scale: 2,//缩放// alignment: Alignment.centerLeft, //位置// fit: BoxFit.fitWidth, //图片fit属性 宽度充满repeat: ImageRepeat.repeat, //X轴\Y轴都平铺),),);} }//实现一个圆形图片 class Circular extends StatelessWidget {overrideWidget build(BuildContext context) {return Container(margin: EdgeInsets.fromLTRB(0, 10, 0, 0),height: 300,width: 300,decoration: BoxDecoration(color: Colors.yellow,borderRadius: BorderRadius.circular(150),image: DecorationImage(image: NetworkImage(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,),fit: BoxFit.cover,),),);} }1.5.2 Container circular 圆角参数设置 borderRadius: BorderRadius.circular(10)//圆角 1.6.1 使用ClipOval使用实现一个圆形图片 import package:flutter/material.dart;void main() {runApp(MaterialApp(home: Scaffold(appBar: AppBar(title: Text(sss)),body: Column(children: [MyApp2(),SizedBox(height: 20),Circular(),SizedBox(height: 30),ClipImage(),],),),),); }class MyApp2 extends StatefulWidget {overrideStateStatefulWidget createState() {return MyAppState();} }class MyAppState extends StateMyApp2 {overrideWidget build(BuildContext context) {return Center(child: Container(// alignment: Alignment.centerRight, //位置height: 150,width: 150,decoration: BoxDecoration(color: Colors.yellow),child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,// scale: 2,//缩放// alignment: Alignment.centerLeft, //位置// fit: BoxFit.fitWidth, //图片fit属性 宽度充满repeat: ImageRepeat.repeat, //X轴\Y轴都平铺),),);} }//实现一个圆形图片 class Circular extends StatelessWidget {overrideWidget build(BuildContext context) {return Container(margin: EdgeInsets.fromLTRB(0, 10, 0, 0),height: 150,width: 150,decoration: BoxDecoration(color: Colors.yellow,borderRadius: BorderRadius.circular(10),image: DecorationImage(image: NetworkImage(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,),fit: BoxFit.cover,),),);} }//使用ClipOval使用实现一个圆形图片 class ClipImage extends StatelessWidget {overrideWidget build(BuildContext context) {return ClipOval(child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,width: 150,height: 150,fit: BoxFit.cover,),);} }//使用ClipOval使用实现一个圆形图片 class ClipImage extends StatelessWidget {overrideWidget build(BuildContext context) {return ClipOval(child: Image.network(https://img2.baidu.com/it/u1069891123,3492077884fm253fmtautoapp138fJPEG?w304h456,width: 150,height: 150,fit: BoxFit.cover,),);} }2.加载本地图片 2.1 要在 Flutter 中加载本地图片需要完成两个主要步骤        2.1.2 在 项目下创建images资源文件 2.1.2 在 pubspec.yaml 中配置图片资源路径 2.1.3 使用 Image.asset 或 Image 组件加载图片 //加载一个本地图片 class LocalImage extends StatelessWidget {overrideWidget build(BuildContext context) {return Container(width: 150,height: 150,child: Image.asset(images/a.png),);} }class LocalImage extends StatelessWidget {const MyApp({Key? key}) : super(key: key);overrideWidget build(BuildContext context) {return MaterialApp(home: Scaffold(appBar: AppBar(title: const Text(本地圆形图片加载示例)),body: Center(child: Column(mainAxisAlignment: MainAxisAlignment.center,children: [// 使用CircleAvatar加载圆形图片CircleAvatar(radius: 100,backgroundImage: AssetImage(images/profile.png),),const SizedBox(height: 30),// 使用ClipOval自定义圆形图片ClipOval(child: Image.asset(images/background.jpg,width: 200,height: 200,fit: BoxFit.cover,),),const SizedBox(height: 30),// 使用Container的decoration属性Container(width: 150,height: 150,decoration: BoxDecoration(shape: BoxShape.circle,image: DecorationImage(image: AssetImage(images/icon.png),fit: BoxFit.cover,),),),],),),),);} }
http://www.zqtcl.cn/news/617230/

相关文章:

  • 中国通信建设协会网站新手建网站教程
  • 做网站页面的需要哪些技巧wordpress 网址导航
  • 如何做美食网站设计广州网页设计招聘
  • 中国商标网商标查询官方网站页面模板怎么添加文章
  • 建设基础化学网站的经验如何建设网站pdf下载
  • 外贸公司网站设计公司做网站能挣钱不
  • 免费网站ppt模板下载济南建设网站公司
  • 网站建设技术托管免费空间域名注册免备案
  • 威海住房建设部官方网站专科网站开发就业方向
  • 做外贸网站多少钱成都网页设计专业
  • 北京比较好的网站公司在线医生免费咨询
  • 免费的个人网站怎么做企业网站管理系统软件
  • 枣庄住房和城乡建设局网站如何注册国外域名
  • 满洲里建设局网站网页设计公司的目标客户有哪些
  • 英文书 影印版 网站开发怀化组织部网站
  • 网站建设领域的基本五大策略要学会网站细节
  • dede做英文网站优化cms建站系统哪个好
  • eclipse sdk做网站邯郸技术服务类
  • 汕头网站网站建设西安网约车租车公司哪家好
  • 网站空间域名维护协议网络推广软件平台
  • 昆明网站建设公司猎狐科技怎么样wordpress主题打不开
  • 网站推广入口服饰网站建设 e-idea
  • 长沙网站建设电话2个女人做暧暧网站
  • 手机手机端网站建设电子商务网站建设步骤一般为
  • 上海金瑞建设集团网站怎样登陆网站后台
  • 定西模板型网站建设网络架构和现实架构的差异
  • 做搜索的网站做网站的代码有哪些
  • 视频制作网站推荐js做音乐网站
  • 海北wap网站建设公司有后台网站怎么做
  • 织梦网站最新漏洞入侵外贸网站模板有什么用