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

A new Flutter package for Dropdown Input

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch: Colors.blue,),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  List<Map<String, dynamic>> optionsList = [
    {
      "name": "grey",
      "id": "1"
    },
    {
      "name": "green",
      "id": "2"
    },
    {
      "name": "red",
      "id": "3"
    },
    {
      "name": "orange",
      "id": "4"
    }
  ];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        children: [
          DropdownInput(
            optionsList: optionsList,
            filterField: "name",
            onItemSelected: (item) {
              print(item);
            },
          ),
        ],
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
2
likes
120
points
23
downloads

Publisher

verified publisherjocelinfowe-dev.fr

Weekly Downloads

A new Flutter package for Dropdown Input

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on dropdown_input