mk_drop_down_menu 1.1.0

Flutter Android iOS

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╮(╯_╰)╭

0
likes
90
pub points
43%
popularity

Publisher

malikwang.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

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on mk_drop_down_menu