student-legacy/refilc/lib/models/linked_account.dart
2024-02-27 22:42:16 +01:00

36 lines
717 B
Dart

enum AccountType {
apple,
google,
meta,
qwid,
}
class LinkedAccount {
AccountType type;
String username;
String displayName;
String id;
LinkedAccount({
required this.type,
required this.username,
required this.displayName,
required this.id,
});
factory LinkedAccount.fromJson(Map json) {
return LinkedAccount(
type: json['type'] == 'apple'
? AccountType.apple
: json['type'] == 'google'
? AccountType.google
: json['type'] == 'meta'
? AccountType.meta
: AccountType.qwid,
username: json['username'],
displayName: json['display_name'],
id: json['id'],
);
}
}