Search code examples
dartmaterial-designangular-dartfloating-action-button

How to set an action for FAB (AngularDart 5, Dart 2)


I’m trying to work with Material FAB Menu.

❔ How can I execute a method when I click an item of this menu?

Thank you!


Solution

  • The MenuItem class has an optional property called action. That accepts a function that will get called when the menu is clicked.

    new MenuItem('item1-1', tooltip: 'your tooltip', action: () => print('I was clicked')),