-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/17-pub-dependencies
# Conflicts: # pubspec.lock
- Loading branch information
Showing
40 changed files
with
1,748 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
-dontwarn com.google.android.play.core.splitcompat.SplitCompatApplication | ||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallException | ||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManager | ||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallManagerFactory | ||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest$Builder | ||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallRequest | ||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallSessionState | ||
-dontwarn com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener | ||
-dontwarn com.google.android.play.core.tasks.OnFailureListener | ||
-dontwarn com.google.android.play.core.tasks.OnSuccessListener | ||
-dontwarn com.google.android.play.core.tasks.Task | ||
-dontwarn com.google.api.client.http.GenericUrl | ||
-dontwarn com.google.api.client.http.HttpHeaders | ||
-dontwarn com.google.api.client.http.HttpRequest | ||
-dontwarn com.google.api.client.http.HttpRequestFactory | ||
-dontwarn com.google.api.client.http.HttpResponse | ||
-dontwarn com.google.api.client.http.HttpTransport | ||
-dontwarn com.google.api.client.http.javanet.NetHttpTransport$Builder | ||
-dontwarn com.google.api.client.http.javanet.NetHttpTransport | ||
-dontwarn javax.naming.Binding | ||
-dontwarn javax.naming.NamingEnumeration | ||
-dontwarn javax.naming.NamingException | ||
-dontwarn javax.naming.directory.Attribute | ||
-dontwarn javax.naming.directory.Attributes | ||
-dontwarn javax.naming.directory.DirContext | ||
-dontwarn javax.naming.directory.InitialDirContext | ||
-dontwarn javax.naming.directory.SearchControls | ||
-dontwarn javax.naming.directory.SearchResult | ||
-dontwarn org.bouncycastle.jsse.BCSSLParameters | ||
-dontwarn org.bouncycastle.jsse.BCSSLSocket | ||
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider | ||
-dontwarn org.conscrypt.Conscrypt$Version | ||
-dontwarn org.conscrypt.Conscrypt | ||
-dontwarn org.conscrypt.ConscryptHostnameVerifier | ||
-dontwarn org.joda.time.Instant | ||
-dontwarn org.openjsse.javax.net.ssl.SSLParameters | ||
-dontwarn org.openjsse.javax.net.ssl.SSLSocket | ||
-dontwarn org.openjsse.net.ssl.OpenJSSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extensions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:autogram_sign/autogram_sign.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart' show Cubit; | ||
import 'package:injectable/injectable.dart'; | ||
import 'package:logging/logging.dart'; | ||
|
||
import '../ui/fragment/document_validation_fragment.dart'; | ||
import 'document_validation_state.dart'; | ||
import 'preview_document_cubit.dart'; | ||
|
||
export 'document_validation_state.dart'; | ||
|
||
/// Cubit for the [DocumentValidationFragment] with [validateDocument] function. | ||
/// | ||
/// See also: | ||
/// - [PreviewDocumentCubit] | ||
@injectable | ||
class DocumentValidationCubit extends Cubit<DocumentValidationState> { | ||
static final _log = Logger((DocumentValidationCubit).toString()); | ||
|
||
final IAutogramService _service; | ||
|
||
DocumentValidationCubit({ | ||
required IAutogramService service, | ||
}) : _service = service, | ||
super(const DocumentValidationInitialState()); | ||
|
||
Future<void> validateDocument(String documentId) async { | ||
_log.info("Requesting to validate Document Id: '$documentId'."); | ||
emit(const DocumentValidationLoadingState()); | ||
|
||
try { | ||
final response = await _service.getDocumentValidation(documentId); | ||
|
||
_log.info( | ||
"Got Document validation: (signatureForm: ${response.signatureForm?.value}, signatures: ${response.signatures?.map((e) => e.validationResult.value)})."); | ||
|
||
emit(DocumentValidationSuccessState(response)); | ||
} catch (error, stackTrace) { | ||
if (error is ServiceException && | ||
error.errorCode == "DOCUMENT_NOT_SIGNED") { | ||
_log.info("Cannot validate unsigned Document."); | ||
|
||
emit(const DocumentValidationNotSignedState()); | ||
} else { | ||
_log.severe("Error validating Document.", error, stackTrace); | ||
|
||
emit(DocumentValidationErrorState(error)); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import 'package:autogram_sign/autogram_sign.dart' | ||
show DocumentValidationResponseBody; | ||
import 'package:flutter/foundation.dart'; | ||
|
||
import 'document_validation_cubit.dart'; | ||
|
||
/// State for [DocumentValidationCubit]. | ||
@immutable | ||
sealed class DocumentValidationState { | ||
const DocumentValidationState(); | ||
|
||
@override | ||
String toString() { | ||
return "$runtimeType()"; | ||
} | ||
} | ||
|
||
class DocumentValidationInitialState extends DocumentValidationState { | ||
const DocumentValidationInitialState(); | ||
} | ||
|
||
class DocumentValidationLoadingState extends DocumentValidationState { | ||
const DocumentValidationLoadingState(); | ||
} | ||
|
||
class DocumentValidationErrorState extends DocumentValidationState { | ||
final Object error; | ||
|
||
const DocumentValidationErrorState(this.error); | ||
|
||
@override | ||
String toString() { | ||
return "$runtimeType(error: $error)"; | ||
} | ||
} | ||
|
||
class DocumentValidationNotSignedState extends DocumentValidationState { | ||
const DocumentValidationNotSignedState(); | ||
} | ||
|
||
class DocumentValidationSuccessState extends DocumentValidationState { | ||
final DocumentValidationResponseBody response; | ||
|
||
const DocumentValidationSuccessState(this.response); | ||
|
||
@override | ||
String toString() { | ||
return "$runtimeType(response: $response)"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.