convertTimestampToInt function
dynamic
convertTimestampToInt(
- dynamic timestamp
Implementation
dynamic convertTimestampToInt(dynamic timestamp) {
if (timestamp == null) {
return 0;
}
if (timestamp is double) {
return timestamp.toInt();
}
if (timestamp is String) {
return int.tryParse(timestamp) ?? 0;
}
return timestamp;
}