decode<T> static method

T? decode<T>(
  1. String? value
)

Implementation

static T? decode<T>(String? value) {
  if (T == String) {
    return value as T?;
  } else if (T is bool) {
    return value.parseBool() as T?;
  }
  return null;
}