All checks were successful
ci/woodpecker/push/flutterBuild Pipeline was successful
43 lines
No EOL
1.1 KiB
Dart
43 lines
No EOL
1.1 KiB
Dart
part of 'search_bloc.dart';
|
|
|
|
enum SearchStatus { initial, success, failure }
|
|
|
|
class SearchState extends Equatable {
|
|
const SearchState({
|
|
this.queryString = "",
|
|
this.status = SearchStatus.initial,
|
|
this.repos = const <Repository>[],
|
|
this.loadedPages = 0,
|
|
this.hasReachedMax = false,
|
|
this.error_message = null
|
|
});
|
|
final String queryString;
|
|
final SearchStatus status;
|
|
final List<Repository> repos;
|
|
final int loadedPages;
|
|
final bool hasReachedMax;
|
|
final String? error_message;
|
|
|
|
SearchState copyWith({
|
|
String? queryString,
|
|
SearchStatus? status,
|
|
List<Repository>? repos,
|
|
int? loadedPages,
|
|
bool? hasReachedMax,
|
|
String? error_message,
|
|
}) {
|
|
return SearchState(
|
|
queryString: queryString ?? this.queryString,
|
|
status: status ?? this.status,
|
|
repos: repos ?? this.repos,
|
|
loadedPages: loadedPages ?? this.loadedPages,
|
|
hasReachedMax: hasReachedMax ?? this.hasReachedMax,
|
|
error_message: error_message ?? this.error_message,
|
|
);
|
|
}
|
|
|
|
|
|
@override
|
|
List<Object> get props => [status, repos, hasReachedMax];
|
|
|
|
} |