whenOrNull<TResult extends Object?> method
- TResult? $default(
- String id,
- String orgId,
- String provider,
- String status,
- String? teamId,
- String? teamName,
- String? connectedUserId,
- List<
String> scopes, - Map<
String, dynamic> config, - DateTime? lastVerifiedAt,
- String? lastError,
- String installedBy,
- DateTime installedAt,
- DateTime updatedAt,
- DateTime? tokenExpiresAt,
- bool hasCustomClient,
A variant of when that fallback to returning null
It is equivalent to doing:
switch (sealedClass) {
case Subclass(:final field):
return ...;
case _:
return null;
}
Implementation
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String orgId, String provider, String status, String? teamId, String? teamName, String? connectedUserId, @JsonKey(fromJson: _castStringList) List<String> scopes, @JsonKey(fromJson: _castMap) Map<String, dynamic> config, DateTime? lastVerifiedAt, String? lastError, String installedBy, DateTime installedAt, DateTime updatedAt, DateTime? tokenExpiresAt, bool hasCustomClient)? $default,) {final _that = this;
switch (_that) {
case _OrgIntegrationModel() when $default != null:
return $default(_that.id,_that.orgId,_that.provider,_that.status,_that.teamId,_that.teamName,_that.connectedUserId,_that.scopes,_that.config,_that.lastVerifiedAt,_that.lastError,_that.installedBy,_that.installedAt,_that.updatedAt,_that.tokenExpiresAt,_that.hasCustomClient);case _:
return null;
}
}