Initial commit: Captain Claude Mobile App
- 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>
This commit is contained in:
29
lib/models/user.dart
Normal file
29
lib/models/user.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
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(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user