Is it possible to move the floatingActionButton
up by 50 pixels?
I have a floatingActionButton
in an App that uses firebase_admob
and the Ads Banner is overlapping on top of the floatingActionButton
.
How does one set the floatingActionButton
to be 50 pixels from the bottom of the screen?
From the documentation of floatingActionButton
I can not seem to pick out how to position the button.
Wrap your FloatingActionButton
inside a Padding and add the size you want:
floatingActionButton: Padding( padding: const EdgeInsets.only(bottom: 50.0), child: FloatingActionButton( child: Icon(Icons.remove), onPressed: () => null, ), ),
It's simple.
class Test extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: Container(), floatingActionButton: Align( child: FloatingActionButton(onPressed: null), alignment: Alignment(1, 0.7)), ); } }
Use Alignment, as everything is a Widget in Flutter.
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