Additional Ready-made form input Fields For Flutter_form_builder

Form Builder Extra Fields

FormBuilder Extra Fields provides common ready-made form input fields for flutter_form_builder package. The package gives you a convenient way of adding common ready-made input fields instead of creating your own FormBuilderField from scratch.


  • Add several type of inputs to flutter_form_builder


The currently supported fields include:

  • FormBuilderColorPicker - Input for Color selection
  • FormBuilderRating - For selection of a numerical value as a rating
  • FormBuilderSearchableDropdown - Field for selecting value(s) from a searchable list
  • FormBuilderSignaturePad - Field with drawing pad on which user can doodle
  • FormBuilderTouchSpin - Selection of a number by tapping on a plus or minus icon
  • FormBuilderTypeAhead - Auto-completes user input from a list of items


In order to create an input field in the form, along with the label, and any applicable validation, there are several attributes that are supported by all types of inputs namely:

nameString YesThis will form the key in the form value Map
initialValueTnullNoThe initial value of the input field
enabledbooltrueNoDetermines whether the field widget will accept user input.
decorationInputDecorationInputDecoration()NoDefines the border, labels, icons, and styles used to decorate the field.
validatorFormFieldValidator<T>nullNoA FormFieldValidator that will check the validity of value in the FormField
onChangedValueChanged<T>nullNoThis event function will fire immediately the the field value changes
valueTransformerValueTransformer<T>nullNoFunction that transforms field value before saving to form value. e.g. transform TextField value for numeric field from String to num
The rest of the attributes will be determined by the type of Widget being used.    

Dependency parameters

Each field has a dependency with your own configurations. Take a look on dependencies repositories to understand the behaviour and properties:

FormBuilderTouchSpinNo dependency



No especific setup required: only install the dependency and use :)

Basic use

final _formKey = GlobalKey<FormBuilderState>();

    key: _formKey,
    child: FormBuilderColorPickerField(
      name: 'color_picker',

See example tab or github code for more details

For more instructions about FormBuilder, see flutter_form_builder package



You have some ways to contribute to this packages

  • Beginner: Reporting bugs or request new features
  • Intermediate: Implement new features (from issues or not) and created pull requests
  • Advanced: Join to organization like a member and help coding, manage issues, dicuss new features and other things

See contribution file for more details

Questions and answers

You can question or search answers on Github discussion or on StackOverflow


Donate or become a sponsor of Flutter Form Builder Ecosystem

Become a Sponsor



Take a look to our awesome ecosystem and all packages in there

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add form_builder_extra_fields

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

  form_builder_extra_fields: ^10.0.0

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

Import it

Now in your Dart code, you can use:

import 'package:form_builder_extra_fields/form_builder_extra_fields.dart';


import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:form_builder_extra_fields/form_builder_extra_fields.dart';
import 'package:form_builder_validators/form_builder_validators.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch:,
      localizationsDelegates: const [
      supportedLocales: const [Locale('en')],
      home: const MyHomePage(),

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  MyHomePageState createState() => MyHomePageState();

class MyHomePageState extends State<MyHomePage> {
  final _formKey = GlobalKey<FormBuilderState>();

  void _onChanged(dynamic val) => debugPrint(val.toString());

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Extra Fields Example')),
      body: SingleChildScrollView(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: FormBuilder(
            key: _formKey,
            onChanged: () {
            autovalidateMode: AutovalidateMode.onUserInteraction,
            child: Column(
              children: [
                  name: 'searchable_dropdown_online',
                  onChanged: _onChanged,
                  asyncItems: (filter) async {
                    await Future.delayed(const Duration(seconds: 1));
                    return allCountries
                        .where((element) => element
                  decoration: const InputDecoration(
                    labelText: 'Searchable Dropdown Online',
                  popupProps: const true),
                  dropdownSearchDecoration: const InputDecoration(
                    hintText: 'Search',
                    labelText: 'Search',
                  name: 'searchable_dropdown_offline',
                  items: allCountries,
                  onChanged: _onChanged,
                  decoration: const InputDecoration(
                      labelText: 'Searchable Dropdown Offline'),
                  filterFn: (country, filter) =>
                const SizedBox(height: 15),
                  name: 'color_picker',
                  initialValue: Colors.yellow,
                  // readOnly: true,
                  colorPickerType: ColorPickerType.materialPicker,
                  decoration: const InputDecoration(labelText: 'Color Picker'),
                  decoration: const InputDecoration(
                    labelText: 'TypeAhead (Autocomplete TextField)',
                    hintText: 'Start typing country name',
                  name: 'country',
                  onChanged: _onChanged,
                  itemBuilder: (context, country) {
                    return ListTile(title: Text(country));
                  controller: TextEditingController(text: ''),
                  initialValue: 'Uganda',
                  suggestionsCallback: (query) {
                    if (query.isNotEmpty) {
                      var lowercaseQuery = query.toLowerCase();
                      return allCountries.where((country) {
                        return country.toLowerCase().contains(lowercaseQuery);
                      }).toList(growable: false)
                        ..sort((a, b) => a
                    } else {
                      return allCountries;
                  decoration: const InputDecoration(labelText: 'TouchSpin'),
                  name: 'touch_spin',
                  initialValue: 10,
                  step: 1,
                  iconSize: 48.0,
                  addIcon: const Icon(Icons.arrow_right),
                  subtractIcon: const Icon(Icons.arrow_left),
                  onChanged: _onChanged,
                  decoration: const InputDecoration(labelText: 'Rating Bar'),
                  name: 'rate',
                  // enabled: false,
                  itemSize: 32.0,
                  initialValue: 1.0,
                  maxRating: 5.0,
                  onChanged: _onChanged,
                  decoration: const InputDecoration(
                    labelText: 'Signature Pad',
                  name: 'signature',
                  border: Border.all(color:,
                  onChanged: _onChanged,
                const SizedBox(height: 10),
                  children: <Widget>[
                      child: MaterialButton(
                        color: Theme.of(context).colorScheme.secondary,
                        onPressed: () {
                          if (_formKey.currentState?.saveAndValidate() ??
                              false) {
                          } else {
                            debugPrint('validation failed');
                        child: const Text(
                          style: TextStyle(color: Colors.white),
                    const SizedBox(width: 20),
                      child: OutlinedButton(
                        onPressed: () {
                        // color: Theme.of(context).colorScheme.secondary,
                        child: Text(
                          style: TextStyle(
                              color: Theme.of(context).colorScheme.secondary),

class Contact {
  final String name;
  final String email;
  final String imageUrl;

  const Contact(,, this.imageUrl);

  bool operator ==(Object other) =>
      identical(this, other) ||
      other is Contact &&
          runtimeType == other.runtimeType &&
          name ==;

  int get hashCode => name.hashCode;

  String toString() {
    return name;

const allCountries = [
  'American Samoa',
  'Antigua and Barbuda',
  'Bosnia and Herzegowina',
  'Bouvet Island',
  'British Indian Ocean Territory',
  'Brunei Darussalam',
  'Burkina Faso',
  'Cape Verde',
  'Cayman Islands',
  'Central African Republic',
  'Christmas Island',
  'Cocos (Keeling) Islands',
  'Congo, the Democratic Republic of the',
  'Cook Islands',
  'Costa Rica',
  'Cote d\'Ivoire',
  'Croatia (Hrvatska)',
  'Czech Republic',
  'Dominican Republic',
  'East Timor',
  'El Salvador',
  'Equatorial Guinea',
  'Falkland Islands (Malvinas)',
  'Faroe Islands',
  'France Metropolitan',
  'French Guiana',
  'French Polynesia',
  'French Southern Territories',
  'Heard and Mc Donald Islands',
  'Holy See (Vatican City State)',
  'Hong Kong',
  'Iran (Islamic Republic of)',
  'Korea, Democratic People\'s Republic of',
  'Korea, Republic of',
  'Lao, People\'s Democratic Republic',
  'Libyan Arab Jamahiriya',
  'Macedonia, The Former Yugoslav Republic of',
  'Marshall Islands',
  'Micronesia, Federated States of',
  'Moldova, Republic of',
  'Netherlands Antilles',
  'New Caledonia',
  'New Zealand',
  'Norfolk Island',
  'Northern Mariana Islands',
  'Papua New Guinea',
  'Puerto Rico',
  'Russian Federation',
  'Saint Kitts and Nevis',
  'Saint Lucia',
  'Saint Vincent and the Grenadines',
  'San Marino',
  'Sao Tome and Principe',
  'Saudi Arabia',
  'Sierra Leone',
  'Slovakia (Slovak Republic)',
  'Solomon Islands',
  'South Africa',
  'South Georgia and the South Sandwich Islands',
  'Sri Lanka',
  'St. Helena',
  'St. Pierre and Miquelon',
  'Svalbard and Jan Mayen Islands',
  'Syrian Arab Republic',
  'Taiwan, Province of China',
  'Tanzania, United Republic of',
  'Trinidad and Tobago',
  'Turks and Caicos Islands',
  'United Arab Emirates',
  'United Kingdom',
  'United States',
  'United States Minor Outlying Islands',
  'Virgin Islands (British)',
  'Virgin Islands (U.S.)',
  'Wallis and Futuna Islands',
  'Western Sahara',

const contacts = <Contact>[
  Contact('Andrew', '',
  Contact('Paul', '',
  Contact('Fred', '',
  Contact('Brian', '',
  Contact('John', '',
  Contact('Thomas', '',
  Contact('Nelly', '',
  Contact('Marie', '',
  Contact('Charlie', '',
  Contact('Diana', '',
  Contact('Ernie', '',
  Contact('Gina', '',

Download details:



#flutter #android #ios #forms #text 

Additional Ready-made form input Fields For Flutter_form_builder
1.65 GEEK