select_field 1.1.0 copy "select_field: ^1.1.0" to clipboard
select_field: ^1.1.0 copied to clipboard

Simple, easy and highly customizable input field for creating a dropdown list of selectable options.

example/lib/main.dart

import 'package:example/data.dart';
import 'package:example/multi_select_field_examples/multi_select_field_demo.dart';
import 'package:example/multi_select_field_examples/multi_select_options_control.dart';
import 'package:example/select_field_examples/custom_menu_select_field.dart';
import 'package:example/select_field_examples/styled_select_field.dart';
import 'package:flutter/material.dart';
import 'package:select_field/select_field.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Select Field',
      theme: themeData,
      home: const MyHomePage(),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    final options = fruitOptions
        .map((fruit) => Option(label: fruit, value: fruit))
        .toList();

    return Scaffold(
      appBar: AppBar(
        title: const Text(
          'Multi Select Field',
          style: TextStyle(
            color: Colors.white,
            fontWeight: FontWeight.bold,
          ),
        ),
      ),
      body: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 32),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            StyledSelectField(options: options),
            const SizedBox(height: 32),
            CustomMenuSelectField(options: options),
            const SizedBox(height: 32),
            MultiSelectOptionsControl<String>(options: options),
            const SizedBox(height: 32),
            MultiSelectFieldDemo<String>(options: options)
          ],
        ),
      ),
    );
  }
}
5
likes
160
pub points
75%
popularity

Publisher

unverified uploader

Simple, easy and highly customizable input field for creating a dropdown list of selectable options.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on select_field