flutter_popup_menu_button 0.0.1+3 copy "flutter_popup_menu_button: ^0.0.1+3" to clipboard
flutter_popup_menu_button: ^0.0.1+3 copied to clipboard

outdated

A Customizable popup menu button.

FlutterPopupMenuButton. #

FlutterPopupMenuButton is a widget used for a customizable popup menu button

Features #

<html>
<body>
<p>
    FlutterPopupMenuButton provides you a complete customizable popup menu button.<br>
    In this package you have control of almost each and every thing like where to show the menu,how much to shift menu on x and y axis and giving fixed height to menu.<br>
    It has <b>MenuDirection</b> enum to set your menu direction.
</p>
</body>
</html>
enum MenuDirection{
  left,
  right,
  top,
  bottom,
  center,
  none
}
<html>
<body>
You can even draw custom shape for your menu using <b>CustomPainter</b> class and provide painter to named parameter customPainter in <b>FlutterPopupMenuButton</b> widget. <br>
<br>
<img src="example/img1.png" height="200" width="150">
</body>
</html>

Getting started #

Just add dependency to your pubspec.yaml and you can start using the package.

dependencies:
    flutter:
        sdk: flutter

        flutter_popup_menu_button:
class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: SafeArea(
        child: Scaffold(
          body: Align(
            alignment: Alignment.topLeft,
            child: FlutterPopupMenuButton(
              direction: MenuDirection.right,
              decoration: const BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(20)),
                  color: Colors.white
              ),
              popupMenuSize: const Size(160,200),
              child: FlutterPopupMenuIcon(
                key: GlobalKey(),
                child: Icon(Icons.more_vert),
              ),
              children: [
                FlutterPopupMenuItem(
                    closeOnItemClick: false,
                    child: ListTile(
                      title: const Text('List 1'),
                      leading: Container(
                        height: 20,
                        width: 20,
                        decoration: BoxDecoration(
                            color: Colors.redAccent.withOpacity(0.3),
                            shape: BoxShape.circle
                        ),
                      ),
                    )),
                FlutterPopupMenuItem(
                    closeOnItemClick: false,
                    child: ListTile(
                      title: const Text('List 2'),
                      leading: Container(
                        height: 20,
                        width: 20,
                        decoration: BoxDecoration(
                            color: Colors.green.withOpacity(0.3),
                            shape: BoxShape.circle
                        ),
                      ),
                    )),
                FlutterPopupMenuItem(
                    child: ListTile(
                      title: const Text('List 3'),
                      leading: Container(
                        height: 20,
                        width: 20,
                        decoration: BoxDecoration(
                            color: Colors.blue.withOpacity(0.3),
                            shape: BoxShape.circle
                        ),
                      ),
                    )),
                FlutterPopupMenuItem(
                    child: ListTile(
                      title: const Text('List 4'),
                      leading: Container(
                        height: 20,
                        width: 20,
                        decoration: BoxDecoration(
                            color: Colors.cyanAccent.withOpacity(0.3),
                            shape: BoxShape.circle
                        ),
                      ),
                    ))
              ],
            ),
          ),
        ),
      ),
    );
  }




}
13
likes
0
pub points
81%
popularity

Publisher

unverified uploader

A Customizable popup menu button.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_popup_menu_button