-
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.
* Prepare DocumentValidationStrip * Update change log + version * pub upgrade * Prepare separate DocumentValidationFragment * Made response nullable * Update value getter * pub upgrade * Impl. also case for not signed document * Update impl. to work with latest API client * Update UI to display signatures * Impl. custom AVM Chip widget * Simplify code to use type alias * Update AGP for latest Android Studio support * Update existing code * Update paddings * Extract PreviewDocumentFragment * Screen uses two separate fragments with its onw lifecycle * Include new feature in main screen body * Impl strip hiding on tap * Update DocumentValidationInfo label * Update padding * Using AVM modal bottom sheet for list * Prepare CertificateDetails * Displaying only certificate CN in labels * Rename one widget * Extract strings * Cleanup ctor * Update change log * Tune Chip UX * Tune validation info strip UI * Explicitly specify compatible NDK version * Setup ProGuard to fix Android build * Cherry pick e6e69ce Fix infinite loading state for remote signing * Cleanup --------- Co-authored-by: mkepes <[email protected]>
- Loading branch information
1 parent
e8b3fef
commit dba8431
Showing
33 changed files
with
1,507 additions
and
284 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,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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.