feat(core,bridge): add get_icon with coalescing and negative cache
- FileTransferService::get_icon() mirrors get_avatar pattern - ChanoraSession::get_icon() delegates through FileTransferService - Bridge download_icon() exposed for Flutter - Dart downloadIcon() shim added - Uses PREFIX_ICON (ic_<crc32u>) cache key format - 1 new unit test (cached icon hit)
This commit is contained in:
@@ -252,6 +252,15 @@ Future<List<int>?> downloadAvatar({
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<int>?> downloadIcon({required BigInt iconId}) {
|
||||
final api = RustLib.instance.api as dynamic;
|
||||
try {
|
||||
return api.crateApiDownloadIcon(iconId: iconId) as Future<List<int>?>;
|
||||
} on NoSuchMethodError {
|
||||
return Future.value();
|
||||
}
|
||||
}
|
||||
|
||||
/// List persisted bookmarks.
|
||||
Future<List<BridgeBookmark>> listBookmarks() =>
|
||||
RustLib.instance.api.crateApiListBookmarks();
|
||||
|
||||
Reference in New Issue
Block a user