Coder Social home page Coder Social logo

stevenosse / multi_select_form_field Goto Github PK

View Code? Open in Web Editor NEW
12.0 0.0 1.0 422 KB

A flutter dropdown button Widget allowing one to choose multiple elements.

License: Other

Dart 100.00%
dart flutter flutter-widget flutter-widgets dart-lang flutter-ui flutter-package

multi_select_form_field's Introduction

Multi Select Form Field

A dropdown button Widget allowing one to choose multiple elements.

Install

Add these line under your dependencies section:

    multiselect_form_field:
        git:
            url: https://github.com/stevenosse/multi_select_form_field.git
            ref: master

Demo

alt text

Features

  • Regular widget
  • Very simple to implement
  • Can retrieve the list of selected elements
  • Build custom list elements
  • Can retrieve the list of unselected elements

Example

MultiSelectFormField(
    key: _multiSelectKey,
    tagColor: Colors.blue,
    elementList: List.generate(
        15,
        (index) => MultiSelectFormFieldItem(
            labelStyle: TextStyle(fontWeight: FontWeight.w600),
            leading: CircleAvatar(),
            label: "Test $index",
            value: "test",
            isSelected: index.isEven,
        ),
    ),
),

Retrieve more parameters

Give a Key to the widget, declared like :

    final GlobalKey<MultiSelectFieldState> _multiSelectKey = GlobalKey();`
    

And then :

    var selectedElements = _multiSelectKey.currentState.selectedElements; // Retrieve all the selected elements
    var unselectedElements = _multiSelectKey.currentState.unselectedElements; // Retrieve all the unselected elements

Contribute

Every contributions are welcomed

multi_select_form_field's People

Contributors

stevenosse avatar

Stargazers

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

Forkers

airalpha

multi_select_form_field's Issues

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.