Skip to content

Instantly share code, notes, and snippets.

@Maverick-I0
Created August 25, 2020 08:07
Show Gist options
  • Select an option

  • Save Maverick-I0/d4293d1b86b3ffe473e237cc54ec14d0 to your computer and use it in GitHub Desktop.

Select an option

Save Maverick-I0/d4293d1b86b3ffe473e237cc54ec14d0 to your computer and use it in GitHub Desktop.
Top menu bar in Flutter with menu icon and Profile Icon
class TopMenu extends StatefulWidget {
_TopMenuState createState() => _TopMenuState();
}
class _TopMenuState extends State<TopMenu> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(0.0, 35.0, 0.0, 0.0),
height: 80.0,
alignment: Alignment.topCenter,
child: Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 50,
width: 50,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.black.withOpacity(0.8),
blurRadius: 6.5,
spreadRadius: 1.0,
offset: Offset(2.0, 8.0),
)
],
),
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(10.0, 0.0, 0.0, 0.0),
child: Icon(
Icons.menu,
size: 30.0,
color: Colors.blueGrey,
),
),
Container(
height: 50,
width: 50,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.black.withOpacity(0.8),
blurRadius: 6.5,
spreadRadius: 1.0,
offset: Offset(2.0, 8.0),
)
],
),
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 0.0),
child: Icon(
Icons.person,
color: Colors.blueGrey,
size: 30.0,
),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment