ReaderMokuroSource class

A media source that allows the user to read manga processed by Mokuro.

Inheritance

Properties

aspectRatio double
Aspect ratio of media items.
read-onlyoverride
currentExtraData String?
This is used to hold data for generating images and audio.
read-onlyinherited
currentMediaItem MediaItem
Supplies a media item that can be used for tracking and updating history, as well as generating video and audio with timestamp information. This should be uniquely implemented for each source. Some sources may want to generate their media item based on current playback information or progress.
read-onlyinherited
currentSentence JidoujishoTextSelection
Supplies a sentence that can be used for the sentence field when making a card while this source is active. Can be set with setCurrentSentence and clearCurrentSentence in a source page.
read-onlyinherited
description String
A longer description of what the source can do, or details left by or regarding the developer.
finalinherited
descriptionLocalisation Map<String, String>
Localisations for this source, where the key is a locale tag and the value is the description of the enhancement. If the value for the current locale is non-null, it will be used instead of description.
finalinherited
extendPageBeyondNavigationBar bool
Whether or not to add to extend the webpage beyond the navigation bar. This may be helpful for devices that don't have difficulty accessing the top bar (i.e. don't have a teardrop notch).
read-only
hashCode int
The hash code for this object.
read-onlyinherited
highlightOnTap bool
Whether the reader will highlight words on tap.
read-only
icon IconData
An icon that will show the enhancement if activated by the user in the quick menu.
finalinherited
implementsHistory bool
Whether or not this media source allows adding items to media history. Note that some media sources produce a history of media items but do not require this to be set true. For example, the reader fetches its history from a source other than the actual internal media history system provided by the media source framework. In such cases, this should be set as false. Setting this as true results to a media item being added to history when media is opened.
finalinherited
implementsSearch bool
Whether or not this media source has a search function. If false, this media source will have an action executed by onSearchBarTap.
finalinherited
mediaType MediaType
The media type that this source is for.
finalinherited
overridesAutoAudio bool
Whether or not a media source overrides the auto audio enhancement. See generateAudio.
finalinherited
overridesAutoImage bool
Whether or not a media source overrides the auto image enhancement. See generateImages.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
shouldGenerateAudio bool
Gets whether or not a media source should currently supply audio.
read-onlyinherited
shouldGenerateImage bool
Gets whether or not a media source should currently supply images.
read-onlyinherited
sourceName String
Name of the source that very shortly describes what it does.
finalinherited
sourceNameLocalisatiton Map<String, String>
Localisations for this source, where the key is a locale tag and the value is the sourceName of the source. If the value for the current locale is non-null, it will be used instead of sourceName.
finalinherited
uniqueKey String
A unique name that allows distinguishing this type from others, particularly for the purposes of differentiating between persistent settings keys.
finalinherited
useDarkTheme bool
Whether the reader will inject dark theme.
read-only
volumePageTurningEnabled bool
Whether or not using the volume buttons in the Reader should turn the page.
read-only
volumePageTurningInverted bool
Controls which direction is up or down for volume button page turning.
read-only

Methods

buildBar() BaseMediaSearchBar?
Used to override the search bar if needed by a source that implements search.
inherited
buildCatalogButton({required BuildContext context, required WidgetRef ref, required AppModel appModel}) Widget
Menu bar action.
buildHistoryPage({MediaItem? item}) BasePage
The body widget to show in the tab when this source's media type and this source is selected.
override
buildLaunchPage({MediaItem? item}) BaseSourcePage
The widget to show when this source is launched. An optional MediaItem can be supplied as a launch parameter.
override
buildOpenLinkButton({required BuildContext context, required WidgetRef ref, required AppModel appModel}) Widget
Menu bar action.
buildPickFileButton({required BuildContext context, required WidgetRef ref, required AppModel appModel}) Widget
Menu bar action.
buildTweaksButton({required BuildContext context, required WidgetRef ref, required AppModel appModel}) Widget
Tweaks bar action.
clearCurrentSentence() → void
Clear the current sentence.
inherited
clearExtraData() → void
Clear extra export data.
inherited
clearOverrideValues({required AppModel appModel, required MediaItem item}) Future<void>
Used to clear override values of a MediaItem upon deletion.
inherited
deletePreference({required String key}) Future<void>
Set the preference for a certain parameter key for this source.
inherited
generateAudio({required AppModel appModel, required MediaItem item, List<Subtitle>? subtitles, SubtitleOptions? options, String? data}) Future<File?>?
If this source is non-null, this will be used as the initial function for the audio field over the auto enhancement.
inherited
generateImages({required AppModel appModel, required MediaItem item, List<Subtitle>? subtitles, SubtitleOptions? options, String? data}) Future<List<NetworkToFileImage>>
If this source is non-null, this will be used as the initial function for the image field over the auto enhancement. Extra durations can be invoked and defined when initially opening the creator, to call attention to multiple durations to be used for image generation.
override
generateMediaItem({required String title, required String imageUrl, required String url, required int pageCount}) MediaItem
Generate a media item given required parameters.
generateMediaItemFromWebView({required AppModel appModel, required InAppWebViewController controller}) Future<MediaItem?>
Generate a media item given a WebView.
generateSearchSuggestions(String searchTerm) Future<List<String>>
Given a search term, this source may give search suggestions. If the empty list is returned, then search history will be shown instead.
inherited
getActions({required BuildContext context, required WidgetRef ref, required AppModel appModel}) List<Widget>
Get the floating search bar actions of this source when it is the active source being displayed on its respective media type tab.
override
getDisplaySubtitleFromMediaItem(MediaItem item) String
Given a MediaItem, return its subtitle. Some media items may allow overriding of values for display purposes. If a source does this, override this function.
inherited
getDisplayThumbnailFromMediaItem({required AppModel appModel, required MediaItem item, String? fallbackUrl, bool noOverride = false}) ImageProvider<Object>
Given a MediaItem, return its thumbnail. Some media items may allow overriding of values for display purposes.
inherited
getDisplayTitleFromMediaItem(MediaItem item) String
Given a MediaItem, return its title. Some media items may allow overriding of values for display purposes. If a source does this, override this function.
inherited
getImageUrl({required String relativeUrl, required String mediaIdentifier}) String
Given a certain index, return the absolute URL of a Mokuro image.
getLocalisedDescription(AppModel appModel) String
Get the best localisation for the description of this media source. If there is no localisation, the fallback is description.
inherited
getLocalisedSourceName(AppModel appModel) String
Get the best localisation for the label of this media source. If there is no localisation, the fallback is sourceName.
inherited
getOverrideThumbnailFilename({required AppModel appModel, required MediaItem item}) String
The map value used to store the override thumbnail of an item.
inherited
getOverrideThumbnailFromMediaItem({required AppModel appModel, required MediaItem item}) ImageProvider<Object>?
Given a MediaItem, return its override display thumbnail.
inherited
getOverrideTitleFromMediaItem(MediaItem item) String?
Given a MediaItem, return its override display title.
inherited
getOverrideTitleKey(MediaItem item) String
The map key used to store the override title of an item.
inherited
getPreference<T>({required String key, required T defaultValue}) → T
Get the preference value for a certain parameter key for this source.
inherited
getThumbnailUri({required AppModel appModel, required MediaItem item, bool noOverride = false}) String
Given a MediaItem, return its thumbnail. Some media items may allow overriding of values for display purposes.
inherited
initialise() Future<void>
This function is run at startup. It is not called again if already run.
inherited
launchFilePicker({required BuildContext context, required WidgetRef ref, required AppModel appModel}) → void
Launches a file picker and opens a media
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onMediaItemClear(MediaItem item) Future<void>
This function can be used to clean up resources associated with a media item upon clearing it.
inherited
onSearchBarTap({required BuildContext context, required WidgetRef ref, required AppModel appModel}) Future<void>
If this is not null, this action is executed when the user taps on the search bar. Sources that do not have a search action should have this defined.
override
onSourceExit({required AppModel appModel, required BuildContext context, required WidgetRef ref}) Future<void>
Executed when this media source is closed. Perform this step to clean up resources or refresh media history.
inherited
prepareResources() Future<void>
If a media source requires resources to function, they can be prepared here and this function will be run once only at runtime during the initialisation step.
inherited
searchMediaItems({required BuildContext context, required String searchTerm, required int pageKey}) Future<List<MediaItem>?>
This returns a list of MediaItem, and is performed to search the media source for items.
inherited
setCurrentSentence({required JidoujishoTextSelection selection}) → void
Update the current sentence.
inherited
setExtraData(String? value) → void
Set extra export data. This should be simplified in the future and be used as the main way of communicating parameters to the creator for creating override images/audio information. There should not be media source specific parameters for general functions like generating images or audio.
inherited
setOverrideThumbnailFromMediaItem({required AppModel appModel, required MediaItem item, required File? file, required bool clearOverrideImage}) Future<void>
Given a MediaItem, set its override display thumbnail. If null, this deletes the override thumbnail.
inherited
setOverrideTitleFromMediaItem({required MediaItem item, required String? title}) Future<void>
Given a MediaItem, set its override display title. If the title is blank, the override title is cleared.
inherited
setPreference<T>({required String key, required T value}) Future<void>
Set the preference value for a certain parameter key for this source.
inherited
setShouldGenerateAudio({required bool value}) → void
Controls whether or not a media source should currently supply audio.
inherited
setShouldGenerateImage({required bool value}) → void
Controls whether or not a media source should currently supply images.
inherited
toggleExtendPageBeyondNavigationBar() → void
Toggles the extend navbar option.
toggleHighlightOnTap() → void
Toggles whether the reader will highlight words on tap.
toggleUseDarkTheme() → void
Toggles whether to inject dark mode.
toggleVolumePageTurningEnabled() → void
Toggles the volume page turning option.
toggleVolumePageTurningInverted() → void
Inverts the current volume button page turning direction preference.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance ReaderMokuroSource
Get the singleton instance of this media type.
read-only