tryGet<T> method

T? tryGet<T>(
  1. String key
)

Try get value as T with given key. It returns null if failed.

Implementation

T? tryGet<T>(String key) {
  try {
    return get<T>(key);
  } on JsonTypeException {
    return null;
  }
}