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

Multi-select Dropdown with Select All option

This is a multiple selection dropdown with select all option.

Features #

multiple selection, select all option

Getting started #

Add multiselect_dropdown_with_select_all: to your pubspec.yaml dependencies then run flutter pub get

Add from pub [Stable]

dependencies:
multiselect_dropdown_with_select_all:

Usage #

import 'package:flutter/material.dart';
import 'multi_select_dropdown.dart'; // Import the file with the custom widget

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Multi-Select Dropdown Example')),
        body: MultiSelectForm(),
      ),
    );
  }
}

class MultiSelectForm extends StatefulWidget {
  @override
  _MultiSelectFormState createState() => _MultiSelectFormState();
}

class _MultiSelectFormState extends State<MultiSelectForm> {
  final _formKey = GlobalKey<FormState>();
  List<String> items = ['Option 1', 'Option 2', 'Option 3'];
  List<String> selectedItems = [];

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(16.0),
      child: Form(
        key: _formKey,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            MultiSelectDropdown(
              items: items,
              initialSelectedItems: selectedItems,
              hint: 'Select options',
            ),
            SizedBox(height: 20),
            ElevatedButton(
              onPressed: () {
                if (_formKey.currentState!.validate()) {
                  // Form is valid, handle submission
                  print('Selected Items: $selectedItems');
                }
              },
              child: Text('Submit'),
            ),
          ],
        ),
      ),
    );
  }
}

Additional information #

5
likes
0
points
27
downloads

Publisher

verified publisherfaceboss.online

Weekly Downloads

Multi-select Dropdown with Select All option

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on multiselect_dropdown_with_select_all