multiselect 0.0.9 copy "multiselect: ^0.0.9" to clipboard
multiselect: ^0.0.9 copied to clipboard

outdated

A simple multiselect dropdown. It provide a concise way to create a Multi Selct ComboBox/SelectBox

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Home(),
    );
  }
}

class Home extends StatefulWidget {
  const Home({Key? key}) : super(key: key);

  @override
  _HomeState createState() => _HomeState();
}

class Person {
  String name;
  String age;

  Person(this.name, this.age);
}

class _HomeState extends State<Home> {

  var people = [
    Person('A' , '1'),
    Person('B' , '2'),
    Person('C' , '3'),
    Person('D' , '4'),
    Person('E' , '5'),
    Person('F' , '6'),
    Person('G' , '7'),
    Person('H' , '8'),
    Person('I' , '9'),
    Person('J' , '10'),
  ];

  List<Person> selected = [];



  @override
  Widget build(BuildContext context) {
    return Scaffold(
      floatingActionButton: FloatingActionButton(onPressed: (){
        setState(() {
          
        });
      }),
        body: Center(
      child: Padding(
        padding: const EdgeInsets.all(20.0),
        // child: SimpleDP<String>(),
        child: DropDownMultiSelect<Person>(
          onChanged: ( x) {
            setState(() {
              selected =x;
            });
          },
          options: people,
          selectedValues: selected,
          whenEmpty: 'Select Something',
        ),
      ),
    ));
  }
}
copied to clipboard
115
likes
0
points
10.8k
downloads

Publisher

verified publishertaimoorhassan.ml

Weekly Downloads

2024.09.27 - 2025.04.11

A simple multiselect dropdown. It provide a concise way to create a Multi Selct ComboBox/SelectBox

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, states_rebuilder

More

Packages that depend on multiselect