maybeWhen<TResult extends Object?> method
- @optionalTypeArgs
- TResult $default(
- @JsonKey.new(name: r'$ref') String? ref,
- @JsonKey.new(includeFromJson: false, includeToJson: true) dynamic type,
- String? format,
- String? title,
- String? description,
- @JsonKey.new(name: 'required') List<
String> ? $required, - Map<
String, Schema> ? properties, - Schema? items,
- dynamic example,
- List? examples,
- @JsonKey.new(name: 'enum') List? enumValues,
- @JsonKey.new(name: 'default') dynamic $default,
- Xml? xml,
- dynamic additionalProperties,
- num? maximum,
- num? exclusiveMaximum,
- num? minimum,
- num? exclusiveMinimum,
- ExternalDocs? externalDocs,
- Discriminator? discriminator,
- List<
Schema> ? allOf, - List<
Schema> ? oneOf, - List<
Schema> ? anyOf, - Schema? not,
- bool? nullable,
- bool? readOnly,
- bool? writeOnly,
- bool? allowEmptyValue,
- String? collectionFormat,
- int? maxLength,
- int? minLength,
- int? maxItems,
- int? minItems,
- String? pattern,
- bool? uniqueItems,
- int? maxProperties,
- int? minProperties,
- num? multipleOf,
- @JsonKey.new(name: 'deprecated') bool? $deprecated,
- @JsonKey.new(includeIfNull: false, includeFromJson: false, includeToJson: false) Map<
String, dynamic> ? extensions, - String? $id,
- String? $schema,
- String? $vocabulary,
- String? $anchor,
- String? $dynamicAnchor,
- String? $dynamicRef,
- Map<
String, Schema> ? $defs, - String? contentMediaType,
- String? contentEncoding,
- @JsonKey.new(name: 'swagger-extension') bool? swaggerExtension,
- @JsonKey.new(name: 'const') dynamic const$,
- Map<
String, Schema> ? patternProperties, - bool? unevaluatedProperties,
- 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(@JsonKey(name: r'$ref') String? ref, @JsonKey(includeFromJson: false, includeToJson: true) dynamic type, String? format, String? title, String? description, @JsonKey(name: 'required') List<String>? $required, Map<String, Schema>? properties, Schema? items, dynamic example, List<dynamic>? examples, @JsonKey(name: 'enum') List<dynamic>? enumValues, @JsonKey(name: 'default') dynamic $default, Xml? xml, dynamic additionalProperties, num? maximum, num? exclusiveMaximum, num? minimum, num? exclusiveMinimum, ExternalDocs? externalDocs, Discriminator? discriminator, List<Schema>? allOf, List<Schema>? oneOf, List<Schema>? anyOf, Schema? not, bool? nullable, bool? readOnly, bool? writeOnly, bool? allowEmptyValue, String? collectionFormat, int? maxLength, int? minLength, int? maxItems, int? minItems, String? pattern, bool? uniqueItems, int? maxProperties, int? minProperties, num? multipleOf, @JsonKey(name: 'deprecated') bool? $deprecated, @JsonKey(includeIfNull: false, includeFromJson: false, includeToJson: false) Map<String, dynamic>? extensions, String? $id, String? $schema, String? $vocabulary, String? $anchor, String? $dynamicAnchor, String? $dynamicRef, Map<String, Schema>? $defs, String? contentMediaType, String? contentEncoding, @JsonKey(name: 'swagger-extension') bool? swaggerExtension, @JsonKey(name: 'const') dynamic const$, Map<String, Schema>? patternProperties, bool? unevaluatedProperties)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Schema() when $default != null:
return $default(_that.ref,_that.type,_that.format,_that.title,_that.description,_that.$required,_that.properties,_that.items,_that.example,_that.examples,_that.enumValues,_that.$default,_that.xml,_that.additionalProperties,_that.maximum,_that.exclusiveMaximum,_that.minimum,_that.exclusiveMinimum,_that.externalDocs,_that.discriminator,_that.allOf,_that.oneOf,_that.anyOf,_that.not,_that.nullable,_that.readOnly,_that.writeOnly,_that.allowEmptyValue,_that.collectionFormat,_that.maxLength,_that.minLength,_that.maxItems,_that.minItems,_that.pattern,_that.uniqueItems,_that.maxProperties,_that.minProperties,_that.multipleOf,_that.$deprecated,_that.extensions,_that.$id,_that.$schema,_that.$vocabulary,_that.$anchor,_that.$dynamicAnchor,_that.$dynamicRef,_that.$defs,_that.contentMediaType,_that.contentEncoding,_that.swaggerExtension,_that.const$,_that.patternProperties,_that.unevaluatedProperties);case _:
return orElse();
}
}