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

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_User value)?) → TResult?

Available on User, provided by the UserPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_User value)?, {required TResult orElse()}) → TResult

Available on User, provided by the UserPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String id, int onboardingStep, bool isEmailVerified, bool isPhoneVerified, bool isProfileCompleted, String status, String displayName, String? username, String? email, String? phoneNumber, String? countryCode, List<String> roles)?, {required TResult orElse()}) → TResult

Available on User, provided by the UserPatterns extension

A variant of when that fallback to an orElse callback.
when<TResult extends Object?>(TResult $default(String id, int onboardingStep, bool isEmailVerified, bool isPhoneVerified, bool isProfileCompleted, String status, String displayName, String? username, String? email, String? phoneNumber, String? countryCode, List<String> roles)) → TResult

Available on User, provided by the UserPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String id, int onboardingStep, bool isEmailVerified, bool isPhoneVerified, bool isProfileCompleted, String status, String displayName, String? username, String? email, String? phoneNumber, String? countryCode, List<String> roles)?) → TResult?

Available on User, provided by the UserPatterns extension

A variant of when that fallback to returning null