UserPatterns extension
Adds pattern-matching-related methods to User.
- on
Methods
-
map<
TResult extends Object?> (TResult $default(_User value)) → TResult -
Available on User, provided by the UserPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_User value)?) → TResult? -
Available on User, provided by the UserPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_User value)?, {required TResult orElse()}) → TResult -
Available on User, provided by the UserPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(String id, String name, String email, bool emailVerified, String? image, DateTime? createdAt, DateTime? updatedAt, bool twoFactorEnabled, String? username, String? displayUsername, bool isAnonymous, String? phoneNumber, bool phoneNumberVerified, String? role, bool banned, String? banReason, DateTime? banExpires)?, {required TResult orElse()}) → TResult -
Available on User, provided by the UserPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
when<
TResult extends Object?> (TResult $default(String id, String name, String email, bool emailVerified, String? image, DateTime? createdAt, DateTime? updatedAt, bool twoFactorEnabled, String? username, String? displayUsername, bool isAnonymous, String? phoneNumber, bool phoneNumberVerified, String? role, bool banned, String? banReason, DateTime? banExpires)) → TResult -
Available on User, provided by the UserPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String id, String name, String email, bool emailVerified, String? image, DateTime? createdAt, DateTime? updatedAt, bool twoFactorEnabled, String? username, String? displayUsername, bool isAnonymous, String? phoneNumber, bool phoneNumberVerified, String? role, bool banned, String? banReason, DateTime? banExpires)?) → TResult? -
Available on User, provided by the UserPatterns extension
A variant ofwhenthat fallback to returningnull