isNullable property

bool get isNullable

Implementation

bool get isNullable {
  try {
    // throws an exception if T is not nullable
    final _ = null as T;
    return true;
  } catch (_) {
    return false;
  }
}