handlerAutoCollect method

void handlerAutoCollect(
  1. T? newValue,
  2. T? value
)

Implementation

void handlerAutoCollect(T? newValue, T? value) {
  if (widget.autoCollect == true && isChanged(newValue, value)) {
    widget.useValue(context, (cv) {
      if (cv.runtimeType != newValue.runtimeType) {
        var fromItem = AntdFormItemProvider.ofMaybe(context);
        AntdLogs.w(
            msg:
                "Field '${fromItem?.namePath}' value type mismatch: stored value type (${cv.runtimeType}) differs from new value type (${newValue.runtimeType}). Auto-ignored. Set autoCollect to false for custom handling.",
            biz: widget.runtimeType.toString());
      }
    });
    widget.setValue(context, newValue, AntdFormTrigger.any);
  }
}