Files
app-legacy/refilc/lib/models/linked_account.dart
balazsmanus@chameleon c182fbec2b jo vicc
2025-02-28 15:23:44 +01:00

36 lines
686 B
Dart

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