How do create a floating button and animate different options on its button press in Flutter? I am trying to make something like below:
When I try to add multiple floating buttons, I get 'argument for the name floating button action has already been specified
' error
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
),
);
}
or animate floating options like this