Skip to content

Instantly share code, notes, and snippets.

@zs-dima
Last active November 2, 2020 07:59
Show Gist options
  • Save zs-dima/f9723b7a5c4dfccb65692cb06c67be02 to your computer and use it in GitHub Desktop.
Save zs-dima/f9723b7a5c4dfccb65692cb06c67be02 to your computer and use it in GitHub Desktop.
SomeForm
class SomeForm extends FormData<SomeObj> {
FormField<Duration> field1;
FormField<int> field2;
* * *
DocketForm({@required SomeObj obj}) : super(data: obj) {
contact = add(
data.field1,
onSaved: (v) => data.copyWith(field1: v),
validator: (v) => v.isNullOrSpace ? 'Invalid field1 value' : null,
);
* * *
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment