随笔分类 -  每日Flutter小部件

每日Flutter小部件,来自 Flutter部件整理
摘要:/** 设置子控件透明度 const Opacity({ Key key, @required this.opacity,//透明度,0.0 到 1.0,0.0表示完全透明,1.0表示完全不透明 this.alwaysIncludeSemantics = false, Widget child, } 阅读全文

posted @ 2020-05-15 16:29 wjw334 阅读(342) 评论(0) 推荐(0)

摘要:表单 Form 引入 validation_extensions 1.0.1 三方库 使用到了Flutter 中的扩展函数 import 'package:flutter/material.dart'; import 'package:validation_extensions/validation 阅读全文

posted @ 2020-05-07 15:27 wjw334 阅读(1590) 评论(1) 推荐(0)

摘要:PhysicalModel ,主要的功能就是设置widget四边圆角,可以设置阴影颜色,和z轴高度 PhysicalModel({ //裁剪模式 this.clipBehavior = Clip.none, //四角圆度半径 this.borderRadius, //z轴高度 this.elevat 阅读全文

posted @ 2020-04-22 16:29 wjw334 阅读(1223) 评论(0) 推荐(0)

摘要:Wrap({ Key key, this.direction = Axis.horizontal,//主轴(mainAxis)的方向,默认为水平。 this.alignment = WrapAlignment.start,//主轴方向上的对齐方式,默认为start。 this.spacing = 0 阅读全文

posted @ 2020-04-20 17:51 wjw334 阅读(288) 评论(0) 推荐(0)

摘要:/** * 控制child是否显示 * 当offstage为true,控件隐藏; 当offstage为false,显示; 当Offstage不可见的时候,如果child有动画等,需要手动停掉,Offstage并不会停掉动画等操作。 const Offstage({ Key key, this.off 阅读全文

posted @ 2020-04-20 16:29 wjw334 阅读(609) 评论(0) 推荐(0)

摘要:参考:https://www.lizenghai.com/archives/48633.html const Listener({ Key key, this.onPointerDown, this.onPointerMove, this.onPointerEnter, this.onPointer 阅读全文

posted @ 2020-04-13 18:26 wjw334 阅读(654) 评论(0) 推荐(0)

摘要:滑动条 const Slider({ Key key, @required this.value, //当前值 @required this.onChanged, //改变回调 this.onChangeStart, this.onChangeEnd, this.min = 0.0, this.ma 阅读全文

posted @ 2020-03-30 21:48 wjw334 阅读(1648) 评论(0) 推荐(0)

摘要:LinearProgressIndicator & CircularProgressIndicator 条形 圆形进度条 class ProgressIndicatorWidget extends StatefulWidget { ProgressIndicatorWidget({Key key}) 阅读全文

posted @ 2020-03-26 10:02 wjw334 阅读(987) 评论(0) 推荐(0)

摘要:受限制的Box控件 const BoxConstraints({ this.minWidth = 0.0, this.maxWidth = double.infinity, this.minHeight = 0.0, this.maxHeight = double.infinity,}); clas 阅读全文

posted @ 2020-03-25 18:04 wjw334 阅读(603) 评论(0) 推荐(0)

摘要:AnimatedContainerWidget AnimatedContainer({ Key key, this.alignment, this.padding, Color color, Decoration decoration, this.foregroundDecoration, doub 阅读全文

posted @ 2020-03-24 17:58 wjw334 阅读(340) 评论(0) 推荐(0)

摘要:占位控件color: Colors.blue, // 设置占位符颜色 defalutBlue Grey 70strokeWidth: 5, //设置画笔宽度fallbackHeight: 200, //设置占位符宽度fallbackWidth: 200, //设置占位符高度 import 'pack 阅读全文

posted @ 2020-03-23 16:19 wjw334 阅读(980) 评论(0) 推荐(0)

摘要:Clip的相关组件: ClipOval: 圆形裁剪 ClipRRect: 圆角矩形裁剪 ClipRect:矩形裁剪 ClipPath: 路径裁剪 参数: clipper:裁剪路径 CustomClipper<Path> 的实现 class ClipWidget extends StatelessWi 阅读全文

posted @ 2020-03-23 14:50 wjw334 阅读(951) 评论(0) 推荐(0)

摘要:可折叠的控件 initiallyExpanded: true, 初始是否展开 class ExpansionTileWidget extends StatelessWidget { @override Widget build(BuildContext context) { return getLv 阅读全文

posted @ 2020-03-21 16:20 wjw334 阅读(845) 评论(0) 推荐(0)

摘要:动画Padding 点击之后 有动画过渡 class AnimatedPaddingWidget extends StatefulWidget { @override State<StatefulWidget> createState() => AnimatedPaddingWidgetState( 阅读全文

posted @ 2020-03-21 16:17 wjw334 阅读(655) 评论(0) 推荐(0)

摘要:FadeInImage.assetNetwork({ Key key, @required String placeholder,// @required String image, AssetBundle bundle, double placeholderScale, double imageS 阅读全文

posted @ 2020-03-18 09:17 wjw334 阅读(839) 评论(0) 推荐(0)

摘要:/** * 集成自Stack,用来显示第index个child, * IndexedStack({ Key key, AlignmentGeometry alignment = AlignmentDirectional.topStart, TextDirection textDirection, S 阅读全文

posted @ 2020-03-15 15:59 wjw334 阅读(992) 评论(0) 推荐(0)

摘要:Stack 这个是Flutter中布局用到的组件,跟Android中FrameLayout很像,都是可以叠加的现实View。 Stack({ Key key, this.alignment = AlignmentDirectional.topStart, this.textDirection, th 阅读全文

posted @ 2020-03-14 22:56 wjw334 阅读(218) 评论(0) 推荐(1)

导航