button 文字与边框、间距的设置:
/*
* button 文字与边框、间距 设置
* */
class MyButtonTheme extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
ButtonTheme(
height: 10,
minWidth: 10,
child: FlatButton(
padding: EdgeInsets.all(0),
color: Colors.red,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
child: Text("测试 FlatButton 间距设置"),
textColor: Colors.green,
onPressed: (){},
),
)
],
);
}
}
ImageView 与Icon 使用
/*
* 网络图片加载,以及本地占位图位图
* */
class MYFadeInImage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final imageUrl = "https://pics6.baidu.com/feed/b999a9014c086e063365d270d06c3cf30bd1cbac.jpeg?token=bedf7f5f3a30aca56222d77e577584d6";
return FadeInImage(
fadeOutDuration: Duration(milliseconds: 1),
fadeInDuration: Duration(milliseconds: 1),
placeholder: AssetImage("assets/images/112233.jpeg"),
image: NetworkImage(imageUrl),
);
}
}
/*
* Icon 拓展
* */
class IconExtensionDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
// Icon 字体图标和图片图标
// 字体图标矢量图(放大不会失真)
// 可设置颜色
// 图标很多时,占用空间更小
// return Icon(Icons.motorcycle,size: 400,color: Colors.lightGreen,);
return Text("\ue91b",style: TextStyle(fontSize: 200,color: Colors.red,fontFamily: "MaterialIcons"),);
}
}
版权声明:本文为SHTLoveXX原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。