Compare commits
No commits in common. "0c920e82454a591e7343b164fafd33431d2041e4" and "f031b3cbf5e1dad303b493112d262254ad6d586c" have entirely different histories.
0c920e8245
...
f031b3cbf5
@ -73,9 +73,7 @@ class WyattFormImpl extends WyattForm {
|
||||
if (containsKey(key)) {
|
||||
return inputs.firstWhere((input) => input.key == key);
|
||||
} else {
|
||||
throw Exception(
|
||||
'FormInput with key `$key` does not exist in form `$name`',
|
||||
);
|
||||
throw Exception('FormInput with key `$key` does not exist in form');
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,6 +146,6 @@ class WyattFormImpl extends WyattForm {
|
||||
List<Object?> get props => [_inputs, _name, _validator];
|
||||
|
||||
@override
|
||||
String toString() => 'WyattForm(name: $name, validation: '
|
||||
'${_validator.runtimeType}, inputs: $inputs)';
|
||||
String toString() =>
|
||||
'WyattForm(name: $name, validation: ${_validator.runtimeType}, inputs: $inputs)';
|
||||
}
|
||||
|
@ -41,7 +41,4 @@ class ConfirmedPassword
|
||||
|
||||
@override
|
||||
ValidationStandardError get onNull => ValidationStandardError.invalid;
|
||||
|
||||
@override
|
||||
List<Object?> get props => super.props + [password];
|
||||
}
|
||||
|
@ -57,7 +57,4 @@ class FormRepositoryImpl extends FormRepository {
|
||||
void unregisterForm(String formName) {
|
||||
_runtimeForms.remove(formName);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() => 'FormRepository($_runtimeForms)';
|
||||
}
|
||||
|
@ -63,5 +63,5 @@ class FormInput<
|
||||
|
||||
@override
|
||||
String toString() =>
|
||||
'FormInput(name: $name, $validator)';
|
||||
'FormInput(name: $name, value: ${validator.value}, status: ${validator.status.name}';
|
||||
}
|
||||
|
@ -42,10 +42,4 @@ abstract class AnyValidator<O, I extends Iterable<O?>,
|
||||
}
|
||||
return onError;
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => super.props + [allChoices];
|
||||
|
||||
@override
|
||||
String toString() => '${super.toString()}, choices: $allChoices';
|
||||
}
|
||||
|
@ -42,10 +42,4 @@ abstract class EqualityValidator<O extends Object, E extends ValidationError>
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => super.props + [another];
|
||||
|
||||
@override
|
||||
String toString() => '${super.toString()}, another: $another';
|
||||
}
|
||||
|
@ -107,8 +107,8 @@ abstract class FormInputValidator<Value, Error extends ValidationError>
|
||||
Error? validator(Value? value);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [value, pure];
|
||||
bool? get stringify => true;
|
||||
|
||||
@override
|
||||
String toString() => 'value: $value, status: ${status.name}';
|
||||
List<Object?> get props => [value, pure];
|
||||
}
|
||||
|
@ -16,21 +16,24 @@
|
||||
|
||||
part of 'form_data_cubit.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
abstract class FormDataState extends Equatable {
|
||||
/// Global status of a form.
|
||||
final FormStatus status;
|
||||
|
||||
/// FormData with all inputs, and associated metadata.
|
||||
final WyattForm form;
|
||||
late WyattForm form;
|
||||
|
||||
/// Optional error message.
|
||||
final String? errorMessage;
|
||||
|
||||
const FormDataState({
|
||||
required this.form,
|
||||
FormDataState({
|
||||
WyattForm? form,
|
||||
this.status = FormStatus.pure,
|
||||
this.errorMessage,
|
||||
});
|
||||
}) {
|
||||
this.form = form ?? WyattFormImpl(const [], name: '');
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [status, form, errorMessage];
|
||||
|
@ -16,8 +16,9 @@
|
||||
|
||||
part of 'form_data_cubit_impl.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class FormDataStateImpl extends FormDataState {
|
||||
const FormDataStateImpl({
|
||||
FormDataStateImpl({
|
||||
required super.form,
|
||||
super.status = FormStatus.pure,
|
||||
super.errorMessage,
|
||||
@ -38,6 +39,6 @@ class FormDataStateImpl extends FormDataState {
|
||||
List<Object?> get props => [status, form, errorMessage];
|
||||
|
||||
@override
|
||||
String toString() => 'FormDataSate(status: ${status.name} '
|
||||
'${(errorMessage != null) ? " [$errorMessage]" : ""}, $form)';
|
||||
String toString() =>
|
||||
'FormDataSate(status: ${status.name} ${(errorMessage != null) ? " [$errorMessage]" : ""}, $form';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user