isTimestamp top-level property Null safety

Matcher isTimestamp
read / write

Validates that a value is a ISO8601 timestamp.

Usage:

    var response = await client.request("/foo").get();
    expect(response, hasResponse(200, {"createdDate": isTimestamp}));

Implementation

Matcher isTimestamp = predicate((String str) {
  try {
    return DateTime.parse(str) != null;
  } catch (e) {
    return false;
  }
}, "is timestamp");