mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 12:23:44 +08:00
RepositoryInfo: Add serialization
This commit is contained in:
@ -13,7 +13,17 @@ class RepositoryInfo {
|
||||
String folderName;
|
||||
IconData iconData;
|
||||
|
||||
// Add serialization to json / and from
|
||||
RepositoryInfo.fromMap(Map<String, dynamic> map) {
|
||||
id = map['id'];
|
||||
folderName = map['folderName'];
|
||||
iconData = IconData(map['iconData'] as int);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
'id': id,
|
||||
'folderName': folderName,
|
||||
'iconData': iconData.codePoint,
|
||||
};
|
||||
}
|
||||
|
||||
// Make this info a change notifier where the current value is ?
|
||||
|
Reference in New Issue
Block a user