castFn method
convierte un valor dado al tipo definido para objeto
Implementation
int castFn(v) {
if (v == null) return 0;
if (v is int) {
return v;
} else if (v is double) {
return v.toInt();
} else if (v is String) {
return int.tryParse(v) ?? 0;
}
throw 'IntData:CastFn: Imposible convertir a int desde ${v.runtimeType.toString()}';
}