gpt4 book ai didi

flutter - 如何将 float Action 粘贴到底部 flutter (底部对齐)

转载 作者:IT王子 更新时间:2023-10-29 07:18:08 26 4
gpt4 key购买 nike

我想要一个没有任何填充或任何东西的粘在屏幕底部的 FAB。但还没有看到合适的小部件。我不想使用堆栈。有什么建议吗?

最佳答案

我像下面这样使用 enter image description here

 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(),
],
),
),
),
),
);

关于flutter - 如何将 float Action 粘贴到底部 flutter (底部对齐),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56667887/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com