selection_menu 0.8.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 83

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.

[0.8.1] - 5th September 2019

  • Fixed some minor broken links in docs.

[0.8.0] - 5th September 2019

  • Initial Release

example/README.md

Examples #

There is a series of detailed/brief examples available here.

These examples only focus on explaining code related to selection_menu. Flutter Widgets and their usage will not be explained here.

Flutter Resources #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  selection_menu: ^0.8.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:selection_menu/selection_menu.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
65
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
83
Learn more about scoring.

We analyzed this package on Oct 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test