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 {
    DateTime.parse(str);
    return true;
  } catch (e) {
    return false;
  }
}, "is timestamp");