parse static method

Trriger parse(
  1. String timeString
)

Implementation

static Trriger parse(String timeString) {
  final datetime = DateTime.tryParse(timeString);
  if (datetime == null) {
    try {
      return TrrigerDuration(Heplers.triggerToDuration(timeString));
    } catch (e) {
      throw 'Invalid format for RelativeTime string: $timeString';
    }
  } else {
    return TrrigerDate(datetime);
  }
}