AppModel class
A scoped model for parameters that affect the entire application. RiverPod is used for global state management across multiple layers, especially for preferences that persist across application restarts.
- Mixed in types
Constructors
- AppModel()
Properties
-
activeFields
→ List<
Field> -
Change this once a field hide/show system is in place.
read-only
- alternateExportDirectory → Directory
-
Directory where media for export is stored for communication with
third-party APIs. Fallback for failure.
read-only
- androidDeviceInfo → AndroidDeviceInfo
-
Used to get information on the Android version of the device.
read-only
- appDirectory → Directory
-
Directory where data may be persisted.
read-only
- appIcon → Image
-
Preloads the app icon so that there is no pop-in.
final
- appLocale → Locale
-
Get the current app locale from persisted preferences.
read-only
-
audioHandlerStream
→ Stream<
void> -
Allows the player screen to listen to handler changes.
read-only
- autoSearchEnabled → bool
-
Whether or not searching in the app is performed without hitting the
submit button.
read-only
- blockCreatorInitialMedia ↔ bool
-
Blocks creator from processing initial media while player controller is not ready.
read / write
- blurOptions → BlurOptions
-
Get the blur options used in the player.
read-only
-
browserBookmarks
→ List<
BrowserBookmark> -
Returns all Browser bookmarks.
read-only
- browserDirectory → Directory
-
Directory where browser cache data may be persisted.
read-only
- cacheManager → DefaultCacheManager
-
Used for caching images and audio produced from media seeds.
read-only
-
cardCreatorRecursiveSearchStream
→ Stream<
void> -
For listening to searches made inside the Card Creator.
read-only
- closeCreatorOnExport → bool
-
The search debounce delay in milliseconds for searching in the app..
read-only
-
creatorActiveStream
→ Stream<
bool> -
For listening to changes for whether or not the Card Creator is open.
read-only
- currentHomeTabIndex → int
-
Get the current home tab index. The order of the tab indexes are based on
the ordering in mediaTypes.
read-only
- currentMediaItem → MediaItem?
-
Current active media item.
read-only
-
currentMediaPauseStream
→ Stream<
void> -
For invoking pauses from media where needed.
read-only
- currentMediaSource → MediaSource?
-
Current active media source.
read-only
- currentPlayerController ↔ VlcPlayerController?
-
This should all be refactored as part of MediaItem if possible. No
reason to expose it here if not for card export functions. This is super
cursed. Need to extract this to its own Provider at some point.
Current player controller.
read / write
-
currentSubtitle
→ ValueNotifier<
Subtitle?> -
Current subtitle.
read-only
-
currentSubtitleOptions
→ ValueNotifier<
SubtitleOptions> ? -
Current subtitle options.
read-only
- darkTheme → ThemeData
-
Shows when the current mode is a dark theme.
read-only
- databaseCloseNotifier → ChangeNotifier
-
Notifies app to stop showing any screens.
final
- databaseDirectory → Directory
-
Directory where database data is persisted.
read-only
- defaultDictionaryFontSize → double
-
Default dictionary font size for meanings.
final
- defaultMaximumDictionaryTermsInResult → int
-
Maximum number of headwords in a returned dictionary result for
performance purposes.
final
- defaultSearchDebounceDelay → int
-
Search debounce delay in milliseconds by default.
final
-
dictionaries
→ List<
Dictionary> -
Returns all dictionaries imported into the database. Sorted by the
user-defined order in the dictionary menu.
read-only
- dictionaryEntriesNotifier → ChangeNotifier
-
Used to notify dictionary widgets to dictionary history additions.
final
- dictionaryFontSize → double
-
The search debounce delay in milliseconds for searching in the app..
read-only
-
dictionaryFormats
↔ Map<
String, DictionaryFormat> -
Used to fetch a dictionary format by its unique key with constant time
performance. Initialised with populateDictionaryFormats at startup.
latefinal
-
dictionaryHistory
→ List<
DictionarySearchResult> -
Returns all dictionary history results. Oldest is first.
read-only
- dictionaryImportWorkingDirectory → Directory
-
Directory used as a working directory for dictionary imports.
read-only
- dictionaryMenuNotifier → ChangeNotifier
-
Used to notify dictionary widgets to dictionary menu changes.
final
- dictionarySearchAgainNotifier → ChangeNotifier
-
Used to notify dictionary widgets to dictionary import additions.
final
-
duplicateCheckModels
→ List<
String> -
Get the list of model names that will be checked for duplicates.
read-only
-
enhancements
↔ Map<
Field, Map< String, Enhancement> > -
Used to fetch initialised enhancements by their unique key with constant
time performance. Initialised with populateEnhancements at startup.
latefinal
- exportDirectory → Directory
-
Directory where media for export is stored for communication with
third-party APIs.
read-only
-
fields
↔ Map<
String, Field> -
Used to fetch initialised fields by their unique key with constant
time performance. Initialised with populateEnhancements at startup.
latefinal
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
read-onlyinherited
- hiveDirectory → Directory
-
Directory where Hive key-value data is stored.
read-only
- incognitoNotifier → ChangeNotifier
-
Used to notify toggling incognito. Updates the app logo to and from
grayscale.
final
- isarDirectory → Directory
-
Directory where Isar database data is stored.
read-only
- isCreatorOpen → bool
-
Used to check whether or not the creator is currently in the navigation
stack.
read-only
- isDarkMode → bool
-
Get whether or not the current theme is dark mode.
read-only
- isDatabaseOpen → bool
-
Check if the database is still open or has the app been flagged to be
shutdown.
read-only
- isFirstTimeSetup → bool
-
Whether or not it is the app's first time setup to show the languages
dialog.
read-only
- isMediaOpen → bool
-
Used to check whether or not the app is currently using a media source.
read-only
- isPlayerListeningComprehensionMode → bool
-
Get definition focus mode for player.
read-only
- isPlayerOrientationPortrait → bool
-
Get orientation for player.
read-only
- isProcessingEmbeddedSubtitles ↔ bool
-
Flag for when the player is currently busy processing subtitles. Image
and audio export cannot be done when this flag is on, so a toast is
shown.
read / write
- isStretchToFill → bool
-
Get whether or not to stretch to fill screen.
read-only
- isTranscriptOpaque → bool
-
Get whether or not the transcript should have a background.
read-only
- isTranscriptPlayerMode → bool
-
Get whether or not the transcript should show play/pause.
read-only
-
languages
↔ Map<
String, Language> -
Used to fetch a language by its locale tag with constant time performance.
Initialised with populateLanguages at startup.
latefinal
- lastSelectedDeckName → String
-
Get the last selected deck from persisted preferences.
read-only
- lastSelectedDictionaryFormat → DictionaryFormat
-
Get the target language from persisted preferences.
read-only
- lastSelectedMapping → AnkiMapping
-
Get the last selected mapping from persisted preferences. This should
always be guaranteed to have a result, as it is impossible to delete the
default mapping.
read-only
- lastSelectedMappingName → String
-
Get the last selected mapping's name from persisted preferences. This is
faster than getting the mapping specifically from the database.
read-only
- lastSelectedModel → String?
-
Get the last selected model from persisted preferences.
read-only
-
locales
↔ Map<
String, Locale> -
Used to fetch an app locale by its locale tag with constant time
performance. Initialised with populateLocales at startup.
latefinal
-
mappings
→ List<
AnkiMapping> -
Returns all export profiles.
read-only
- maximumDictionaryHistoryItems → int
-
Maximum number of dictionary history items.
final
- maximumDictionarySearchResults → int
-
Maximum number of dictionary search results stored in the database.
final
- maximumFieldEnhancements → int
-
Maximum number of manual enhancements in a field.
final
- maximumMediaHistoryItems → int
-
Maximum number of media history items.
final
- maximumQuickActions → int
-
Maximum number of quick actions.
final
- maximumSearchHistoryItems → int
-
Maximum number of search history items.
final
- maximumTerms → int
-
The maximum dictionary terms in a result.
read-only
-
mediaSources
↔ Map<
MediaType, Map< String, MediaSource> > -
Used to fetch initialised sources by their unique key with constant
time performance. Initialised with populateMediaSources at startup.
latefinal
-
mediaTypes
↔ Map<
String, MediaType> -
Used to fetch a media type by its unique key with constant time
performance. Initialised with populateMediaTypes at startup.
latefinal
-
messages
→ List<
MessageItem> -
Returns the message log for the ReaderChatgptSource.
read-only
-
mokuroCatalogs
→ List<
MokuroCatalog> -
Returns all Mokuro catalogs.
read-only
-
Used for showing dialogs without needing to pass around a BuildContext.
read-only
- nextCatalogOrder → int
-
Get the newest available order for a new catalog.
read-only
- nextMappingOrder → int
-
Get the newest available order for a new mapping.
read-only
- overrideDictionaryColor → Color?
-
Override color for the dictionary widget.
read-only
- overrideDictionaryTheme → ThemeData?
-
Override theme for the dictionary widget.
read-only
- packageInfo → PackageInfo
-
Used to get the versioning metadata of the app. See initialise.
read-only
- playbackMode → PlaybackMode
-
Get the playback mode for the player.
read-only
- playerHardwareAcceleration → bool
-
Whether or not the player should use hardware acceleration.
read-only
- playerUseOpenSLES → bool
-
Whether or not the player should use hardware acceleration.
read-only
-
playPauseHeadsetActionStream
→ Stream<
void> -
Allows actions to be performed upon Play/Pause on headset buttons.
read-only
- populateBookmarksFlag → bool
-
Get whether or not bookmarks have been populated.
read-only
-
quickActions
↔ Map<
String, QuickAction> -
Used to fetch initialised actions by their unique key with constant
time performance. Initialised with populateQuickActions at startup.
latefinal
-
routeObserver
→ RouteObserver<
PageRoute> -
Used to get the versioning metadata of the app. See initialise.
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- savedTags → String
-
Get the saved value that the user has set for the TagsField.
read-only
- searchDebounceDelay → int
-
The search debounce delay in milliseconds for searching in the app..
read-only
- shouldHideStatusBarWhenInMedia → bool
-
Override flag for when isMediaOpen is true but the status bar should
be kept open instead of closed.
read-only
- shouldRefreshTabs ↔ bool
-
Used to check if the dictionary tab should be refreshed on switching tabs.
read / write
- stashKey → String
-
Used as the history key used for the Stash.
final
- subtitleOptions → SubtitleOptions
-
Get the subtitle options used in the player.
read-only
- subtitleTimingsShown → bool
-
Get whether or not subtitle timings are shown.
read-only
- targetLanguage → Language
-
Get the target language from persisted preferences.
read-only
- temporaryDirectory → Directory
-
These directories are prepared at startup in order to reduce redundancy
in actual runtime.
Directory where data that may be dumped is stored.
read-only
- textStyle → TextStyle
-
Get the app-wide text style.
read-only
- textTheme → TextTheme
-
This override is a workaround required to theme the app-wide TextTheme
based on the Locale and TextBaseline of the active target language.
read-only
- theme → ThemeData
-
Shows when the current mode is a light theme.
read-only
- thumbnailsDirectory → Directory
-
Directory where media source thumbnails may be persisted.
read-only
- useSlowImport → bool
-
Whether or not the app should use slow import. This is to prevent
crashing on older devices and make performance faster for newer devices.
read-only
-
watchDictionaryItem
→ Stream<
void> Function(int) -
For watching the dictionary history collection.
read-only
Methods
-
addBookmark(
BrowserBookmark bookmark) → Future< void> - Add a selected bookmark to the database.
-
addCatalog(
MokuroCatalog catalog) → Future< void> - Add a selected catalog to the database.
-
addDefaultModelIfMissing(
) → Future< void> - Adds the default 'jidoujisho Kinomoto' model to the list of Anki card types.
-
addFileToMedia(
{required File exportFile, required String preferredName, required String mimeType, bool fallback = false}) → Future< String> -
Add a file to Anki media.
mimeType
can be 'image' or 'audio'.preferredName
is used as a prefix to the file when exported to the media store. Returns the name of the file once successfully added to Anki media. -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
addMapping(
AnkiMapping mapping) → void - Add a selected mapping to the database.
-
addMediaItem(
MediaItem item) → void - Add a MediaItem to history. This should be called at startup when the media item is launched.
-
addMessage(
MessageItem message) → int - Adds a message to the log for the ReaderChatgptSource.
-
addNote(
{required CreatorFieldValues creatorFieldValues, required AnkiMapping mapping, required String deck, required dynamic onSuccess()}) → Future< void> -
Add a note with certain
creatorFieldValues
and amapping
of fields to a model to a givendeck
. -
addToDictionaryHistory(
{required DictionarySearchResult result}) → void - Adds a DictionarySearchResult to dictionary history.
-
addToSearchHistory(
{required String historyKey, required String searchTerm}) → void -
Add the
searchTerm
to a search history with the givenhistoryKey
. If there are already a maximum number of items in history, this will be capped. Oldest items will be discarded in that scenario. -
addToStash(
{required List< String> terms}) → void -
Adds the
terms
to the Stash and shows a message indicating the addition. -
catalogUrlHasDuplicate(
MokuroCatalog catalog) → bool - Check if a catalog with a certain name with a different order already exists.
-
checkForDuplicates(
String key) → Future< bool> - Given a value and a model name, checks if there are cards that have a first field with a matching value.
-
clearDictionaryHistory(
) → Future< void> - Clear the entire dictionary history. This must be performed when a dictionary is deleted, otherwise history data cannot be viewed without the necessary dictionary metadata.
-
clearDictionaryResultsCache(
) → void - Used when a dictionary is added or removed as those results may now be wrong.
-
clearMessages(
) → Future< void> - Clears the message log for the ReaderChatgptSource.
-
clearSearchHistory(
{required String historyKey}) → void -
Clear the search history with the given
historyKey
. -
clearStash(
) → void - Clear the contents of the Stash.
-
closeMedia(
{required BuildContext context, required WidgetRef ref, required MediaSource mediaSource, MediaItem? item}) → Future< void> - Ends a media session and ensures that values are reset.
-
copyToClipboard(
String term) → void -
Copies a
term
to clipboard and shows an appropriate toast. -
deleteBookmark(
BrowserBookmark bookmark) → void - Delete a selected catalog from the database.
-
deleteCatalog(
MokuroCatalog mapping) → void - Delete a selected catalog from the database.
-
deleteDictionaries(
) → Future< void> - Delete all dictionary data from the database.
-
deleteDictionary(
Dictionary dictionary) → Future< void> - Delete all dictionary data from the database.
-
deleteMapping(
AnkiMapping mapping) → void - Delete a selected mapping from the database.
-
deleteMediaItem(
MediaItem item) → Future< void> - Deletes a MediaItem from history and also rids of override values.
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getAudioExportFile(
{bool fallback = false}) → File - Get the file to be written to for audio export.
-
getAudioPreviewFile(
Directory directory) → File - Get the file to be written to for audio export.
-
getCurrentMediaItem(
) → MediaItem? - Get the current media item for use in tracking history and generating media for card creation based on media progress.
-
getCurrentSentence(
) → JidoujishoTextSelection - Get the sentence to be used by the SentenceField upon card creation.
-
getCurrentSourceForMediaType(
{required MediaType mediaType}) → MediaSource - For a given MediaType, return the selected media source. If there is no persisted media source, use the first source in the list.
-
getDecks(
) → Future< List< String> > - Get a list of decks from the Anki background service that can be used for export.
-
getFieldList(
String model) → Future< List< String> > -
Get a list of field names for a given
model
name in Anki. This function assumes that the model name can be found in getDecks and is valid. -
getFilePickerDirectoriesForMediaType(
MediaType type) → Future< List< Directory> > - Returns valid file picker directories. If there is a last picked directory for a media type, this will be included as first on the list. Otherwise, external root directories will be included.
-
getImageCompressedFile(
{bool fallback = false}) → File - Get the placeholder file to compress for image export.
-
getImageExportFile(
{bool fallback = false}) → File - Get the file to be written to for image export.
-
getLastPickedDirectory(
MediaType type) → Directory? - Returns the last navigated directory the user used for picking a file for a certain media type.
-
getMappingFromLabel(
String label) → AnkiMapping? - Get a mapping with a given mapping name.
-
getMediaItemPreferredAudioIndex(
MediaItem item) → int - Gets the last used audio index of a given media item.
-
getMediaSourceHistory(
{required MediaSource mediaSource}) → List< MediaItem> -
Get the history of
MediaItem
for a particular MediaSource. -
getMediaTypeHistory(
{required MediaType mediaType}) → List< MediaItem> -
Get the history of
MediaItem
for a particular MediaType. -
getModelList(
) → Future< List< String> > - Get a list of models from the Anki background service that can be used for export.
-
getNoReadingFrequencies(
{required DictionaryHeading heading}) → List< DictionaryFrequency> - Adds a DictionarySearchResult to dictionary history.
-
getPreviewImageFile(
Directory directory, int index) → File - Get the file to be written to for image export.
-
getSearchHistory(
{required String historyKey}) → List< String> -
Get the search history for a given collection named
historyKey
. -
getStash(
) → List< String> - Get the contents of the Stash.
-
getThumbnailFile(
) → File - Get the file to be written to for thumbnail export.
-
importDictionary(
{required File file, required ValueNotifier< String> progressNotifier, required dynamic onImportSuccess()}) → Future<void> - Start the process of importing a dictionary. This is called from the dictionary menu, and starts the process of importing for the lastSelectedDictionaryFormat.
-
initialise(
) → Future< void> - Prepare application data and state to be ready of use upon starting up the application. AppModel is initialised in the main function before runApp is executed.
-
initialiseAudioHandler(
) → Future< void> - Initialises the audio service.
-
injectAssetLicenses(
) → Future< void> - Injects licenses to be displayed in the licenses page that aren't pre-included by Flutter upon compilation but are included as assets.
-
isTermInSearchHistory(
{required String historyKey, required String searchTerm}) → bool -
Get whether or not a certain
searchTerm
is in a certain history. -
isTermInStash(
String searchTerm) → bool - Get the contents of the Stash.
-
mappingNameHasDuplicate(
AnkiMapping mapping) → bool - Check if a mapping with a certain name with a different order already exists.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
notifyRecursiveSearch(
) → void - Broadcast that a search was made in the Card Creator
-
openCreator(
{required WidgetRef ref, required bool killOnPop, CreatorFieldValues? creatorFieldValues, List< Subtitle> ? subtitles}) → Future<void> - A helper function for opening the creator from any page in the application for card export purposes. Normally, the fields are provided by values in the app state. For example, the sentence field provides its value upon opening the creator from current media, which if null is empty.
-
openCreatorEnhancementsEditor(
) → Future< void> - A helper function for opening the creator from any page in the application for editing enhancements.
-
openCreatorFieldsEditor(
) → Future< void> - application for editing fields.
-
openExampleSentenceDialog(
{required List< String> exampleSentences, required dynamic onSelect(List<String> ), dynamic onAppend(List<String> )?}) → Future<void> - A helper function for opening an example sentence dialog.
-
openImmersionKitSentenceDialog(
{required List< ImmersionKitResult> exampleSentences, required dynamic onSelect(List<ImmersionKitResult> ), required dynamic onAppend(List<ImmersionKitResult> )}) → Future<void> - A helper function for opening an example sentence dialog for sentences returned from ImmersionKitEnhancement.
-
openMassifSentenceDialog(
{required List< MassifResult> exampleSentences, required dynamic onSelect(List<MassifResult> ), required dynamic onAppend(List<MassifResult> )}) → Future<void> - A helper function for opening an example sentence dialog for sentences returned from Massif.
-
openMedia(
{required BuildContext context, required WidgetRef ref, required MediaSource mediaSource, bool killOnPop = false, bool pushReplacement = false, MediaItem? item}) → Future< void> - A helper function for launching a media source.
-
openRecursiveDictionarySearch(
{required String searchTerm, required bool killOnPop, dynamic onUpdateQuery(String)?}) → Future< void> - A helper function for doing a recursive dictionary search.
-
openResultFromHistory(
{required DictionarySearchResult result}) → Future< void> - A helper function for showing a result already in dictionary history.
-
openStash(
{required dynamic onSelect(String), required dynamic onSearch(String)}) → Future< void> - A helper function for opening the creator from any page in the application for editing purposes.
-
openTextSegmentationDialog(
{required String sourceText, List< String> ? segmentedText, dynamic onSelect(JidoujishoTextSelection)?, dynamic onSearch(JidoujishoTextSelection)?}) → Future<void> - A helper function for opening a text segmentation dialog.
-
populateBookmarks(
) → void - Populate list of bookmarks included with the app by default.
-
populateDefaultMapping(
Language language) → void - Populate default mapping if it does not exist in the database.
-
populateDictionaryFormats(
) → void - Populate maps for dictionary formats at startup to optimise performance.
-
populateEnhancements(
) → void - Populate maps for enhancements at startup to optimise performance.
-
populateFields(
) → void - Populate maps for fields at startup to optimise performance.
-
populateLanguages(
) → void - Populate maps for languages at startup to optimise performance.
-
populateLocales(
) → void - Populate maps for locales at startup to optimise performance.
-
populateMediaSources(
) → void - Populate maps for media sources at startup to optimise performance.
-
populateMediaTypes(
) → void - Populate maps for media types at startup to optimise performance.
-
populateQuickActions(
) → void - Populate maps for actions at startup to optimise performance.
-
prepareFallbackJidoujishoDirectory(
) → Future< Directory> - Return the app external directory found in the internal app directory. This path also initialises the folder if it does not exist, and includes a .nomedia file within the folder.
-
prepareJidoujishoDirectory(
) → Future< Directory> - Return the app external directory found in the public DCIM directory. This path also initialises the folder if it does not exist, and includes a .nomedia file within the folder.
-
profileFieldMatchesCardTypeCount(
AnkiMapping mapping) → Future< bool> - Returns whether or not a given AnkiMapping has the same amount of fields as the model it uses.
-
profileModelExists(
AnkiMapping mapping) → Future< bool> - Returns whether or not a given AnkiMapping's model exists in Anki.
-
refresh(
) → Future< void> - Refresh all screens and have them respond to new variables.
-
refreshDictionaryHistory(
) → void - For refreshing on dictionary result additions.
-
removeAutoFieldEnhancement(
{required AnkiMapping mapping, required Field field}) → void -
Removes a given
mapping
's persisted auto enhancement for a givenfield
. -
removeField(
{required AnkiMapping mapping, required Field field, required bool isCollapsed}) → void -
Updates a given
mapping
to remove a Field. -
removeFieldEnhancement(
{required AnkiMapping mapping, required Field field, required int slotNumber}) → void -
Removes a given
mapping
's persisted enhancement for a givenfield
andslotNumber
. -
removeFromReadingList(
String mediaIdentifier) → void - Deletes a MediaItem from the reading list.
-
removeFromSearchHistory(
{required String historyKey, required String searchTerm}) → Future< void> -
Remove the
searchTerm
from a search history with the givenhistoryKey
. -
removeFromStash(
{required String term}) → Future< void> -
Remove a certain
term
from the Stash. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
removeMessage(
int id) → void - Removes the last message from the log for the ReaderChatgptSource.
-
removeQuickAction(
{required AnkiMapping mapping, required int slotNumber}) → void -
Removes a given
mapping
's persisted action for a givenslotNumber
. -
requestAnkidroidPermissions(
) → Future< void> - Used to ask for AnkiDroid database permissions. Should be called at startup.
-
requestExternalStoragePermissions(
) → Future< void> - Requests for full external storage permissions. Required to handle video files and their subtitle files in the same directory.
-
resetProfileFields(
AnkiMapping mapping) → Future< void> - Resets a profile's fields such that it will have the model's number of fields, all empty.
-
searchDictionary(
{required String searchTerm, required bool searchWithWildcards, bool useCache = true}) → Future< DictionarySearchResult> - Gets the raw unprocessed entries straight from a dictionary database given a search term. This will be processed later for user viewing.
-
selectStandardProfile(
) → Future< void> - Persist the standard profile as the last selected mapping.
-
setAppLocale(
String localeTag) → Future< void> - Persist a new app locale in preferences.
-
setAutoFieldEnhancement(
{required AnkiMapping mapping, required Field field, required Enhancement enhancement}) → void -
Updates a given
mapping
's persisted auto enhancement for a givenfield
. -
setBlurOptions(
BlurOptions options) → void - Set the blur options used in the player.
-
setCurrentHomeTabIndex(
int index) → Future< void> - Persist the new tab after switching home tabs.
-
setCurrentMediaItem(
MediaItem mediaItem) → void - Manually flag that the app is now using a media item. Prefer openMedia instead of this.
-
setCurrentSourceForMediaType(
{required MediaType mediaType, required MediaSource mediaSource}) → void - For a given MediaType, set the selected media source.
-
setDictionaryFontSize(
double fontSize) → void - Sets the debounce delay in milliseconds for searching in the app..
-
setDuplicateCheckModels(
List< String> value) → void - Set the list of model names that will be checked for duplicates.
-
setField(
{required AnkiMapping mapping, required Field field, required bool isCollapsed}) → void -
Updates a given
mapping
to include a Field. -
setFieldEnhancement(
{required AnkiMapping mapping, required Field field, required int slotNumber, required Enhancement enhancement}) → void -
Updates a given
mapping
's persisted enhancement for a givenfield
andslotNumber
. -
setFirstTimeSetupFlag(
) → void - Sets the first time setup flag so the first time message does not show again.
-
setLastPickedDirectory(
{required MediaType type, required Directory directory}) → void - Returns the last navigated directory the user used for picking a file for a certain media type.
-
setLastSelectedDeck(
String deckName) → Future< void> - Persist a new last selected deck name. This is called when the user changes the selected deck to map in the creator.
-
setLastSelectedDictionaryFormat(
DictionaryFormat dictionaryFormat) → Future< void> - Persist a new last selected dictionary format. This is called when the user changes the import format in the dictionary menu.
-
setLastSelectedMapping(
AnkiMapping mapping, {bool notify = true}) → Future< void> - Persist a new last selected model name. This is called when the user changes the selected model to map in the profiles menu.
-
setLastSelectedModelName(
String modelName) → Future< void> - Persist a new last selected model name. This is called when the user changes the selected model to map in the profiles menu.
-
setMaximumTerms(
int value) → void - Sets the maximum dictionary terms in a result.
-
setMediaItemPreferredAudioIndex(
MediaItem item, int index) → void - Sets the last used audio index of a given media item.
-
setOverrideDictionaryColor(
Color? color) → void - Override color for the dictionary widget.
-
setOverrideDictionaryTheme(
ThemeData? themeData) → void - Override theme for the dictionary widget.
-
setPlaybackMode(
PlaybackMode playbackMode) → void - Set the playback mode for the player.
-
setPlayerHardwareAcceleration(
{required bool value}) → void - Set whether or not the player should use hardware acceleration.
-
setPlayerUseOpenSLES(
{required bool value}) → void - Set whether or not the player should use hardware acceleration.
-
setPopulateBookmarksFlag(
) → void - Sets the populate bookmarks flag so bookmarks don't get added again.
-
setQuickAction(
{required AnkiMapping mapping, required int slotNumber, required QuickAction quickAction}) → void -
Updates a given
mapping
's persisted action for a givenslotNumber
. -
setSavedTags(
String value) → void - Set the saved value that the user has set for the TagsField.
-
setSearchDebounceDelay(
int debounceDelay) → void - Sets the debounce delay in milliseconds for searching in the app..
-
setSubtitleOptions(
SubtitleOptions options) → void - Set the subtitle options used in the player.
-
setTargetLanguage(
Language language) → Future< void> - Persist a new target language in preferences.
-
showAnkidroidApiMessage(
) → void - Shows the AnkiDroid API message. Called when an Anki-related API get call fails.
-
showDictionaryMenu(
) → Future< void> - Show the dictionary menu. This should be callable from many parts of the app, so it is appropriately handled by the model.
-
showFailedToCommunicateMessage(
) → void - Shown when a query fails to be made to an online service. For example, when there is no internet connection.
-
showLanguageMenu(
) → Future< void> - Show the language menu. This should be callable from many parts of the app, so it is appropriately handled by the model.
-
showProfilesMenu(
) → Future< void> - Show the language menu. This should be callable from many parts of the app, so it is appropriately handled by the model.
-
shutdown(
) → void - Safely shutdown and stop database operations.
-
temporarilyDisableStatusBarHiding(
{required Future action()}) → Future< void> - Override the flag for automatically disabling the status bar. Necessary for some very specific edge cases and byproduct of letting global state run its course. This is a band-aid solution.
-
toggleAutoSearchEnabled(
) → void - Toggle auto search option.
-
toggleCloseCreatorOnExport(
) → void - Sets the debounce delay in milliseconds for searching in the app..
-
toggleDarkMode(
) → void - Toggle between light and dark mode.
-
toggleDictionaryCollapsed(
Dictionary dictionary) → void - Toggle a dictionary's between collapsed and expanded state. This will affect how a dictionary's search results are shown by default.
-
toggleDictionaryHidden(
Dictionary dictionary) → void - Toggle a dictionary's between hidden and shown state. This will affect how a dictionary's search results are shown by default.
-
togglePlayerListeningComprehensionMode(
) → void - Toggle definition focus mode for player.
-
togglePlayerOrientationPortrait(
) → void - Toggle orientation for player.
-
toggleSlowImport(
) → void - Toggle slow import option.
-
toggleStretchToFill(
) → void - Toggle stretch to fill screen.
-
toggleSubtitleTimingsShown(
) → void - Toggle subtitle timings shown.
-
toggleTranscriptOpaque(
) → void - Toggle transcript background.
-
toggleTranscriptPlayerMode(
) → void - Toggle transcript player mode.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateCatalogsOrder(
List< MokuroCatalog> newCatalogs) → void - Update the user-defined order of given catalogs in the database. See the catalog dialog's ReorderableListView for usage.
-
updateDictionaryOrder(
List< Dictionary> newDictionaries) → void - Update the user-defined order of a given dictionary in the database. See the dictionary dialog's ReorderableListView for usage.
-
updateDictionaryResultScrollIndex(
{required DictionarySearchResult result, required int newIndex}) → Future< void> - Update the scroll index of a given DictionarySearchResult in the database.
-
updateMappingsOrder(
List< AnkiMapping> newMappings) → void - Update the user-defined order of a given dictionary in the database. See the dictionary dialog's ReorderableListView for usage.
-
updateMediaItem(
MediaItem item) → void - Update a media item, without performing any deletion or mutation operations. This is useful when updating constantly, for example, with the player where the position needs to be constantly updated.
-
validateSelectedMapping(
{required BuildContext context, required AnkiMapping mapping}) → Future< void> - Check for errors relating to the current selected export profile.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getCardFields(
{required CreatorFieldValues creatorFieldValues, required AnkiMapping mapping, required Map< Field, String> exportedImages, required Map<Field, String> exportedAudio}) → List<String> -
Returns the list that will be passed to the Anki card creation API to
fill a card's fields. The contents of the list will correspond to the
order of the
mapping
provided, with each field in the list replaced with the correspondingcreatorFieldValues
or in the case of the image and audio fields, the file names.
Constants
- methodChannel → const MethodChannel
-
Used to communicate back and forth with Dart and native code.
MethodChannel('app.arianneorpilla.yuuna/anki')