I want to use an overflow menu because i want to achieve this design from material 3:
Below the code I added some implementations with code in order to achieve the design from material 3
This is my code:
child: Scaffold(
appBar: AppBar(
backgroundColor: Color.fromARGB(255, 255, 202, 55),
title: ResponsiveWeb(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
padding: const EdgeInsets.only(left: 8, right: 0),
child: Row(
children: [
const Icon(
FontAwesomeIcons.checkDouble,
size: 25,
color: const Color(0xff3B3B3B),
),
Text.rich(
TextSpan(
text: ' pomo',
style: GoogleFonts.nunito(
fontSize: 25,
color: const Color(0xff3B3B3B),
fontWeight: FontWeight.w700
),
children: <TextSpan>[
TextSpan(
text: 'work',
style: GoogleFonts.nunito(
color: const Color(0xff3B3B3B),
decoration: TextDecoration.underline,
decorationThickness: 3,
fontWeight: FontWeight.w700
),
),
TextSpan(
text: 'o.com',
style: GoogleFonts.nunito(
fontSize: 25,
color: const Color(0xff3B3B3B),
fontWeight: FontWeight.w700
),
),
],
),
),
],
),
),
Container(
padding: const EdgeInsets.only(left: 8, right: 0),
child: Row(
children: [
Tooltip(
message: 'Daily goals',
child: Semantics(
label: 'Pomodoro timer daily goals',
enabled: true,
readOnly: true,
child: IconButton(
icon: Icon(
Icons.military_tech_outlined,
color: const Color(0xff3B3B3B),
size: 25,
semanticLabel: 'Pomodoro timer daily goals',
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
SettingsUIPomodoro()),
);
},
),
),
),
Tooltip(
message: 'Settings',
child: Semantics(
label: 'Pomodoro timer settings',
enabled: true,
readOnly: true,
child: IconButton(
icon: Icon(
Icons.settings_outlined,
color: const Color(0xff3B3B3B),
size: 25,
semanticLabel: 'Pomodoro timer Settings',
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
SettingsUIPomodoro()),
);
},
),
),
),
Tooltip(
message: 'Analytics',
child: Semantics(
label: 'Pomodoro timer Analytics',
enabled: true,
readOnly: true,
child: IconButton(
icon: Icon(
Icons.show_chart_outlined,
color: const Color(0xff3B3B3B),
size: 25,
semanticLabel: 'Pomodoro timer Analytics',
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Text('goal')),
);
},
),
),
),
Tooltip(
message: 'Profile',
child: Semantics(
label: 'Pomodoro timer Profile',
enabled: true,
readOnly: true,
child: IconButton(
icon: Icon(
Icons.face_outlined,
color: const Color(0xff3B3B3B),
size: 25,
semanticLabel: 'Pomodoro timer Profile',
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Profile()),
);
},
),
),
),
Tooltip(
message: 'More',
child: Semantics(
label: 'Pomodoro timer More',
enabled: true,
readOnly: true,
child: IconButton(
icon: Icon(
Icons.more_vert_outlined,
color: const Color(0xff3B3B3B),
size: 25,
semanticLabel: 'Pomodoro timer More',
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Profile()),
);
},
),
),
),
],
),
)
],
),
),
),
),
This is my app bar:
I want to integrate these two icons:
child: IconButton(
icon: Icon(
Icons.military_tech_outlined,
color: const Color(0xff3B3B3B),
size: 25,
semanticLabel: 'Pomodoro timer daily goals',
),
child: IconButton(
icon: Icon(
Icons.show_chart_outlined,
color: const Color(0xff3B3B3B),
size: 25,
semanticLabel: 'Pomodoro timer Analytics',
),
Inside this icon like the example from material 3 (the screenshot):
child: IconButton(
icon: Icon(
Icons.more_vert_outlined,
color: const Color(0xff3B3B3B),
size: 25,
semanticLabel: 'Pomodoro timer More',
),
Thanks for any help you can provide
2
Answers
Here is the snippet for action in an appbar,
You can archive this using
popupMenubutton
.try this your edited code: