Wednesday, October 28, 2026
HomeiOS Developmentandroid - Flutter centered menu working in emulator however not working in...

android – Flutter centered menu working in emulator however not working in actual deivce

[ad_1]

In Flutter I’ve an Focus Menu from the next bundle: https://pub.dev/packages/focused_menu/set up. I’ve the most recent model and the code seems alright. The issue nevertheless is that it really works on each IOS and android emulators, nevertheless it would not work on my or my pals Iphones. The Centered menu is displayed however the gadgets are empty and don’t comprise any textual content or icons.

  Record<FocusedMenuItem>? createLanguages() {
    Record<FocusedMenuItem> languages = [
      FocusedMenuItem(title: Text("Share"),trailingIcon: Icon(Icons.share) ,onPressed: (){}),
      FocusedMenuItem(title: Text("Share2"),trailingIcon: Icon(Icons.share) ,onPressed: (){}),
      FocusedMenuItem(title: Text("Share3"),trailingIcon: Icon(Icons.share) ,onPressed: (){}),
    ];
    return languages;
  }

The place the createLanguages is used beneath:

              FocusedMenuHolder(
                baby: Picture.asset(
                  country_flags[whichFlag],
                  bundle: 'country_icons',
                  width: 1.25 * AppBar().preferredSize.peak,
                  peak: 1.25 * AppBar().preferredSize.peak,
                ),
                menuItems: createLanguages()!,
                onPressed: () {
                  },
                openWithTap: true,
              )

I additionally tried to do it instantly within the FocusedMenuHolder however that dit not work additionally.Image of FocuesMenuHolder with empty gadgets

FocusedMenuHolder(
                baby: Picture.asset(
                  country_flags[whichFlag],
                  bundle: 'country_icons',
                  width: 1.25 * AppBar().preferredSize.peak,
                  peak: 1.25 * AppBar().preferredSize.peak,
                ),
                menuItems: <FocusedMenuItem>[
                  FocusedMenuItem(title: Text("Share"),trailingIcon: Icon(Icons.share) ,onPressed: (){}),
                  FocusedMenuItem(title: Text("Share2"),trailingIcon: Icon(Icons.share) ,onPressed: (){}),
                  FocusedMenuItem(title: Text("Share3"),trailingIcon: Icon(Icons.share) ,onPressed: (){}),
                ],
                onPressed: () {
                  },
                openWithTap: true,
              )

Thanks on your time 🙂

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments