maybeWhen<TResult extends Object?> method
- TResult $default(
- String id,
- String orgId,
- OrgIntegrationProvider provider,
- OrgIntegrationStatus 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,
- required TResult orElse(),
A variant of when that fallback to an orElse callback.
It is equivalent to doing:
switch (sealedClass) {
case Subclass(:final field):
return ...;
case _:
return orElse();
}
Implementation
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String orgId, OrgIntegrationProvider provider, OrgIntegrationStatus 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)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _OrgIntegration() 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 orElse();
}
}