flutter_multi_chip_select 0.1.1

Flutter Android iOS

A simple and versatile multiple chip select component for App developers, with different style.

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final multiSelectKey = GlobalKey<MultiSelectDropdownState>();
  String _result = "";
  var menuItems = [1, 2, 3, 4, 5, 6];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: <Widget>[
            Center(
              child: Row(
                children: <Widget>[
                  Expanded(
                    child: FlutterMultiChipSelect(
                      key: multiSelectKey,
                      elements: List.generate(
                        menuItems.length,
                        (index) => MultiSelectItem<String>.simple(
                            actions: [
                              IconButton(
                                icon: Icon(Icons.delete),
                                onPressed: () {
                                  setState(() {
                                    menuItems.remove(menuItems[index]);
                                  });
                                  print("Delete Call at: " + menuItems[index].toString());
                                },
                              )
                            ],
                            title: "Item " + menuItems[index].toString(),
                            value: menuItems[index].toString()),
                      ),
                      label: "Dropdown Select",
                      values: [
                        1,2
                      ],
                    ),
                  ),
                  IconButton(
                    icon: Icon(Icons.save),
                    onPressed: () {
                      setState(() {
                        _result =
                            this.multiSelectKey.currentState.result.toString();
                      });
                    },
                  ),
                ],
              ),
            ),
            Text((_result != "") ? "Save Result" + _result : "")
          ],
        ),
      ),
    );
  }
}
4
likes
80
pub points
67%
popularity

A simple and versatile multiple chip select component for App developers, with different style.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

abhinav.jha58@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_multi_chip_select