【发布时间】:2019-01-28 04:42:19
【问题描述】:
如何在 Flutter 中创建一个浮动按钮并在其按钮按下时为不同的选项设置动画?我正在尝试制作如下内容:
当我尝试添加多个浮动按钮时,出现“argument for the name floating button action has already been specified”错误
class MyBills extends StatelessWidget {
MyBills({Key key}) : super(key: key);
//@override
//MyBillsPageState createState() => MyBillsPageState();
@override
Widget build(BuildContext context) {
return new Scaffold(
body: ListView.builder(
itemCount: 20,
itemBuilder: (context, index) {
return new Container(height: 100, child: BillItem());
}
),
floatingActionButton: new FloatingActionButton(
child: new Icon(Icons.add),
heroTag: 1,
onPressed: _addAttachment
),
floatingActionButton: new FloatingActionButton(
child: new Icon(Icons.camera),
heroTag: 2,
onPressed: _cameraAttachment
),
);
}
或动画浮动选项like this
【问题讨论】:
-
fab_dialer 是您想要的吗?这里还有a version,它不使用包。
-
是的..明白了..!