In Flutter I have an Focus Menu from the following package: https://pub.dev/packages/focused_menu/install. I have the latest version and the code looks alright. The problem however is that it works on both IOS and android emulators, but it doesn't work on my or my friends Iphones. The Focused menu is displayed but the items are empty and do not contain any text or icons.
List<FocusedMenuItem>? createLanguages() {
List<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;
}
Where the createLanguages is used below:
FocusedMenuHolder(
child: Image.asset(
country_flags[whichFlag],
package: 'country_icons',
width: 1.25 * AppBar().preferredSize.height,
height: 1.25 * AppBar().preferredSize.height,
),
menuItems: createLanguages()!,
onPressed: () {
},
openWithTap: true,
)
I also tried to do it directly in the FocusedMenuHolder but that dit not work also.Picture of FocuesMenuHolder with empty items
FocusedMenuHolder(
child: Image.asset(
country_flags[whichFlag],
package: 'country_icons',
width: 1.25 * AppBar().preferredSize.height,
height: 1.25 * AppBar().preferredSize.height,
),
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 for your time :)