From 64538921af4bc948b63a0660ea204d54209de905 Mon Sep 17 00:00:00 2001 From: Justin LeBlanc <152868008+jrl351@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:41:06 +0000 Subject: [PATCH] Linter fixes (#360) * Linter fixes * One last lint issue * Remove dead code --- .../src/presentation/ui/auth/auth_bloc.dart | 4 ++-- .../presentation/ui/claims/claims_bloc.dart | 4 ++-- .../stacktrace_stream_manager.dart | 12 ------------ .../get_iden3comm_claims_use_case.dart | 18 ++++++++---------- 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/example/lib/src/presentation/ui/auth/auth_bloc.dart b/example/lib/src/presentation/ui/auth/auth_bloc.dart index 10adf5ed..4e8335e6 100644 --- a/example/lib/src/presentation/ui/auth/auth_bloc.dart +++ b/example/lib/src/presentation/ui/auth/auth_bloc.dart @@ -58,8 +58,8 @@ class AuthBloc extends Bloc { } try { - final Iden3MessageEntity iden3message = await _qrcodeParserUtils - .getIden3MessageFromQrCode(qrCodeResponse); + final Iden3MessageEntity iden3message = + await _qrcodeParserUtils.getIden3MessageFromQrCode(qrCodeResponse); emit(AuthState.loaded(iden3message)); String? privateKey = diff --git a/example/lib/src/presentation/ui/claims/claims_bloc.dart b/example/lib/src/presentation/ui/claims/claims_bloc.dart index 39d3dede..29a54c04 100644 --- a/example/lib/src/presentation/ui/claims/claims_bloc.dart +++ b/example/lib/src/presentation/ui/claims/claims_bloc.dart @@ -325,8 +325,8 @@ class ClaimsBloc extends Bloc { } 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")); diff --git a/lib/common/infrastructure/stacktrace_stream_manager.dart b/lib/common/infrastructure/stacktrace_stream_manager.dart index f5c92d47..44814d08 100644 --- a/lib/common/infrastructure/stacktrace_stream_manager.dart +++ b/lib/common/infrastructure/stacktrace_stream_manager.dart @@ -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() { diff --git a/lib/iden3comm/domain/use_cases/get_iden3comm_claims_use_case.dart b/lib/iden3comm/domain/use_cases/get_iden3comm_claims_use_case.dart index 74180a23..054410db 100644 --- a/lib/iden3comm/domain/use_cases/get_iden3comm_claims_use_case.dart +++ b/lib/iden3comm/domain/use_cases/get_iden3comm_claims_use_case.dart @@ -70,7 +70,6 @@ class GetIden3commClaimsUseCase for (ProofRequestEntity request in requests) { if (await _isProofCircuitSupported.execute( param: request.scope.circuitId)) { - List filters = await _iden3commCredentialRepository.getFilters(request: request); _stacktraceManager @@ -82,8 +81,8 @@ class GetIden3commClaimsUseCase genesisDid: param.genesisDid, profileNonce: param.profileNonce, privateKey: param.privateKey, - ), - ); + ), + ); // filter manually positive integer claimsFiltered = _filterManuallyIfPositiveInteger( @@ -191,7 +190,7 @@ class GetIden3commClaimsUseCase ProofScopeQueryRequest query = request.scope.query; Map? context = - request.context["@context"][0][query.type]["@context"]; + request.context["@context"][0][query.type]["@context"]; if (context == null) return claimsFiltered; Map requestMap = request.scope.query.credentialSubject!; @@ -215,11 +214,12 @@ class GetIden3commClaimsUseCase }); } - void _filterClaims(String operator, dynamic needle, String key, List claimsFiltered) { + void _filterClaims(String operator, dynamic needle, String key, + List claimsFiltered) { // Implement the filtering logic here, similar to what you have in your switch case claimsFiltered.removeWhere((element) { Map credentialSubject = - element.info["credentialSubject"]; + element.info["credentialSubject"]; dynamic value = _getNestedValue(credentialSubject, key); if (value != null) { BigInt valueBigInt = BigInt.parse(value); @@ -238,13 +238,11 @@ class GetIden3commClaimsUseCase return valueBigInt == BigInt.from(needle); case '\$in': List values = List.from(needle); - List stringList = - values.map((e) => e.toString()).toList(); + List stringList = values.map((e) => e.toString()).toList(); return !stringList.contains(value); case '\$nin': List values = List.from(needle); - List stringList = - values.map((e) => e.toString()).toList(); + List stringList = values.map((e) => e.toString()).toList(); return stringList.contains(value); } }