File tree 1 file changed +20
-12
lines changed 1 file changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -275,24 +275,32 @@ class ChooseAccountPage extends StatelessWidget {
275
275
}
276
276
}
277
277
278
- enum ChooseAccountPageOverflowMenuItem { aboutZulip }
279
-
280
278
class ChooseAccountPageOverflowButton extends StatelessWidget {
281
279
const ChooseAccountPageOverflowButton ({super .key});
282
280
283
281
@override
284
282
Widget build (BuildContext context) {
285
- return PopupMenuButton <ChooseAccountPageOverflowMenuItem >(
286
- itemBuilder: (BuildContext context) => const [
287
- PopupMenuItem (
288
- value: ChooseAccountPageOverflowMenuItem .aboutZulip,
289
- child: Text ('About Zulip' )),
290
- ],
291
- onSelected: (item) {
292
- switch (item) {
293
- case ChooseAccountPageOverflowMenuItem .aboutZulip:
283
+ final designVariables = DesignVariables .of (context);
284
+ final materialLocalizations = MaterialLocalizations .of (context);
285
+ return MenuAnchor (
286
+ menuChildren: [
287
+ MenuItemButton (
288
+ onPressed: () {
294
289
Navigator .push (context, AboutZulipPage .buildRoute (context));
295
- }
290
+ },
291
+ child: const Text ('About Zulip' )), // TODO(i18n)
292
+ ],
293
+ builder: (BuildContext context, MenuController controller, Widget ? child) {
294
+ return IconButton (
295
+ tooltip: materialLocalizations.showMenuTooltip, // "Show menu"
296
+ onPressed: () {
297
+ if (controller.isOpen) {
298
+ controller.close ();
299
+ } else {
300
+ controller.open ();
301
+ }
302
+ },
303
+ icon: Icon (Icons .adaptive.more, color: designVariables.icon));
296
304
});
297
305
}
298
306
}
You can’t perform that action at this time.
0 commit comments