правки лаунчера

This commit is contained in:
2026-03-22 14:15:50 +04:00
parent 8ed2b692b6
commit 4edfb52396
14 changed files with 533 additions and 54 deletions
@@ -17,6 +17,25 @@ final class LauncherSession {
);
}
Map<String, dynamic> toJson() {
return <String, dynamic>{
'access_token': accessToken,
'token_type': tokenType,
'expires_at': expiresAt?.toIso8601String(),
};
}
bool get hasAccessToken => accessToken.trim().isNotEmpty;
bool get isExpired {
final expiresAt = this.expiresAt;
if (expiresAt == null) {
return false;
}
return !expiresAt.toUtc().isAfter(DateTime.now().toUtc());
}
static DateTime? _parseDateTime(String? rawValue) {
if (rawValue == null || rawValue.isEmpty) {
return null;