freezed_form
A brick to create a freezed form class unsing the formz and freezed package.
ā Requirements
This package requires that you have the formz and freezed package as dependencies.
How to use š
mason make freezed_form --name login_form
Variables āØ
Variable | Description | Type |
---|---|---|
name | The name of the form, e.g. login_form | String |
Outputs š¦
mason make freezed_form --name login_form
āāā login_form.dart
āāā login_form.freezed.dart
login_form.freezed.dart
will be created by running build_runner.
Exmaple login_form.dart
import 'package:formz/formz.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'login_form.freezed.dart';
@freezed
class LoginForm with FormzMixin, _$LoginForm {
const factory LoginForm({
required int placeholder,
}) = _LoginForm;
const LoginForm._();
@override
List<FormzInput> get inputs => [
// TODO dont forget to add inputs here
];
}