Flutter基础widgets教程-FloatingActionButton篇
1 FloatingActionButton
FloatingActionButton(FAB) 控件是一个纸墨设计中定义的 FAB 按钮。用来显示界面上的主要功能。
2 构造函数
FloatingActionButton({
Key key,
this.child,
this.tooltip,
this.foregroundColor,
this.backgroundColor,
this.heroTag = const _DefaultHeroTag(),
this.elevation = 6.0,
this.highlightElevation = 12.0,
@required this.onPressed,
this.mini = false,
this.shape = const CircleBorder(),
this.clipBehavior = Clip.none,
this.materialTapTargetSize,
this.isExtended = false,
})
3 常用属性
3.1 child:FAB 中的子 Widget
child:Text("Flutter Demo"),
3.2 tooltip: 长按 FAB 所显示的提示文字
tooltip: "按这么长时间干嘛",
3.3 foregroundColor:FAB 的前景色
foregroundColor: Colors.red,
3.4 backgroundColor:FAB 的背景颜色
backgroundColor: Colors.red,
3.5 mini: 只能 FAB 样式是默认样式还是迷你样式
mini: true,
3.6 elevation:未点击时阴影值
elevation: 6.0,
3.7 highlightElevation:点击下阴影值
highlightElevation: 12.0,
本文来自「青年码农」公众号,作者:青年码农,转载请注明原文链接:https://www.cnblogs.com/nmgwap/p/16331682.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」