fromBasicTypeValueList method

void fromBasicTypeValueList(
  1. Object? value, {
  2. bool presentIfNull = false,
})

Only for String/bool/num/int/double

Implementation

void fromBasicTypeValueList(Object? value, {bool presentIfNull = false}) {
  if (value is List) {
    var list = createList();
    for (var rawItem in value) {
      var item = basicTypeCastType(itemType, rawItem);
      if (item is T) {
        list.add(item);
      }
    }
    setValue(list);
  } else {
    if (presentIfNull) {
      setValue(null, presentIfNull: true);
    }
  }
}