TF-3278 Handle open app via deep link at MailboxDashboard screen
This commit is contained in:
@@ -52,6 +52,7 @@ export 'utils/broadcast_channel/broadcast_channel.dart';
|
||||
export 'utils/list_utils.dart';
|
||||
export 'utils/mail/domain.dart';
|
||||
export 'utils/mail/mail_address.dart';
|
||||
export 'utils/application_manager.dart';
|
||||
export 'utils/preview_eml_file_utils.dart';
|
||||
|
||||
// Views
|
||||
|
||||
@@ -2,7 +2,18 @@ import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
|
||||
typedef OnFailureCallback = void Function(Failure? failure);
|
||||
typedef OnSuccessCallback<T> = void Function(T success);
|
||||
|
||||
extension EitherViewStateExtension on Either<Failure, Success> {
|
||||
void foldSuccess<T>({
|
||||
required OnSuccessCallback<T> onSuccess,
|
||||
required OnFailureCallback onFailure,
|
||||
}) {
|
||||
fold(onFailure,
|
||||
(success) => success is T ? onSuccess(success as T) : onFailure(null));
|
||||
}
|
||||
|
||||
dynamic foldSuccessWithResult<T>() {
|
||||
return fold(
|
||||
(failure) => failure,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'app_logger.dart';
|
||||
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:core/domain/exceptions/string_exception.dart';
|
||||
|
||||
class StringConvert {
|
||||
@@ -17,6 +16,15 @@ class StringConvert {
|
||||
return text ?? '';
|
||||
}
|
||||
|
||||
static String decodeBase64ToString(String text) {
|
||||
try {
|
||||
return utf8.decode(base64Decode(text));
|
||||
} catch (e) {
|
||||
logError('StringConvert::decodeBase64ToString:Exception = $e');
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
static List<String> extractStrings(String input) {
|
||||
try {
|
||||
// Check if the input is URL encoded
|
||||
|
||||
Reference in New Issue
Block a user