GithubHelp home page GithubHelp logo

mdpe-ir / flutter-package-selection_menu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hussaintaj-w/flutter-package-selection_menu

0.0 0.0 0.0 4.37 MB

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

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

License: MIT License

Dart 100.00%

flutter-package-selection_menu's Introduction

selection_menu

A highly customizable selection/select menu to choose an item from a list, with optional search feature.

Getting Started

The package provides two libraries:

  • selection_menu: Provides Widgets
  • components_configurations: Provides styles(ComponentsConfigurations) for Widgets

The image shows the same SelectionMenu Widget with three different ComponentsConfigurations.

Select Menu in different styles

Basic Usage

import 'package:selection_menu/selection_menu.dart';

SelectionMenu<String>(
    itemsList: <String>['A','B','C'],
    onItemSelected: (String selectedItem)
    {
    print(selectedItem);
    },
    itemBuilder: (BuildContext context, String item, OnItemTapped onItemTapped)
    {
       return Material(
         InkWell(
           onTap: onItemTapped,
           child: Text(item),
         ),
       ); 
    },
    // other Properties...
);

Using A ComponentsConfiguration

import 'package:selection_menu/selection_menu.dart';

// IMPORT this package to get access to configuration classes.
import 'package:selection_menu/components_configurations.dart';

SelectionMenu<String>(
  itemsList: <String>['A','B','C'],
  onItemSelected: (String selectedItem)
  {
    print(selectedItem);
  },
  itemBuilder: (BuildContext context, String item, OnItemTapped onItemTapped)
  {
    return Material(
      InkWell(
        onTap: onItemTapped,
        child: Text(item),
      ),
    );
  },
  componentsConfigurations: DropdownComponentsConfigurations<String>(),
);

Customization

The menu is divided into parts called Components which allows to change one part while the others remain intact.

A ComponentsConfiguration is simply a container for all Components and configurations.

Reading the examples is recommended because there are a lot of things to cover and an intro page shouldn't be that long.

Examples

A series of examples can be found here.

Contributions

You may make changes and open pull requests on GitHub. :)

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.