- Flutter app with chat and terminal screens - WebSocket integration for real-time chat - xterm integration for screen sessions - Markdown rendering with code blocks - JWT authentication Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
603 B
Dart
30 lines
603 B
Dart
class User {
|
|
final String username;
|
|
final String token;
|
|
final DateTime expiresAt;
|
|
|
|
User({
|
|
required this.username,
|
|
required this.token,
|
|
required this.expiresAt,
|
|
});
|
|
|
|
bool get isExpired => DateTime.now().isAfter(expiresAt);
|
|
|
|
factory User.fromJson(Map<String, dynamic> json) {
|
|
return User(
|
|
username: json['username'],
|
|
token: json['token'],
|
|
expiresAt: DateTime.parse(json['expires_at']),
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'username': username,
|
|
'token': token,
|
|
'expires_at': expiresAt.toIso8601String(),
|
|
};
|
|
}
|
|
}
|