maybeWhen<TResult extends Object?> method
- @optionalTypeArgs
- TResult $default(
- String id,
- String name,
- String homepage,
- String imageId,
- int order,
- String? mobileLink,
- String? desktopLink,
- String? linkMode,
- String? webappLink,
- String? appStore,
- String? playStore,
- String? rdns,
- String? chromeStore,
- List<
Injected> ? injected, - List<
String> ? chains, - List<
String> ? categories, - String? description,
- String? badgeType,
- bool? supportsWc,
- bool? isTopWallet,
- 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 name, String homepage, @JsonKey(name: 'image_id') String imageId, int order, @JsonKey(name: 'mobile_link') String? mobileLink, @JsonKey(name: 'desktop_link') String? desktopLink, @JsonKey(name: 'link_mode') String? linkMode, @JsonKey(name: 'webapp_link') String? webappLink, @JsonKey(name: 'app_store') String? appStore, @JsonKey(name: 'play_store') String? playStore, String? rdns, @JsonKey(name: 'chrome_store') String? chromeStore, List<Injected>? injected, List<String>? chains, List<String>? categories, String? description, @JsonKey(name: 'badge_type') String? badgeType, @JsonKey(name: 'supports_wc') bool? supportsWc, @JsonKey(name: 'is_top_wallet') bool? isTopWallet)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _AppKitModalWalletListing() when $default != null:
return $default(_that.id,_that.name,_that.homepage,_that.imageId,_that.order,_that.mobileLink,_that.desktopLink,_that.linkMode,_that.webappLink,_that.appStore,_that.playStore,_that.rdns,_that.chromeStore,_that.injected,_that.chains,_that.categories,_that.description,_that.badgeType,_that.supportsWc,_that.isTopWallet);case _:
return orElse();
}
}