moform 0.1.1 copy "moform: ^0.1.1" to clipboard
moform: ^0.1.1 copied to clipboard

Reactive, model-driven, and type-safe forms for Flutter. A light wrapper around Flutter's TextField.

Moform #

Reactive, model-driven, and type-safe forms for Flutter.

Getting Started #

➤ Installation #

Add the following to your pubspec.yaml:

dependencies:
  moform: <version>

➤ Usage #

Using a StatefulWidget:

StringField(
  value: email,
  onChanged: (value) {
    setState(() => email = value);
  },
);

Using Riverpod:

final emailProvider = StateProvider<String>((ref) => '');

StringField(
  value: ref.watch(emailProvider).state,
  onChanged: (value) {
    ref.read(emailProvider).state = value;
  },
);

Features #

➤ Typed Fields #

String

StringField(
  value: email,
  onChanged: (value) {
    setState(() => email = value);
  },
);

Int

IntField(
  value: age,
  onChanged: (value) {
    setState(() => age = value);
  },
);

➤ Custom Styles #

Use builder to customize provide a custom field widget.

StringField(
  value: email,
  onChanged: (value) {
    setState(() {
      email = value;
    });
  },
  builder: (context, controller) {
    return TextField(
      controller: controller,
      decoration: const InputDecoration(
        labelText: 'Custom Field',
      ),
    );
  },
);
5
likes
0
points
1.16k
downloads

Publisher

verified publishertienisto.com

Weekly Downloads

Reactive, model-driven, and type-safe forms for Flutter. A light wrapper around Flutter's TextField.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, meta

More

Packages that depend on moform