mk_drop_down_menu 1.1.0 copy "mk_drop_down_menu: ^1.1.0" to clipboard
mk_drop_down_menu: ^1.1.0 copied to clipboard

Tap a widget wrapped with MKDropDownMenu to show a drop down menu. The header and menu are completely customizable.

MKDropDownMenu #

Tap a widget wrapped with MKDropDownMenu to show a drop down menu. The header and menu are completely customizable.

Features #

  • Completely Customizable: Header and Menu.
  • Auto show below the Header Widget.
  • Using Controller to build complex Menu.

Demo #

Usage #

Basic #

MKDropDownMenu(
  headerBuilder: (bool menuIsShowing) {
    
  },
  menuBuilder: () {
    
  },
)

Complex #

class CustomDropDownMenuController extends MKDropDownMenuController {
  int curSelectedIndex = 0;
}

MKDropDownMenu<CustomDropDownMenuController>(
  controller: CustomDropDownMenuController(),
  headerBuilder: (bool menuIsShowing) {
    
  },
  menuBuilder: () {
    
  },
),

Issue #

Before version of 1.0.4, this plugin doesn't immediately hide menu when user press 'Physics Return' on Android.

In the version of 1.0.4, we use WillPopScope to solve this issue. However, this solution would disable Swipe Back Gesture on IOS.

Therefore, In the version of 1.1.0, we the following code (see in source code) to solve this issue:

if (Platform.isIOS) {
  return child;
} else {
  return WillPopScope(
    onWillPop: () {
      _hideMenu();
      return Future.value(true);
    },
    child: child,
  );
}

If your app also enable Swipe Back Gesture on Android, we suggest u modify this plugin╮(╯_╰)╭

6
likes
40
pub points
1%
popularity

Publisher

verified publishermalikwang.com

Tap a widget wrapped with MKDropDownMenu to show a drop down menu. The header and menu are completely customizable.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on mk_drop_down_menu