GithubHelp home page GithubHelp logo

hussaintaj-w / flutter-package-selection_menu Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 12.0 4.38 MB

A flutter widget, highly customizable, to select an item from a list of items.

Home Page: https://pub.dev/packages/selection_menu

License: MIT License

Dart 100.00%
flutter flutter-package menu select select-menu selection selection-menu

flutter-package-selection_menu's Introduction

Hi there ๐Ÿ‘‹

TL;DR: Want to know about me? Visit hussain.taj.contact. There's a bot there that can quickly answer questions if you have any.

flutter-package-selection_menu's People

Contributors

hussaintaj-w avatar mdpe-ir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flutter-package-selection_menu's Issues

SelectionMenu does not rebuild when the parent rebuilds

I wrapped SelectionMenu in a wrapper stateful class. The calling of setState on this wrapper did not update the trigger with the new initiallySelectedItemIndex.

Drove from: #4

class _ExampleAppState extends State<ExampleApp> {
  int selected = 0;

  @override
  Widget build(BuildContext context) {
    print('build for $selected');
    return Column(children: [
      FlatButton(
          child: Text("TEST"),
          onPressed: (){
            setState((){
              this.selected++;
              print(this.selected);
            });
          }
      ),
      Container(
        child: SelectionMenu<FlatColor>(
          componentsConfiguration:
          DialogComponentsConfiguration<FlatColor>(
            triggerComponent: TriggerComponent(builder: _triggerBuilder),
            triggerFromItemComponent: TriggerFromItemComponent<FlatColor>(
                builder: _triggerFromItemBuilder),
          ),
          itemsList: colors,
          itemBuilder: this.itemBuilder,
          onItemSelected: this.onItemSelected,
          initiallySelectedItemIndex: selected,
          showSelectedItemAsTrigger: true,
        ),
      )
    ]);
  }
}

enable menu size adaptive height

image

is there a way to set height of the menu so that it can change dynamically depending on the size of the list of items inside it?

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.