flutter - 如何将浮动动作粘贴到底部颤动(底部对齐)
问题描述
我想要一个没有任何填充或任何东西的 FAB 粘在屏幕底部。但还没有看到正确的小部件。我不喜欢使用堆栈。有什么建议么?
解决方案
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: Padding(
padding: const EdgeInsets.all(12.0),
child: CustomMaterialButton(
color: Colors.green,
icon: Icons.check,
text: 'Apply',
onTap: () {},
iconPosition: IconPosition.LEFT,
),
),
按钮
Material(
elevation: 8,
shadowColor: this.color,
borderRadius: BorderRadius.circular(4),
color: this.color,
child: InkWell(
highlightColor: Colors.transparent,
onTap: this.onTap,
child: Container(
width: double.infinity,
height: 48,
child: Center(
child: this.iconPosition == IconPosition.LEFT
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
this.icon != null
? Icon(
this.icon,
color: Colors.white,
semanticLabel: 'a',
)
: Container(),
AutoSizeText(
' ${this.text}',
textScaleFactor: 1,
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, fontSize: 18,
fontFamily: 'Muli'),
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AutoSizeText(
' ${this.text}',
textScaleFactor: 1,
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, fontSize: 18,
fontFamily: 'Muli'),
),
this.icon != null
? Icon(
this.icon,
semanticLabel: 'a',
color: Colors.white,
)
: Container(),
],
),
),
),
),
);
推荐阅读
- python - 打印未执行
- python - Python合并csv文件问题处理和重复的单元格部分
- python - KeyError:“[索引([('A','B','C')],dtype ='object')]都没有在[列]中
- amazon-s3 - S3 / COS:使用 IBM Cloud 配置的 rclone 身份验证失败
- python - 不和谐.py | 我可以在命令名中有空格吗?
- html - 从 Express NodeJS 中的选中复选框中获取所有“名称”属性
- angular - 角表排序,没有角材料
- python - Python 正则表达式:从字符串中提取体积(mL)
- java - 在其他应用程序之上创建按钮并使用 OnClickListener 的服务
- c# - 在进行 WCF https 调用时,Flutter Web 出现“XMLHttpRequest”错误