asListOfObjects<E> function

List<E> asListOfObjects<E>(
  1. NUIEntMapper<E> entity,
  2. dynamic value
)

Implementation

List<E> asListOfObjects<E>(NUIEntMapper<E> entity, dynamic value){
  if(value == null) return [];
  var endValue = value;
  if(value is String){
    endValue = jsonDecode(value);
  }
  List<E> list = (endValue as List).map((i) =>
      entity.toEntity(i)).toList();
  return list;
}