multiple_select 0.1.22

  • Readme
  • Changelog
  • Example
  • Installing
  • 82

multiple_select #

License Pub

A versatile and beautiful multi-drop-down component for App developers.🚀

Getting Started #

dependencies:
 multiple_select: ^0.1.22

Usage example #

Matching query and Multiple select #

List<Item<num, String, String>> items = List.generate(
  150,
      (index) =>
      Item.build(
        value: index,
        display: '$index display',
        content: '$index content' * (index + 1),
      ),
);

List<num> _initValue = [1, 2, 6];

MultiFilterSelect(
          allItems: items,
          initValue: _initValue,
          selectCallback: (List selectedValue) => print(selectedValue.length),
        )

/// Simulate 15 data
List<MultipleSelectItem> elements = List.generate(
  15,
  (index) => MultipleSelectItem.build(
    value: index,
    display: '$index display',
    content: '$index content',
  ),
);

List _selectedValues = [];

MultipleDropDown(
          placeholder: '请选择',
          disabled: false,
          values: _selectedValues,
          elements: elements,
        )

Contribute #

We would ❤️ to see your contribution!

License #

Distributed under the MIT license. See LICENSE for more information.

About #

Created by Shusheng.

[0.1.0] - 2019/07/05.

  • init.

[0.1.1] - 2019/07/05.

  • add .

[0.1.2] - 2019/07/08.

  • free style.

[0.1.3] - 2019/07/08.

  • from json.

[0.1.4] - 2019/07/09.

  • Support Default Values.

[0.1.5] - 2019/07/09.

  • Support Disable.

[0.1.8] - 2019/07/09.

  • deserialization.

[0.1.9] - 2019/07/09.

  • deserialization.

[0.1.10] - 2019/07/11.

  • update style.

[0.1.11] - 2019/07/11.

  • update style.

[0.1.12] - 2019/08/02.

  • update style.

[0.1.13] - 2019/10/15.

  • update style.

[0.1.14] - 2019/10/15.

  • update style.

[0.1.15] - 2019/11/07.

  • filter select.

[0.1.16] - 2019/11/08.

  • add a config to disabled the component.

[0.1.17] - 2019/11/08.

  • display.

[0.1.18] - 2019/11/08.

  • update.

[0.1.19] - 2019/11/08.

  • update.

[0.1.20] - 2019/11/08.

  • update style.

[0.1.21] - 2019/11/11.

  • fix a bug.

[0.1.22] - 2019/11/11.

  • fix a bug.

example/README.md

multiple_select_example #

import 'package:flutter/material.dart';
import 'package:multiple_select/multiple_select.dart';
import 'package:multiple_select/multiple_select_item.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Multiple Select Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Multiple Select Demo Page'),
        ),
        body: Builder(
          builder: (context) => MaterialButton(
            onPressed: () {
              MultipleSelect.showMultipleSelector(
                context,
                dataList: List.generate(15, (index) => MultipleSelectItem.build(value: index, display: '第$index项显示内容', content: '第$index项下拉内容')),
              ).then((selectedList) {
                if (selectedList != null) selectedList.forEach((item) => print(item.display));
              });
            },
            color: Colors.deepOrange,
            child: Icon(Icons.blur_on),
          ),
        ),
      ),
    );
  }
}

import 'package:flutter/material.dart';
import 'package:multiple_select/multiple_select.dart';

import 'package:multiple_select/multi_drop_down.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => MyAppState();
}

List<MultipleSelectItem> elements = List.generate(15, (index) => MultipleSelectItem.build(value: index, display: '$index display', content: '$index content'));

class MyAppState extends State<MyApp> {
  List _values = [];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Multiple Select Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Multiple Select Demo Page'),
        ),
        body: MultipleDropDown(
          placeholder: '请选择',
          disabled: false,
          values: _values,
          elements: elements,
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  multiple_select: ^0.1.22

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:multiple_select/multiple_select.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]
82
Learn more about scoring.

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

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/multi_drop_down.dart.

Run flutter format to format lib/multi_drop_down.dart.

Format lib/multi_filter_select.dart.

Run flutter format to format lib/multi_filter_select.dart.

Format lib/multi_filter_select_page.dart.

Run flutter format to format lib/multi_filter_select_page.dart.

Format lib/multiple_select.dart.

Run flutter format to format lib/multiple_select.dart.

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 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test