validateType<T> function

Validator validateType<T>()

Shortcut for a validator to assert that the data has a specific type

Implementation

Validator validateType<T>() {
  return validate(
      (data) => (data is T),
      (data) => ArgumentError(
          "Data is not the correct type. Expected ${T.runtimeType}"));
}