getElementValue method

  1. @override
String? getElementValue(
  1. Node? element
)
override

Implementation

@override
String? getElementValue(Node? element) {
  if (element == null) return null;

  if (element is InputElement) {
    return element.value;
  } else if (element is TextAreaElement) {
    return element.value;
  } else if (element is SelectElement) {
    return element.value;
  } else if (element is CheckboxInputElement) {
    return '${element.checked ?? false}';
  } else if (element is FileUploadInputElement) {
    var files = element.files ?? [];
    return files.isNotEmpty ? files.join(',') : '';
  }

  return element.text;
}