Flutter Widget => FloatingActionButton

£神魔★判官ぃ 2021-09-10 07:56 405阅读 0赞

API说明:

  1. const FloatingActionButton({
  2. Key key,
  3. this.child,//按钮显示的内容
  4. this.tooltip,//长按时显示的提示
  5. this.foregroundColor,//前景色,影响到文字颜色
  6. this.backgroundColor,//背景色
  7. this.heroTag = const _DefaultHeroTag(),//hero效果使用的tag,系统默认会给所有FAB使用同一个tag,方便做动画效果
  8. this.elevation = 6.0,//未点击时阴影值
  9. this.highlightElevation = 12.0,//点击下阴影值
  10. @required this.onPressed,
  11. this.mini = false,//FloatingActionButton有regular, mini, extended三种类型,默认为false即regular类型,true时按钮变小即mini类型,extended需要通过FloatingActionButton.extended()创建,可以定制显示内容
  12. this.shape = const CircleBorder(),//定义FAB的shape,设置shape时,默认的elevation将会失效,默认为CircleBorder
  13. this.clipBehavior = Clip.none,
  14. this.materialTapTargetSize,
  15. this.isExtended = false,//是否为”extended”类型
  16. })

FloatingActionButton extended方式创建

  1. floatingActionButton: FloatingActionButton.extended(
  2. icon: Icon(Icons.alarm), label: Text("文本"), onPressed: () {},
  3. ),

发表评论

表情:
评论列表 (有 0 条评论,405人围观)

还没有评论,来说两句吧...

相关阅读

    相关 flutter Widget基础

    首先,我们先附上官网教程中关于flutter框架的介绍,作为补充。 Flutter官方提供的Flutter框架图 ![在这里插入图片描述][watermark_type_

    相关 Flutter widget目录

    这是个Flutter教学系列的文章,会从Flutter基础入门开始讲解,带领大家从零开始学习Flutter,从基础组件一个一个的过,可以保证每个没有Flutter开发基础的同学

    相关 Flutter Widget大全

    还没有做完,应该是目前最全的Widget介绍了,如果需要使用什么控件在这里找就行,如果还没有就得自定义Widget了,欢迎点赞支持我继续把图做完,这个图没什么技术含量,大部分就