Created
June 5, 2019 13:31
-
-
Save hariangr/2739c25dda72edcbc18073b907ef057a to your computer and use it in GitHub Desktop.
Docked FloatingActionButton center with BottomNavigationBar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
home: Scaffold( | |
appBar: AppBar(title: Text('Title')), | |
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, | |
floatingActionButton: | |
FloatingActionButton(child: Icon(Icons.add), onPressed: () {}), | |
bottomNavigationBar: BottomAppBar( | |
shape: CircularNotchedRectangle(), | |
child: Container( | |
height: 56, | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: <Widget>[ | |
IconButton(icon: Icon(Icons.home), onPressed: () {}), | |
IconButton(icon: Icon(Icons.search), onPressed: () {}), | |
SizedBox(width: 40), // The dummy child | |
IconButton(icon: Icon(Icons.notifications), onPressed: () {}), | |
IconButton(icon: Icon(Icons.message), onPressed: () {}), | |
], | |
), | |
)), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment