maybeWhen<TResult extends Object?> method
- @optionalTypeArgs
- TResult $default(
- int? queueCount,
- int? queueIndex,
- String? queueSeed,
- bool? includeAllUserRecords,
- String? subject,
- String? comment,
- DateTime? reportedAfter,
- DateTime? reportedBefore,
- DateTime? reviewedAfter,
- DateTime? hostingDeletedAfter,
- DateTime? hostingDeletedBefore,
- DateTime? hostingUpdatedAfter,
- DateTime? hostingUpdatedBefore,
- List<
String> ? hostingStatuses, - DateTime? reviewedBefore,
- bool? includeMuted,
- bool? onlyMuted,
- String? reviewState,
- List<
String> ? ignoreSubjects, - String? lastReviewedBy,
- String sortField,
- String sortDirection,
- bool? takendown,
- bool? appealed,
- int limit,
- List<
String> ? tags, - List<
String> ? excludeTags, - String? cursor,
- List<
String> ? collections, - ModerationQueryStatusesSubjectType? subjectType,
- int? minAccountSuspendCount,
- int? minReportedRecordsCount,
- int? minTakendownRecordsCount,
- int? minPriorityScore,
- ModerationQueryStatusesAgeAssuranceState? ageAssuranceState,
- Map<
String, dynamic> ? $unknown,
- 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( int? queueCount, int? queueIndex, String? queueSeed, bool? includeAllUserRecords, String? subject, String? comment, DateTime? reportedAfter, DateTime? reportedBefore, DateTime? reviewedAfter, DateTime? hostingDeletedAfter, DateTime? hostingDeletedBefore, DateTime? hostingUpdatedAfter, DateTime? hostingUpdatedBefore, List<String>? hostingStatuses, DateTime? reviewedBefore, bool? includeMuted, bool? onlyMuted, String? reviewState, List<String>? ignoreSubjects, String? lastReviewedBy, String sortField, String sortDirection, bool? takendown, bool? appealed, int limit, List<String>? tags, List<String>? excludeTags, String? cursor, List<String>? collections, @ModerationQueryStatusesSubjectTypeConverter() ModerationQueryStatusesSubjectType? subjectType, int? minAccountSuspendCount, int? minReportedRecordsCount, int? minTakendownRecordsCount, int? minPriorityScore, @ModerationQueryStatusesAgeAssuranceStateConverter() ModerationQueryStatusesAgeAssuranceState? ageAssuranceState, Map<String, dynamic>? $unknown)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _ModerationQueryStatusesInput() when $default != null:
return $default(_that.queueCount,_that.queueIndex,_that.queueSeed,_that.includeAllUserRecords,_that.subject,_that.comment,_that.reportedAfter,_that.reportedBefore,_that.reviewedAfter,_that.hostingDeletedAfter,_that.hostingDeletedBefore,_that.hostingUpdatedAfter,_that.hostingUpdatedBefore,_that.hostingStatuses,_that.reviewedBefore,_that.includeMuted,_that.onlyMuted,_that.reviewState,_that.ignoreSubjects,_that.lastReviewedBy,_that.sortField,_that.sortDirection,_that.takendown,_that.appealed,_that.limit,_that.tags,_that.excludeTags,_that.cursor,_that.collections,_that.subjectType,_that.minAccountSuspendCount,_that.minReportedRecordsCount,_that.minTakendownRecordsCount,_that.minPriorityScore,_that.ageAssuranceState,_that.$unknown);case _:
return orElse();
}
}