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

Additional form widgets for Flutter. Including checkbox form widget.

Form Widgets #

This package provides custom form widgets for Flutter applications.

Widgets #

CheckboxFormField #

A FormField that contains a CheckboxListTile.

Properties

  • title: The title widget to display next to the checkbox.
  • onSaved: Called when the form is saved.
  • validator: Called to validate the form field.
  • initialValue: The initial value of the checkbox.
  • onChanged: Called when the value of the checkbox changes.

ClickableTextFormWidget #

A custom widget that combines a TextFormField with a TextButton.

Properties

  • labelText: The label text to display inside the TextFormField.
  • controller: The controller for the TextFormField.
  • validator: The validator for the TextFormField.
  • onPressed: The callback function to be called when the TextButton is pressed.

Usage #

To use these widgets, import the package and include them in your form:

import 'package:form_widgets/checkbox_form_widget.dart';
import 'package:form_widgets/clickable_text_form_widget.dart';

...

CheckboxFormField(
  title: Text('Accept Terms'),
  onSaved: (value) {
    // Save value
  },
  validator: (value) {
    if (value == false) {
      return 'You must accept the terms';
    }
    return null;
  },
  onChanged: (value) {
    // Handle change
  },
),

ClickableTextFormWidget(
  labelText: 'Click me',
  controller: TextEditingController(),
  validator: (value) {
    if (value == null || value.isEmpty) {
      return 'This field cannot be empty';
    }
    return null;
  },
  onPressed: () {
    // Handle button press
  },
),
1
likes
160
points
15
downloads

Publisher

verified publisherflexxxlab.com

Weekly Downloads

Additional form widgets for Flutter. Including checkbox form widget.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on form_widgets