RepositoryInfo: Add serialization

This commit is contained in:
Vishesh Handa
2021-02-12 15:39:08 +01:00
parent a92f5532b8
commit 61f71fcdfe

View File

@ -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 ?