feat: people infinite scroll (#11326)

* feat: people infinite scroll

* add infinite scroll to show & hide modal

* update unit tests

* show total people count instead of currently loaded

* update personsearchdto
This commit is contained in:
Michel Heusschen 2024-07-25 21:59:28 +02:00 committed by GitHub
parent 152421e288
commit 8e6bc13540
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 276 additions and 67 deletions

View file

@ -13,11 +13,21 @@ part of openapi.api;
class PeopleResponseDto {
/// Returns a new [PeopleResponseDto] instance.
PeopleResponseDto({
this.hasNextPage,
required this.hidden,
this.people = const [],
required this.total,
});
/// This property was added in v1.110.0
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? hasNextPage;
int hidden;
List<PersonResponseDto> people;
@ -26,6 +36,7 @@ class PeopleResponseDto {
@override
bool operator ==(Object other) => identical(this, other) || other is PeopleResponseDto &&
other.hasNextPage == hasNextPage &&
other.hidden == hidden &&
_deepEquality.equals(other.people, people) &&
other.total == total;
@ -33,15 +44,21 @@ class PeopleResponseDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(hasNextPage == null ? 0 : hasNextPage!.hashCode) +
(hidden.hashCode) +
(people.hashCode) +
(total.hashCode);
@override
String toString() => 'PeopleResponseDto[hidden=$hidden, people=$people, total=$total]';
String toString() => 'PeopleResponseDto[hasNextPage=$hasNextPage, hidden=$hidden, people=$people, total=$total]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.hasNextPage != null) {
json[r'hasNextPage'] = this.hasNextPage;
} else {
// json[r'hasNextPage'] = null;
}
json[r'hidden'] = this.hidden;
json[r'people'] = this.people;
json[r'total'] = this.total;
@ -56,6 +73,7 @@ class PeopleResponseDto {
final json = value.cast<String, dynamic>();
return PeopleResponseDto(
hasNextPage: mapValueOfType<bool>(json, r'hasNextPage'),
hidden: mapValueOfType<int>(json, r'hidden')!,
people: PersonResponseDto.listFromJson(json[r'people']),
total: mapValueOfType<int>(json, r'total')!,