mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 20:43:20 +08:00
RepositoryInfo: Add serialization
This commit is contained in:
@ -13,7 +13,17 @@ class RepositoryInfo {
|
|||||||
String folderName;
|
String folderName;
|
||||||
IconData iconData;
|
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 ?
|
// Make this info a change notifier where the current value is ?
|
||||||
|
Reference in New Issue
Block a user