it's possible to create a float action button which open more float buttons, and If yes, can you give me a example?
Like these :
Flutter gives a named parameter
in Scaffold Widget - ‘floatingActionButton’. And the named parameter floatingActionButton
shouldn't take only FloatingActionButton
widget, it should take Widget
and it does. So you can assign another widget instead of FloatingActionButton
like as Column, Row, Stack
. And it works.
floatingActionButton: Row(
children: [
RaisedButton(child: Text('Button1'), onPressed: (){}),
RaisedButton(child: Text('Button1'), onPressed: (){}),
]
),
I just give you a reference example, it will work - you just need to customize the styles and positioning as you want. Hope it will be helpful.
Using the SpeedDial widget provided by flutter_speed_dial package you can use multiple float button as children of a parent floating action button. You can also add animated icons.
In your pubspec.yaml under dependecies, add:
dependencies:
flutter_speed_dial: ^1.2.5
Now you can use the SpeedDial widget in your FAB:
floatingActionButton: SpeedDial(
//provide here features of your parent FAB
children: [
SpeedDialChild(
child: Icon(Icons.accessibility),
label: 'First',
onTap: null,),
SpeedDialChild(
child: Icon(Icons.accessibility),
label: 'Second',
onTap: null,),
...
]
),
Try This
floatingActionButton: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
FloatingActionButton(
onPressed: getImage,
child: Icon(Icons.camera),
),
SizedBox(height: 8,),
FloatingActionButton(
onPressed: getImage,
child: Icon(Icons.camera),
),
],
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With