TF-3278 Handle open app via deep link at MailboxDashboard screen

This commit is contained in:
dab246
2024-11-22 23:30:37 +07:00
committed by Dat H. Pham
parent 8022559bc2
commit 223fdbf1fb
59 changed files with 1058 additions and 429 deletions
+4 -38
View File
@@ -1,45 +1,11 @@
import 'package:equatable/equatable.dart';
import 'package:model/model.dart';
import 'package:tmail_ui_user/main/deep_links/deep_link_action_type.dart';
class DeepLinkData with EquatableMixin {
final String action;
final String? accessToken;
final String? refreshToken;
final String? idToken;
final int? expiresIn;
final String? username;
final DeepLinkActionType actionType;
DeepLinkData({
required this.action,
this.accessToken,
this.refreshToken,
this.idToken,
this.expiresIn,
this.username,
});
bool isValidToken() => accessToken?.isNotEmpty == true && username?.isNotEmpty == true;
TokenOIDC getTokenOIDC() {
final expiredTime = expiresIn == null
? null
: DateTime.now().add(Duration(seconds: expiresIn!));
return TokenOIDC(
accessToken!,
TokenId(idToken ?? ''),
refreshToken ?? '',
expiredTime: expiredTime,
);
}
DeepLinkData({required this.actionType});
@override
List<Object?> get props => [
action,
accessToken,
refreshToken,
idToken,
expiresIn,
username,
];
List<Object?> get props => [actionType];
}