progress in calendar sync
This commit is contained in:
35
refilc/lib/models/linked_account.dart
Normal file
35
refilc/lib/models/linked_account.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
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'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user