Popup Menu Customization in Flutter | by Gajendra Pandeya | Feb, 2022

Do extra than simply dropdown

Photograph by Clark Tibbs on Unsplash

Desk of Contents

  1. Introduction
  2. Popup Menu Button Constructor
  3. Creating Regular Popup Menu
  4. Customizing Menu Button in line with our want

Popup menus are one of the used widgets that show a menu when pressed and calls onselected when the menu is dismissed as a result of an merchandise was chosen. Consider it as once you right-click your mouse, you see a listing of menu gadgets corresponding to view, type by, refresh, and …

PopupMenuButton(Key? key, required PopupMenuItemBuilder<T> itemBuilder, T? initialValue, PopupMenuItemSelected<T>? onSelected, PopupMenuCanceled? onCanceled, String? tooltip, double? elevation, EdgeInsetsGeometry padding = const EdgeInsets.all(8.0), Widget? baby, Widget? icon, double? iconSize, Offset offset = Offset.zero, bool enabled = true, ShapeBorder? form, Color? colour, bool? enableFeedback)

Generally, we can be utilizing a popup menu as trailing widget in our appbar. We will even accomplish that however can be utilized anyplace, the tactic will stay the identical.

Now our want is to place PopupMenu beneath the appbar and it ought to have some rounded nook form. To attain that, we are going to provide the property named offset contained in the PopupMenuButton that expects x and y coordinates.

More Posts