voice_formly 0.0.2 copy "voice_formly: ^0.0.2" to clipboard
voice_formly: ^0.0.2 copied to clipboard

A dart package for building form fields with speech-to-text and built-in validation.

voice_formly #

voice_formly is a customizable Flutter form field widget that adds built-in validation and speech-to-text input support. It simplifies voice-powered form handling and allows users to build accessible and modern form experiences faster.

Features #

  • ๐ŸŽค Voice input (speech-to-text) for supported fields (text, email, phone, multiline, etc.)
  • ๐Ÿ›ก๏ธ Built-in smart validation for common fields (email, number, phone)
  • ๐Ÿง  Custom validation support
  • ๐Ÿงพ Multiple field types: text, email, password, phone, date, multiline, number
  • ๐ŸŽจ Easily configurable with styling, hints, borders, icons
  • ๐Ÿ“† Integrated date picker for date fields

Screenshots #

Validation Error Voice Input in Action

Getting started #

Add the package to your pubspec.yaml:

dependencies:
  voice_formly: ^0.0.1  

Import it in your Dart file:

import 'package:voice_formly/voice_formly.dart';

Usage Example #

VoiceFormField(
  controller: myController,
  fieldId: 'email',
  label: 'Email Address',
  fieldType: FormFieldType.email,
  enableVoice: true,
  validator: (value) {
    if (value == null || value.isEmpty) return 'Enter your email';
    return null;
  },
  onMicTap: (fieldId) {
    print("Mic tapped on field: $fieldId");
  },
)

๐Ÿงพ VoiceFormField Parameters #

Parameter Type Description
fieldId String Unique identifier for the field (used with callbacks).
onMicTap Function(String fieldId)? Callback function when the mic icon is tapped.
controller TextEditingController Controller for managing the text input.
hint String? Placeholder or hint shown inside the field.
height int? Custom height of the field in logical pixels.
width int? Custom width of the field in logical pixels.
fontSize int Font size of the input text.
maxLines int? Maximum number of lines (useful for multiline fields).
minLines int? Minimum number of lines.
errorMaxLines int? Maximum number of lines for the error message.
keyboardType TextInputType? Keyboard input type (text, email, number, etc.).
borderColor Color Border color when the field is focused.
label String? Label shown above the field.
enableVoice bool Whether to enable voice input functionality.
suffixIconButton IconButton? Custom suffix icon at the end of the field.
autofocus bool? Whether to autofocus the field on load.
autocorrect bool? Whether to enable autocorrect for the input.
textInputAction TextInputAction? The action button on the keyboard (e.g., done, next).
autoValidateMode AutovalidateMode? Controls when to auto-validate the field (e.g., always, onUserInteraction).
padding EdgeInsets? Custom padding inside the form field.
validator String? Function(String?)? Custom validation logic.
fieldType FormFieldType Determines behavior (e.g., text, email, password, date).
enabledBorder InputBorder? Border style when field is enabled.
border InputBorder? Default border style.
focusedErrorBorder InputBorder? Border style when field has focus and an error.
focusedBorder InputBorder? Border style when field is focused.
errorBorder InputBorder? Border style when validation fails.
disabledBorder InputBorder? Border style when the field is disabled.

๐Ÿ“„ License #

This project is licensed under the MIT License โ€“ see the LICENSE file for details.

2
likes
160
points
16
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A dart package for building form fields with speech-to-text and built-in validation.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, intl, speech_to_text

More

Packages that depend on voice_formly