forked from thunder-app/thunder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_settings_state.dart
45 lines (37 loc) · 1.42 KB
/
user_settings_state.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
part of 'user_settings_bloc.dart';
enum UserSettingsStatus { initial, blocking, success, failure, revert, failedRevert }
class UserSettingsState extends Equatable {
const UserSettingsState({
this.status = UserSettingsStatus.initial,
this.personBlocks = const [],
this.communityBlocks = const [],
this.personBeingBlocked = 0,
this.communityBeingBlocked = 0,
this.errorMessage = '',
});
final UserSettingsStatus status;
final List<PersonSafe> personBlocks;
final List<CommunitySafe> communityBlocks;
final int personBeingBlocked;
final int communityBeingBlocked;
final String? errorMessage;
UserSettingsState copyWith({
required UserSettingsStatus status,
List<PersonSafe>? personBlocks,
List<CommunitySafe>? communityBlocks,
int? personBeingBlocked,
int? communityBeingBlocked,
String? errorMessage,
}) {
return UserSettingsState(
status: status,
personBlocks: personBlocks ?? this.personBlocks,
communityBlocks: communityBlocks ?? this.communityBlocks,
personBeingBlocked: personBeingBlocked ?? this.personBeingBlocked,
communityBeingBlocked: communityBeingBlocked ?? this.communityBeingBlocked,
errorMessage: errorMessage ?? this.errorMessage,
);
}
@override
List<Object?> get props => [status, personBlocks, communityBlocks, personBeingBlocked, communityBeingBlocked, errorMessage];
}