updateByKey method
Updates the field identified by key and returns a new instance.
Implement using an immutable update pattern such as copyWith:
@override
LoginForm updateByKey(LoginField key, dynamic value) => switch (key) {
LoginField.email => copyWith(email: value),
LoginField.password => copyWith(password: value),
};
Implementation
@override
BlocxTestFormEntity updateByKey(BlocxTestFormField key, dynamic value) =>
switch (key) {
BlocxTestFormField.field1 => copyWith(field1: value as String? ?? ''),
BlocxTestFormField.field2 => copyWith(field2: value as String? ?? ''),
};