$getOpt<T> method

T? $getOpt<T>(
  1. Map<String, dynamic> map,
  2. String key, [
  3. MappingHooks? hooks
])

Implementation

T? $getOpt<T>(Map<String, dynamic> map, String key, [MappingHooks? hooks]) {
  return guard(
    MapperMethod.decode,
    '.$key',
    () => hooks.decode<T?>(
      map[key],
      (v) => v == null ? null : fromValue<T>(v),
    ),
  );
}