Skip to content

Instantly share code, notes, and snippets.

@huynguyennovem
Created November 17, 2022 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huynguyennovem/6dd58a6128b1df7d5c2e144a140bdd3a to your computer and use it in GitHub Desktop.
Save huynguyennovem/6dd58a6128b1df7d5c2e144a140bdd3a to your computer and use it in GitHub Desktop.
Flutter popup menu snippet code with icon leading and hand mouse cursor when hovering.
ListTile(
trailing: PopupMenuButton<String>(
icon: const Icon(Icons.filter_alt),
padding: EdgeInsets.zero,
onSelected: (value) {},
itemBuilder: (context) => <PopupMenuEntry<String>>[
const PopupMenuItem<String>(
enabled: false,
child: ListTile(
leading: Icon(Icons.filter_list_alt),
title: Text('ORDER BY'),
),
),
PopupMenuItem<String>(
value: 'submittedTime',
child: ListTile(
mouseCursor: SystemMouseCursors.click,
leading: const Icon(Icons.timelapse),
title: const Text('Submitted time'),
onTap: () {},
),
),
PopupMenuItem<String>(
value: 'fullName',
child: ListTile(
mouseCursor: SystemMouseCursors.click,
leading: const Icon(Icons.person),
title: const Text('Name'),
onTap: () {},
),
),
// const Popup MenuDivider(),
PopupMenuItem<String>(
value: 'numBadges',
child: ListTile(
mouseCursor: SystemMouseCursors.click,
leading: const Icon(Icons.badge),
title: const Text('Number of badges'),
onTap: () {},
),
),
],
),
)
@huynguyennovem
Copy link
Author

Demo:
Screenshot 2022-11-17 at 20 03 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment