Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InAppBrowserMenuItem with icon and showAsAction set to true not rendered correctly #2497

Open
1 of 2 tasks
sDobrzanski opened this issue Jan 11, 2025 · 0 comments
Open
1 of 2 tasks
Labels
bug Something isn't working

Comments

@sDobrzanski
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

iOS.
When adding InAppBrowserMenuItem with icon as Unit8List and showAsAction set to true, menu item on top toolbar is not rendered correctly. There is just a shape of it in one color (color can be changed by param iconColor). If i set showAsAction to false menu item is rendered correctly but its visible only when user clicks additional toolbar button.
The same applies if I pass UIImage(data: data) to icon.

Expected Behavior

Menu Item on top toolbar should be rendered according to passed data.

Steps with code example to reproduce

Steps with code example to reproduce
  late final _browserIn = InAppBrowser();

  @override
  void initState() {
    //Not rendered correctly
    _browserIn.addMenuItem(InAppBrowserMenuItem(
      id: 0,
      title: '0',
      order: 0,
      icon: widget.iconData, //Unit8List
      showAsAction: true,
      onClick: () {
        Clipboard.setData(ClipboardData(text: widget.couponDetails.couponCode));
      },
    ));
    //Not rendered correctly
    _browserIn.addMenuItem(InAppBrowserMenuItem(
      id: 1,
      title: '1',
      order: 1,
      icon: UIImage(data: widget.iconData),
      showAsAction: true,
      onClick: () {
        Clipboard.setData(ClipboardData(text: widget.couponDetails.couponCode));
      },
    ));
    //Rendered correctly but it gets visible after clicking default toolbar action button (...)
    _browserIn.addMenuItem(InAppBrowserMenuItem(
      id: 2,
      title: '2',
      order: 2,
      icon: widget.iconData,
      showAsAction: false,
      onClick: () {
        Clipboard.setData(ClipboardData(text: widget.couponDetails.couponCode));
      },
    ));
    super.initState();
  }

Stacktrace/Logs

Not applicable

Flutter version

3.27.1

Operating System, Device-specific and/or Tool

ios 17.5

Plugin version

6.1.5

Additional information

No response

Self grab

  • I'm ready to work on this issue!
@sDobrzanski sDobrzanski added the bug Something isn't working label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant