sendTimeFromJson static method

int sendTimeFromJson(
  1. dynamic milliseconds
)

Implementation

static int sendTimeFromJson(dynamic milliseconds) {
  if (milliseconds == null) {
    return DateTime.now().millisecondsSinceEpoch;
  }
  if (milliseconds is String) {
    return int.tryParse(milliseconds) ?? 0;
  } else if (milliseconds is int) {
    return milliseconds;
  } else {
    return int.tryParse(milliseconds) ?? 0;
  }
}