I've added a BottomAppBar
to scaffold in a materialApp, and to that I've added a fab with a inset at the center. The code looks somewhat like this
Scaffold(
bottomNavigationBar: BottomAppBar(
color: Theme.of(context).accentColor,
shape: CircularNotchedRectangle(),
child: _buildBottomBar(context),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: FloatingActionButton(
backgroundColor: Theme.of(context).primaryColor,
child: Center(
child: Icon(
Icons.add,
size: 32.0,
),
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => CreateEvent()),
);
},
),
)
And this is what I'm getting after rendering:
The notch is not transparent, and the content behind it is getting hidden.
Is there a way to fix this? Something I might have missed?
The new floating action button should be 56dp x 56dp and the icon inside it should be 24dp x 24dp.
By default, the shape of the floating action button (FAB) in the flutter is circular and the location is bottom right floated. You can change the location and shape of the floating action button using properties in Scaffold() widget class and FloatingActionButton() widget class.
How to Disable Button in Flutter. To disable button in Flutter, just assign the null value to the onPressed parameter of the Button.
You just need to be on the flutter channel: master and then add to Scaffold:
Scaffold(
extendBody: true
);
and it should be transparent :)
Greets
Rebar
UPDATE:
You don't need to be on master channel. It's included everywhere :)
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