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