In my Flutter app, I have this AppBar
Widget setAppBar(){
return new AppBar(
title: addAppBarTextWidget(\'Explore\'),
elevation: 0.0,
leading:
Complete working workaround with some input from Adrian.
return Scaffold(
key: _scaffoldKey,
appBar: AppBar(
titleSpacing: 0.0,
title: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
IconButton(
icon: Icon(Icons.menu),
onPressed: () => _scaffoldKey.currentState.openDrawer(),
),
Stack(
alignment: Alignment.center,
children: [
IconButton(
icon: Icon(Icons.mail_outline),
onPressed: _onClickNotification,
),
Positioned(
top: 12.0,
right: 10.0,
width: 10.0,
height: 10.0,
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: AppColors.notification,
),
),
)
],
),
Expanded(
child: Center(child: Text('test')),
)
],
),
automaticallyImplyLeading: false,
centerTitle: true,
actions: [
Row(
children: [
Text('Online'),
Switch(
value: true,
onChanged: (bool value) {},
)
],
)
],
),
drawer: Drawer(
child: _buildDrawer(),
),
body: Container(
color: Colors.orange,
),
);