easy_autocomplete 1.0.0 copy "easy_autocomplete: ^1.0.0" to clipboard
easy_autocomplete: ^1.0.0 copied to clipboard

outdated

A simple but flexible autocomplete TextFormField

Easy Autocomplete #

Buy Me A Pizza

A Flutter plugin to handle input autocomplete suggestions

Preview #

Preview

ToDo #

  • Add validation functionality
  • Adding asynchronous suggestions fetch

Usage #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  easy_autocomplete: ^1.0.0

You can create a simple autocomplete input widget with the following example:

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: SafeArea(
        child: Scaffold(
          appBar: AppBar(
            title: Text('Example')
          ),
          body: Container(
            padding: EdgeInsets.all(10),
            alignment: Alignment.center,
            child: EasyAutocomplete(
              suggestions: ['Afeganistan', 'Albania', 'Algeria', 'Australia', 'Brazil', 'German', 'Madagascar', 'Mozambique', 'Portugal', 'Zambia'],
              onChanged: (value) => print(value)
            )
          )
        )
      )
    );
  }
}

API #

Attribute Type Required Description Default value
suggestions List<String> ✔️ The list of suggestions to be displayed
controller TextEditingController Text editing controller
decoration InputDecoration Can be used to decorate the input InputDecoration()
onChanged Function(String) Function that handles the changes to the input
inputFormatter List<TextInputFormatter> Can be used to set custom inputFormatters to field
initialValue String Can be used to set the textfield initial value
textCapitalization TextCapitalization Can be used to set the text capitalization type TextCapitalization.sentences

Issues & Suggestions #

If you encounter any issue you or want to leave a suggestion you can do it by filling an issue.

Thank you for the support! #

57
likes
0
pub points
94%
popularity

Publisher

verified publisher4inka.com

A simple but flexible autocomplete TextFormField

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on easy_autocomplete