When restoring a backup, the app tries to disconnect DiscordRPC but that gives an exception, when there is no live IPC socket to close.
`AnyhowException (AnyhowException(Failed to close to Discord IPC: Custom { kind: ConnectionRefused, error: "Couldn't retrieve the Discord IPC socket" }`
Previously, the same select bar and button styles were defined in both
`library_screen.dart` and `manga_detail_view.dart`, resulting in repeated code.
This commit extracts the select bar and its buttons into reusable widgets
to reduce duplication and improve readability and maintainability.
- variable `color`, to avoid passing `Theme.of(context).textTheme.bodyLarge!.color!` on every Icon in `bottomNavigationBar`
- No need to create variable `isLongPressed` and `chapterNameList` in `build()` and pass them to `_buildWidget()` if they are only going to be used there. Just create the variables inside `_buildWidget()`
- Why create second `isLongPressed` variable in `_buildWidget()` with the same value? Just use the first one.
The initialization of discordRPC on iOS and Android was leading to a grey screen (UnimplementedError), preventing the app to paint the Flutter UI.
The flutter_discord_rpc is only available on macOS, Linux and Windows.
This was unintentionally removed in d21dbbbc.
This caused fullscreen mode to persist when the user exited the anime player view before the video had started loading.
The fullscreen now correctly exits in the dispose method for desktop platforms again.
If the app is going to background or is about to be killed, the lastPageRead value is going to be saved, so the progress is not lost if the user leaves the app and the system kills it.
The else if condition is:
`itemType == ItemType.novel && chapter.url != null`
So the variable `headers` can never be `ref.read(headersProvider(source: manga.source!, lang: manga.lang!))` or `videoHeader`
- Remove the enableAniSkipStateProvider check, because it is already being checked by the caller (anime_player_view.dart, initState() line 353).
- Change ref.watch() to ref.read() as the user cannot change its value without exiting the video player. ref.watch() is meant to be used within reactive contexts.
When these methods were used to display images (migration screen, history screen, etc) the images (anime/manga covers and extension icons) were zoomable. You could (on a touch device) pinch to zoom.
And with the mouse you could get your cursor an on image and scroll up to zoom out and scroll down to zoom in.
This was not necessary confusing for the user.
The import of 'package:hive/hive.dart' is unnecessary
because all of the used elements are also provided
by the import of 'package:hive_flutter/adapters.dart'.
Collapse three `.position.listen` callbacks into a single
subscription to reduce per‑tick overhead and centralize all
position‑driven updates (current position, subtitle/audio init,
and skip‑phase logic) in one handler.
The variables `enableAniSkip`, `enableAutoSkip`,
`aniSkipTimeoutLength` and `skipIntroLength` are global settings.
The user cannot change them inside the video player.
So there's no need to watch them inside the _currentPosition listener.
fixed UTF8 bug
fixed infinite loading
added search bar to migration screen
migration screen now considers the pinned sources option
library now shows if the items are locally tracked or not
Before fixing the Category Removal Bug (commit 58537281), the "Default" Category would be empty when removing a populated category.
So when there is only one Category left, and the user hides that one Category, `tabCount` would be <= 0, leading to an Exception:
```
_AssertionError ('package:flutter/src/material/tab_controller.dart': Failed assertion: line 116 pos 15: 'initialIndex >= 0 && (length == 0 || initialIndex < length)': is not true.)
```
Now there is a check (`tabCount <= 0`), that IF tabCount is ever <= 0, it would show `_bodyWithoutCategories`.
When removing a category, the items inside the category were not being updated, removing the link to the removed category.
That lead to the items disappearance from the library.
Now the reference from the item to the deleted category is deleted. Those items show up in the "Default" category.
Merge `fetchMangaSourcesListProvider`, `fetchAnimeSourcesListProvider` and `fetchNovelSourcesListProvider` into a single Provider, `FetchItemSourcesListProvider`, reducing code duplication.
There was a bug when uninstalling an extension and trying to reinstall it, it didn't install.
You had to restart the app to reinstall the same extension again.
Now the provider is invalidated when reinstalling an uninstalled extension,
so the fetch logic is triggered correctly. Prevents stale cache issues from
Riverpod's keepAlive behavior.
```
Exception has occurred.
ArgumentError (Invalid argument(s): No host specified in URI )
```
at line 79:
`final req = await http.get(Uri.parse(source.sourceCodeUrl!));`
when source.sourceCodeUrl is empty.
The Button "Edit Categories" (now called "set Categories"), now opens the category select menu instead of the category edit menu.
This makes more sense in the library item detail view. For example you have the categories "Watching" and "Finished". You just finished an anime and you want to change its category directly in the detail view. Now you can.
Before you had to exit the detail view, go in to the library view, long press the item, tap the category button and then edit it there.
Fix exception when using "Select Widget Mode" of the Flutter Inspector:
```
Exception has occurred.
FlutterError (Tried to modify a provider while the widget tree was building.
If you are encountering this error, chances are you tried to modify a provider
in a widget life-cycle, such as but not limited to:
- build
- initState
- dispose
- didUpdateWidget
- didChangeDependencies
Modifying a provider inside those life-cycles is not allowed, as it could
lead to an inconsistent UI state. For example, two widgets could listen to the
same provider, but incorrectly receive different states.
To fix this problem, you have one of two solutions:
- (preferred) Move the logic for modifying your provider outside of a widget
life-cycle. For example, maybe you could update your provider inside a button's
onPressed instead.
- Delay your modification, such as by encapsulating the modification
in a `Future(() {...})`.
This will perform your update after the widget tree is done building.)
```
Resolved an issue where items could not be added to the tracker due to the use of an incorrect ID. This caused `parseTrackResponse()` to fail in locating the 'included' key within `jsonResponse`, leading to a null return. As a result, an exception was thrown in `tracker_widget.dart` at line 134 when accessing `widget.trackRes.title!,` triggering a _TypeError (Null check operator used on a null value)_.
- Added VirtualMangaList widget for displaying manga pages in a virtual scrolling list.
- Introduced VirtualPageManager to handle page loading, caching, and memory optimization.
- Created VirtualReaderView to integrate virtual scrolling with PhotoView for enhanced reading experience.
- Implemented page loading states and memory cleanup mechanisms in VirtualPageManager.
- Added debug information overlay for monitoring virtual page manager statistics.
- Enhanced user experience with callbacks for chapter transitions and page changes.
- Introduced `TransitionViewPaged` and `TransitionViewVertical` widgets to handle chapter transitions.
- Created `ChapterTransitionPage` widget to display transition information between chapters.
- Updated reader view logic to incorporate transition pages when navigating chapters.
- Enhanced `UChapDataPreload` model to support transition states and next chapter information.
feat(localization): add chapter transition messages in multiple languages
fix(dependencies): update Dart SDK and dependencies
- Updated Dart SDK constraint to ^3.8.0.
- Changed `epubx` dependency to use the latest version from GitHub.
- Move manageExternalStorage inside if (android), as it is Android only.
- Cache permission state, to only check for permission once per app start preventing redundant checks.
- Made `initDB` fully async to enhance efficiency and avoid sync operations
Extract `CustomMaterialPlayOrPauseButton` class from *mobile.dart* and `CustomMaterialDesktopPlayOrPauseButton` class from *desktop.dart* into *play_or_pause_button.dart* to eliminate code duplication and improve maintainability.
Prevent an AssertionError in the Slider widget when the skip duration
button causes the value to exceed the video's maximum duration.
Clamp the Slider's value to the range [0, max]
using `clamp(0.0, maxValue).toDouble()` to ensure it stays within bounds.
Exception example:
```
Exception has occurred.
_AssertionError ('package:flutter/src/material/slider.dart': Failed assertion: line 199 pos 10: 'value >= min && value <= max': Value 1410000.0 is not between minimum 0.0 and maximum 1409533.0)
```
- Resolved the same timestamp conversion issue that affected MyAnimeList.
- Previously, seconds-to-milliseconds conversion and `DateTime.now()` were applied twice — once on `login()` and once in `_getAccessToken()` — resulting in incorrect expiry dates (e.g., year 57349).
- Updated Kitsu’s URL from `.io` to `.app`.
Remove incorrect expiresIn calculation in `OAuth.fromJson`. The `login()`
function of the MyAnimeList class already sets expiresIn as an absolute timestamp in milliseconds.
Multiplying by 1000 and adding the current timestamp in fromJson caused
expiresIn to be inflated, making the expiration check in `_getAccessToken()`
always false, skipping token refresh and returning an invalid token.
Users can now add Mangas/Animes to a **manually** created Mangayomi/local folder.
Feature as described:
```
App Home Location/
local/
Manga Title/
cover.jpg (optional)
Chapter 1/
1.jpg
...
Chapter 2.cbz
...
Anime Title/
cover.png (optional)
Episode 1.mp4
Episode 2.mkv
```
The folder (if exist) will be scanned once per app start.
**Supported filetypes:** (taken from lib/modules/library/providers/local_archive.dart, line 98)
```
Videotypes: mp4, mov, avi, flv, wmv, mpeg, mkv
Imagetypes: jpg, jpeg, png, webp
Archivetypes: cbz, zip, cbt, tar
```
getMangaChapterDirectory() now accepts an optional mangaMainDirectory
to avoid calling getMangaMainDirectory() and thus getDirectory() twice in places where both methods are called successively.
- New SettingsSection class to remove code duplication
- Moved the big ListTile+Dialog blocks in their own private methods:
_buildLanguageTile(),
_buildFontTile(),
_buildRelativeTimestampTile(),
_buildDateFormatTile()
Show the FollowSystemThemeButton always on first positon, whether ON or OFF.
Before, the FollowSystemThemeButton was on first position if it was ON and in second position if it was OFF (DarkModeButton took the first position)
Added a checkbox "ignoreFiltersOnSearch" to the library search, so when checked, the whole library will be searched, not just the filtered library (Downloaded, Unwatched/Unread, Started, Bookmarked)
+ added some comments
- getCookiesPref() and deleteAllCookies():
Avoid repeated parsing of `Uri.parse(url).host` by creating a variable.
- httpClient():
cache RhttpCompatibleClients and add default IOClient fallback.
- shouldAttemptRetryOnResponse():
Added a delay to avoid busy looping.
- Add `ChapterWithPages` model and `MangaReaderController` (FamilyAsyncNotifier)
to load chapter + pages in a single provider (`mangaReaderProvider`)
- Replace synchronous Isar fetch in `MangaReaderView` with `ref.watch(mangaReaderProvider)`
- Unify loading, error, and data states using a shared `scaffoldWith` helper
- Remove duplicated `Scaffold`/`AppBar` boilerplate and inline SystemChrome restore logic
- Simplify error handling
Flutter already knows how to switch the theme automatically.
No need to listen to onPlatformBrightnessChanged.
This works on cold start.
Works when app is running and system theme changes.
And works when backup was done on different system theme and restore is being done on different system theme.
At line 963, when scrolling too fast in manga reader and page didn't load before.
```
═══════ Exception caught by foundation library ════════════════════════════════
The following StateError was thrown while dispatching notifications for ValueNotifier<Iterable<ItemPosition>>:
Bad state: No element
```
```
════════ Exception caught by widgets library ═══════════════════════════════════
The following UnsupportedError was thrown building CircularProgressIndicator(100.0%, dependencies: [InheritedCupertinoTheme, _InheritedTheme, _LocalizationsScope-[GlobalKey#3b6da]], state: _CircularProgressIndicatorState#8c03b(ticker inactive)):
Unsupported operation: Infinity or NaN toInt
The relevant error-causing widget was:
CircularProgressIndicator CircularProgressIndicator (package:mangayomi/modules/manga/reader/widgets/circular_progress_indicator_animate_rotate.dart:56:27)
```