Skip to content

Commit

Permalink
Linter fixes (#360)
Browse files Browse the repository at this point in the history
* Linter fixes

* One last lint issue

* Remove dead code
  • Loading branch information
jrl351 authored Jan 10, 2024
1 parent 2607833 commit 6453892
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
4 changes: 2 additions & 2 deletions example/lib/src/presentation/ui/auth/auth_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
}

try {
final Iden3MessageEntity iden3message = await _qrcodeParserUtils
.getIden3MessageFromQrCode(qrCodeResponse);
final Iden3MessageEntity iden3message =
await _qrcodeParserUtils.getIden3MessageFromQrCode(qrCodeResponse);
emit(AuthState.loaded(iden3message));

String? privateKey =
Expand Down
4 changes: 2 additions & 2 deletions example/lib/src/presentation/ui/claims/claims_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ class ClaimsBloc extends Bloc<ClaimsEvent, ClaimsState> {
}

try {
final Iden3MessageEntity iden3message = await _qrcodeParserUtils
.getIden3MessageFromQrCode(qrCodeResponse!);
final Iden3MessageEntity iden3message =
await _qrcodeParserUtils.getIden3MessageFromQrCode(qrCodeResponse!);
emit(ClaimsState.qrCodeScanned(iden3message));
} catch (error) {
emit(const ClaimsState.error("Scanned code is not valid"));
Expand Down
12 changes: 0 additions & 12 deletions lib/common/infrastructure/stacktrace_stream_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,6 @@ class StacktraceManager {
/// Clear the stacktrace
void clear() {
return;
_stacktrace = '';
_errorTrace = '';
_stacktraceStreamController.add('');
_errorStreamController.add(_errorTrace);
if (!isEnabled) {
return;
}

if (_isBoxOpen()) {
final box = Hive.box(_stacktraceBoxName);
box.clear();
}
}

void clearStacktrace() {
Expand Down
18 changes: 8 additions & 10 deletions lib/iden3comm/domain/use_cases/get_iden3comm_claims_use_case.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class GetIden3commClaimsUseCase
for (ProofRequestEntity request in requests) {
if (await _isProofCircuitSupported.execute(
param: request.scope.circuitId)) {

List<FilterEntity> filters =
await _iden3commCredentialRepository.getFilters(request: request);
_stacktraceManager
Expand All @@ -82,8 +81,8 @@ class GetIden3commClaimsUseCase
genesisDid: param.genesisDid,
profileNonce: param.profileNonce,
privateKey: param.privateKey,
),
);
),
);

// filter manually positive integer
claimsFiltered = _filterManuallyIfPositiveInteger(
Expand Down Expand Up @@ -191,7 +190,7 @@ class GetIden3commClaimsUseCase

ProofScopeQueryRequest query = request.scope.query;
Map<String, dynamic>? context =
request.context["@context"][0][query.type]["@context"];
request.context["@context"][0][query.type]["@context"];
if (context == null) return claimsFiltered;

Map<String, dynamic> requestMap = request.scope.query.credentialSubject!;
Expand All @@ -215,11 +214,12 @@ class GetIden3commClaimsUseCase
});
}

void _filterClaims(String operator, dynamic needle, String key, List<ClaimEntity> claimsFiltered) {
void _filterClaims(String operator, dynamic needle, String key,
List<ClaimEntity> claimsFiltered) {
// Implement the filtering logic here, similar to what you have in your switch case
claimsFiltered.removeWhere((element) {
Map<String, dynamic> credentialSubject =
element.info["credentialSubject"];
element.info["credentialSubject"];
dynamic value = _getNestedValue(credentialSubject, key);
if (value != null) {
BigInt valueBigInt = BigInt.parse(value);
Expand All @@ -238,13 +238,11 @@ class GetIden3commClaimsUseCase
return valueBigInt == BigInt.from(needle);
case '\$in':
List<dynamic> values = List.from(needle);
List<String> stringList =
values.map((e) => e.toString()).toList();
List<String> stringList = values.map((e) => e.toString()).toList();
return !stringList.contains(value);
case '\$nin':
List<dynamic> values = List.from(needle);
List<String> stringList =
values.map((e) => e.toString()).toList();
List<String> stringList = values.map((e) => e.toString()).toList();
return stringList.contains(value);
}
}
Expand Down

0 comments on commit 6453892

Please sign in to comment.