multiple_selection_drop_down 0.0.1 copy "multiple_selection_drop_down: ^0.0.1" to clipboard
multiple_selection_drop_down: ^0.0.1 copied to clipboard

this is a multiple selection dropdown package

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List<FruitsModel> listOfSelectedFruits = [];
  List<FruitsModel> listOfFruits = [
    FruitsModel(id: 1, name: "Mango"),
    FruitsModel(id: 2, name: "Banana"),
    FruitsModel(id: 3, name: "Apple"),
    FruitsModel(id: 4, name: "Grape"),
    FruitsModel(id: 5, name: "Orange"),
  ];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Multiple Select Dropdown example'),
        ),
        body: Center(
          child: MultipleSelectionDropDownView(
            items: listOfFruits,
            selectedItemList: listOfSelectedFruits,
            displayText: (value) => value.name,
            onChange: (value) {
              listOfSelectedFruits = value;
              setState(() {});
            },
          ),
        ),
      ),
    );
  }
}

class FruitsModel {
  final int id;
  final String name;

  FruitsModel({required this.id, required this.name});
}
2
likes
120
points
33
downloads

Publisher

unverified uploader

Weekly Downloads

this is a multiple selection dropdown package

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, web

More

Packages that depend on multiple_selection_drop_down