Giter VIP home page Giter VIP logo

focused_menu's Introduction

Flutter widget to create focused menu easily ๐Ÿš€

Pub License: MIT Pub

Pub likes Pub popularity Pub points


This is an easy to implement package for adding Focused Menu to Flutter Applications


Getting Started

Fist install the dependency

Add dependency

dependencies:
  focused_menu: CURRENT_VERSION

Import package

import 'package:focused_menu/focused_menu.dart';

Usage

To Use, simply Wrap the Widget you want to add Focused Menu to, with FocusedMenuHolder:

FocusedMenuHolder(
  menuItems: <FocusedMenuItem>[
    FocusedMenuItem(
      title: Text("This is a button"),
      trailing: Icon(Icons.open_in_new),
      onPressed: () {},
    ),
  ],
  child: CircleAvatar(
    child: Image.asset("assets/images/dp_default.png"),
  ),
),

Customizations

In order to customize your focused menu you can change any of the available attributes

FocusedMenuHolder(
  menuOffset: 0,
  controller: _avatarController,
  animateMenuItems: true,
  blurBackgroundColor: Colors.pink,
  blurSize: 20,
  bottomOffsetHeight: 20,
  duration: Duration(milliseconds: 500),
  menuBoxDecoration:
      BoxDecoration(borderRadius: BorderRadius.circular(20)),
  menuItemExtent: 60,
  menuWidth: 200,
  openWithTap: true,
  enableMenuScroll: false,
  toolbarButtons: [
    ToolbarButtonItem(buttonIcon: Icon(Icons.delete,), onPressed: () {}, buttonIconColor: Colors.red),
    ToolbarButtonItem(buttonIcon: Icon(Icons.share), onPressed: () {}, buttonIconColor: Colors.blue),
  ],
  onOpened: () => print('Opened'),
  onClosed: () => print('onClosed'),
  onPressed: () {},
  menuItems: <FocusedMenuItem>[
    FocusedMenuItem(
      backgroundColor: Colors.green,
      title: Text("This is a button"),
      trailing: Icon(Icons.open_in_new),
      onPressed: () {},
    ),
  ],
  child: CircleAvatar(
    child: Image.asset("assets/images/dp_default.png"),
  ),
),

Thanks to all contributors


License

MIT

focused_menu's People

Contributors

henriquezanfa avatar ttorbik avatar letsdoit07 avatar retroportalstudio avatar peterwvj avatar dimzeta avatar ignaciotcrespo avatar dshrinath avatar sijangurung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.