This commit improves memory management, reduces redundant interpreter
instantiation, and standardizes service usage patterns.
- Add `dispose()` to `ExtensionService` interface and implement it across
Dart, JS, LNReader, and Mihon services.
- Replace repeated interpreter creation in `DartExtensionService` with a
persistent `_interpreter` instance initialized once in the constructor.
- Add disposal logic for JS DOM selector and Cheerio instances to prevent
memory leaks.
- Introduce `withExtensionService()` helper to ensure services are always
disposed after use.
- Update call sites across the codebase to use `withExtensionService()`
or manual try/finally disposal.
- Improve isolate service message handling by extracting `responsePort`
earlier.
- Ensure safer defaults (e.g., returning empty lists, const lists) when
service calls fail.
- Replace list→set→list conversions with LinkedHashSet for stable ordering
- Ensure PageUrl uniqueness based on URL
- Ensure Video uniqueness based on url + originalUrl
- Add null‑safety checks when building PageUrl and Video objects
- Improve readability and reduce unnecessary allocations
- Introduce _addLog() helper to manage log insertion
- Enforce a maximum log history of 200 entries to prevent unbounded memory growth
- Replace direct _logsNotifier.value.add(event) with safe, immutable-style list update
- Improve log handling consistency and avoid mutating notifier state in place
- Add StreamSubscription to manage ReceivePort listener lifecycle
- Introduce handshake timeout when waiting for isolate SendPort to prevent hangs
- Add response timeout in get<T>() to avoid indefinitely waiting for isolate replies
- Replace direct ReceivePort.listen with tracked subscription for safer cleanup
- Improve error handling for invalid or missing isolate responses
- Strengthen isolate startup reliability and shutdown consistency
- new file item_type_filters.dart for the hiddenItemTypes function.
- reduces code duplication in statistics_screen, categories_screen and base_library_tab_screen
The "Show extensions" Button was not working properly when categories were hidden.
An Exception would throw:
```
_AssertionError ('package:flutter/src/material/tab_controller.dart': Failed assertion: line 202 pos 12: 'value >= 0 && (value < length || length == 0)': is not true.)
```
And jump to the end of the tab list regardless of where you clicked the button.
- Extract localizedItemType() from `base_library_tab_screen.dart`
- Add localizedSources() and localizedExtensions() for browse_screen.dart
- Reduce if-statements in statistics_screen.dart
- Reduce if-statements in categories_screen.dart
- Reduce if-statements in browse_screen.dart
- Change _tabList String-list to be a list of ItemType
- Change its name to _visibleTabTypes
- Use that list in getCurrentItemType(), instead of creating a new list
Use getCurrentItemType() method to determine the ItemType of the current tab instead of the conditional with `_tabBarController.index`, which doesn't take into account that there could be hidden tabs.
- Use the logger to log failed updates
- After the update-botToast another botToast is being spawned to show exactly which manga(s) couldn't be updated.
- Remove the doWhile loop because it is unnecessary. The condition of mangaList.length == numbers is always true, meaning it only runs once.