flutter_dropdown_search 0.0.2
flutter_dropdown_search: ^0.0.2 copied to clipboard

A Flutter package that an item can be searched from dropdown item lists

flutter_dropdown_search #

By this package you can search an item from the dropdown item list. And also can get the input from TextField that not present in the dropdown items.

Getting Started #

###Platforms This widget has been successfully tested on iOS, Android and Chrome.

###Examples example project available in the repository.

###Screenshots Screenshot 1. Screenshot 2.

###Code

import 'package:flutter/material.dart';
import 'package:flutter_dropdown_search/flutter_dropdown_search.dart';
void main() {
  runApp(MyApp());
}
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
            title: 'Flutter Dropdown Search',
            theme: ThemeData(
              primarySwatch: Colors.blue,
            ),
            home: HomePage()
    );
  }
}
class HomePage extends StatelessWidget {
  TextEditingController _controller=TextEditingController();
  List<String> items=["Afghanistan", "Albania", "Algeria", "American Samoa",
    "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda",
    "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan"];
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Flutter Dropdown Search'),
      ),
      body: Padding(
        padding: EdgeInsets.symmetric(horizontal: 15,vertical: 20),
        child: Column(
          children: [
            FlutterDropdownSearch(
              textController: _controller,
              items: items,
              dropdownHeight: 300,
            )
          ],
        ),
      ),
    );
  }
}
8
likes
100
pub points
72%
popularity

A Flutter package that an item can be searched from dropdown item lists

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_dropdown_search