autocompeletetxtfield 0.0.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

autocompeletetxtfield #

New flutter widget used to complete the input in the text field automatically from the given suggestion with very easy implemention i dont think that`s this is the first but i hoped to try to publish a custom widget created by me and share it with you guys

Getting Started #

Hello devs to start using this please start with add ' autocompeletetxtfield: ^0.0.5 ' in your pubspec.yaml file Enjoy it :)

Small Example #


Full Example #

you can go to EXAMPLE section to see the code


Example #

import 'package:flutter/material.dart';
import 'AutoCompeleteTxtField/MultiAutoCompeleteTxtField.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  List<String> countries;
  Widget build(BuildContext context) {
    return MaterialApp(
      home: mainPage()
class mainPage extends StatefulWidget {
  _MainState createState() => _MainState();
class _MainState extends State<mainPage> {
  List<String> countries;
  void initState() {
    countries=["Egypt","USA","UK","Russia","France","Spain","Itally","San Andrias","Estonia","Ecuador","Eran","Ethiopia","Etria","Erangle"];
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(),
        children: <Widget>[
            decoration: InputDecoration(
                labelText: 'Search',
                border: OutlineInputBorder()
            suggestions: countries,
            listElevation: 9.0,
            collapsed: true,
            onTextSubmited: (val){
            decoration: InputDecoration(
                labelText: 'Search',
                border: UnderlineInputBorder()
            suggestions: countries,
            listElevation: 6.0,
            collapsed: false,
            width: 200.0,
            onTextSubmited: (val){



[0.0.6] - April 2, 2020 #

  • Nothing change just testing few things

[0.0.7] - April 8, 2020 #

More customization added :

  • background for the textFieldbar
  • border radius for the textFieldbar if u added the background color
  • Elevation for the textFieldbar if u added the background color


##Full Example main.dart

import 'package:flutter/material.dart';
import 'package:autocompeletetxtfield/autocompeletetxtfield.dart';
void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  List<String> countries;
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MainPage()
class MainPage extends StatefulWidget {
  _MainState createState() => _MainState();
class _MainState extends State<MainPage> {
  List<String> countries;
  var width,hight;
  var clr;
  var currItem = 0;
  void initState() {
      "American Samoa",
      "Antigua and Barbuda",
      "Bahamas (the)",
      "Bolivia (Plurinational State of)",
      "Bonaire, Sint Eustatius and Saba",
      "Bosnia and Herzegovina",
      "Bouvet Island",
      "British Indian Ocean Territory (the)",
      "Brunei Darussalam",
      "Burkina Faso",
      "Cabo Verde",
      "Cayman Islands (the)",
      "Central African Republic (the)",
      "Christmas Island",
      "Cocos (Keeling) Islands (the)",
      "Comoros (the)",
      "Congo (the Democratic Republic of the)",
      "Congo (the)",
      "Cook Islands (the)",
      "Costa Rica",
      "Côte d'Ivoire",
      "Dominican Republic (the)",
      "El Salvador",
      "Equatorial Guinea",
      "Falkland Islands (the) [Malvinas]",
      "Faroe Islands (the)",
      "French Guiana",
      "French Polynesia",
      "French Southern Territories (the)",
      "Gambia (the)",
      "Heard Island and McDonald Islands",
      "Holy See (the)",
      "Hong Kong",
      "Iran (Islamic Republic of)",
      "Isle of Man",
      "Korea (the Democratic People's Republic of)",
      "Korea (the Republic of)",
      "Lao People's Democratic Republic (the)",
      "Marshall Islands (the)",
      "Micronesia (Federated States of)",
      "Moldova (the Republic of)",
      "Netherlands (the)",
      "New Caledonia",
      "New Zealand",
      "Niger (the)",
      "Norfolk Island",
      "Northern Mariana Islands (the)",
      "Palestine, State of",
      "Papua New Guinea",
      "Philippines (the)",
      "Puerto Rico",
      "Republic of North Macedonia",
      "Russian Federation (the)",
      "Saint Barthélemy",
      "Saint Helena, Ascension and Tristan da Cunha",
      "Saint Kitts and Nevis",
      "Saint Lucia",
      "Saint Martin (French part)",
      "Saint Pierre and Miquelon",
      "Saint Vincent and the Grenadines",
      "San Marino",
      "Sao Tome and Principe",
      "Saudi Arabia",
      "Sierra Leone",
      "Sint Maarten (Dutch part)",
      "Solomon Islands",
      "South Africa",
      "South Georgia and the South Sandwich Islands",
      "South Sudan",
      "Sri Lanka",
      "Sudan (the)",
      "Svalbard and Jan Mayen",
      "Syrian Arab Republic",
      "Taiwan (Province of China)",
      "Tanzania, United Republic of",
      "Trinidad and Tobago",
      "Turks and Caicos Islands (the)",
      "United Arab Emirates (the)",
      "United Kingdom of Great Britain and Northern Ireland (the)",
      "United States Minor Outlying Islands (the)",
      "United States of America (the)",
      "Venezuela (Bolivarian Republic of)",
      "Viet Nam",
      "Virgin Islands (British)",
      "Virgin Islands (U.S.)",
      "Wallis and Futuna",
      "Western Sahara",
      "Åland Islands"];
    clr = Colors.white;
  ScrollController scrollcontroller = ScrollController();
  Widget build(BuildContext context) {
    width = MediaQuery.of(context).size.width;
    hight = MediaQuery.of(context).size.height;
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        title: Text("Auto Complete Text Field"),
          children: <Widget>[
  ListView lstView() => ListView.builder(
    itemCount: countries.length,
    padding: EdgeInsets.only(top: 80),
    controller: scrollcontroller,
    itemBuilder: (context,index) => Card(
      color: index == currItem ? : clr,
      elevation: 5,
      child: ListTile(
        onTap: (){
        title: Text(countries[index]),
  Widget searchBar() => Positioned(
    top: 10,
    left: 5,
    right: 5,
    child: Stack(
      children: <Widget>[
          suggestions: countries,
          collapsed: false,
          listElevation: 5.0,
          width: (width)-30.0,
          decoration: InputDecoration(
            border: UnderlineInputBorder(
                borderRadius: BorderRadius.circular(10)
            labelText: "Search Here",
            filled: true,
            fillColor: Colors.white,
          onTextSubmited: (value){
            var index=countries.indexOf(value);
                duration: Duration(seconds: 1),
                curve: Curves.fastOutSlowIn).then((val){
              setState(() {
                currItem = index;

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  autocompeletetxtfield: ^0.0.7

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:autocompeletetxtfield/autocompeletetxtfield.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [autocompeletetxtfield] that is in a package requiring null.

Health suggestions

Format lib/src/AutoCompeleteTxtField.dart.

Run flutter format to format lib/src/AutoCompeleteTxtField.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies