Skip to content

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

License

Notifications You must be signed in to change notification settings

Genius-Systems-Nepal/Flutter-Dropdown-Search

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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,
            )
          ],
        ),
      ),
    );
  }
}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%