better account page (logged in)
This commit is contained in:
35
flutter/lib/models/client.dart
Normal file
35
flutter/lib/models/client.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
class Client {
|
||||
final String clientID;
|
||||
final String userID;
|
||||
final String type;
|
||||
final String fcmToken;
|
||||
final String timestampCreated;
|
||||
final String agentModel;
|
||||
final String agentVersion;
|
||||
|
||||
const Client({
|
||||
required this.clientID,
|
||||
required this.userID,
|
||||
required this.type,
|
||||
required this.fcmToken,
|
||||
required this.timestampCreated,
|
||||
required this.agentModel,
|
||||
required this.agentVersion,
|
||||
});
|
||||
|
||||
factory Client.fromJson(Map<String, dynamic> json) {
|
||||
return Client(
|
||||
clientID: json['client_id'] as String,
|
||||
userID: json['user_id'] as String,
|
||||
type: json['type'] as String,
|
||||
fcmToken: json['fcm_token'] as String,
|
||||
timestampCreated: json['timestamp_created'] as String,
|
||||
agentModel: json['agent_model'] as String,
|
||||
agentVersion: json['agent_version'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
static List<Client> fromJsonArray(List<dynamic> jsonArr) {
|
||||
return jsonArr.map<Client>((e) => Client.fromJson(e as Map<String, dynamic>)).toList();
|
||||
}
|
||||
}
|
41
flutter/lib/models/keytoken.dart
Normal file
41
flutter/lib/models/keytoken.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
class KeyToken {
|
||||
final String keytokenID;
|
||||
final String name;
|
||||
final String timestampCreated;
|
||||
final String? timestampLastused;
|
||||
final String ownerUserID;
|
||||
final bool allChannels;
|
||||
final List<String> channels;
|
||||
final String permissions;
|
||||
final int messagesSent;
|
||||
|
||||
const KeyToken({
|
||||
required this.keytokenID,
|
||||
required this.name,
|
||||
required this.timestampCreated,
|
||||
required this.timestampLastused,
|
||||
required this.ownerUserID,
|
||||
required this.allChannels,
|
||||
required this.channels,
|
||||
required this.permissions,
|
||||
required this.messagesSent,
|
||||
});
|
||||
|
||||
factory KeyToken.fromJson(Map<String, dynamic> json) {
|
||||
return KeyToken(
|
||||
keytokenID: json['keytoken_id'] as String,
|
||||
name: json['name'] as String,
|
||||
timestampCreated: json['timestamp_created'] as String,
|
||||
timestampLastused: json['timestamp_lastused'] as String?,
|
||||
ownerUserID: json['owner_user_id'] as String,
|
||||
allChannels: json['all_channels'] as bool,
|
||||
channels: (json['channels'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
permissions: json['permissions'] as String,
|
||||
messagesSent: json['messages_sent'] as int,
|
||||
);
|
||||
}
|
||||
|
||||
static List<KeyToken> fromJsonArray(List<dynamic> jsonArr) {
|
||||
return jsonArr.map<KeyToken>((e) => KeyToken.fromJson(e as Map<String, dynamic>)).toList();
|
||||
}
|
||||
}
|
@@ -28,4 +28,8 @@ class Subscription {
|
||||
confirmed: json['confirmed'] as bool,
|
||||
);
|
||||
}
|
||||
|
||||
static List<Subscription> fromJsonArray(List<dynamic> jsonArr) {
|
||||
return jsonArr.map<Subscription>((e) => Subscription.fromJson(e as Map<String, dynamic>)).toList();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user