isTypeNullable function

bool isTypeNullable(
  1. String type
)

Implementation

bool isTypeNullable(String type) {
  type = type.trim();
  return type.endsWith('?') ||
      type == 'dynamic' ||
      type == 'void' ||
      type == 'Null';
}