Refactored the bridge to use load the JVM in a separate Isolate that receives messages in a queue executing them, this way it doesn't block the UI thread

This commit is contained in:
2025-10-21 02:09:41 +01:00
parent f6e8313e94
commit 0bbf59fda0
4 changed files with 564 additions and 159 deletions

View File

@@ -0,0 +1,35 @@
class JniIsolateMessage {
final int id;
final JniIsolateMessageType type;
final Map<String, dynamic> args;
JniIsolateMessage({required this.id, required this.type, required this.args});
}
class JniIsolateResponse {
final int id;
final dynamic results;
JniIsolateResponse({required this.id, this.results});
}
class JniIsolateError {
final int id;
final String error;
final String stackTrace;
JniIsolateError({required this.id, required this.error, required this.stackTrace});
}
enum JniIsolateMessageType {
getAnimeSearchResults,
getMangaSearchResults,
getEpisodeList,
getChapterList,
getVideoList,
getPageList,
loadAnimeExtension,
loadMangaExtension,
unloadAnimeExtension,
unloadMangaExtension,
}