This commit is contained in:
2025-03-24 11:01:57 +02:00
parent 114f0133b0
commit 1da72c7413

View File

@@ -23,7 +23,7 @@ class FormValueWrapper<T extends Object?> extends StatefulWidget {
final AstromicFormController controller;
final String id;
final bool isRequired;
final Widget Function(T? value, bool isErroredForValidation, void Function(T value, bool isRequired) valueSetter) builder;
final Widget Function(T? value, bool isErroredForValidation, void Function(T value) valueSetter) builder;
//!SECTION
//
const FormValueWrapper({
@@ -109,8 +109,8 @@ class _FormValueWrapperState<T> extends State<FormValueWrapper<T>> {
stream: widget.controller.hostedValueValidationStream,
builder: (BuildContext context, AsyncSnapshot<(String, bool)> validationSnapshot) {
return widget.builder(widget.controller.getValue<T>(widget.id),
validationSnapshot.hasData && validationSnapshot.data != null && validationSnapshot.data!.$1 == widget.id && validationSnapshot.data!.$2 ? true : false, (T newValue, bool isRequired) {
return widget.controller.setValue(widget.id, newValue,isRequired: isRequired);
validationSnapshot.hasData && validationSnapshot.data != null && validationSnapshot.data!.$1 == widget.id && validationSnapshot.data!.$2 ? true : false, (T newValue) {
return widget.controller.setValue(widget.id, newValue, isRequired: widget.isRequired);
});
});
//!SECTION