AlfredWorkflow class final
- Available extensions
Constructors
-
AlfredWorkflow({AlfredAutomaticCache? automaticCache, AlfredCache<
AlfredItems> ? fileCache}) - Builds an AlfredWorkflow
Properties
- automaticCache → AlfredAutomaticCache?
-
no setter
- cacheKey ↔ String?
-
The cache key is used to identify the cached data.
getter/setter pair
- cacheTimeToLive ↔ int?
-
The time to live for the cache in seconds.
getter/setter pair
- disableAlfredSmartResultOrdering ↔ bool
-
Alfred learns to prioritise item results like he learns any other, meaning
the order in which your workflow results are presented will be based on
Alfred's knowledge (using the item UID) and not the order your script
returns the items.
getter/setter pair
-
fileCache
→ AlfredCache<
AlfredItems> -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxCacheEntries ↔ int?
-
The maximum number of entries in the cache.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- skipKnowledge ↔ bool?
-
This preserves the given item order while allowing Alfred to retain
knowledge of your items, like your current selection during a re-run.
getter/setter pair
- useAutomaticCache ↔ bool
-
Scripts which take a while to return can cache results so users see data sooner on subsequent runs.
The Script Filter presents the results from the previous run when caching is active and hasn't expired.
Because the script won't execute when loading cached data, we recommend this option only be used with
"Alfred filters results".
getter/setter pair
Methods
-
addItem(
AlfredItem item, {bool toBeginning = false}) → Future< void> -
Add single
item -
addItems(
List< AlfredItem> items) → Future<void> -
Add multiple
items -
clearItems(
) → Future< void> - Delete all AlfredItem.
-
getDefaults(
[String path = 'info.plist']) → Future< Map< String, AlfredUserConfiguration< ?>dynamic, AlfredUserConfigurationConfig> > -
Available on AlfredWorkflow, provided by the UserDefaults extension
Returns aMapof user defaults from the workflow'sinfo.plistfile. -
getDefaultsSync(
[String path = 'info.plist']) → Map< String, AlfredUserConfiguration< ?dynamic, AlfredUserConfigurationConfig> > -
Available on AlfredWorkflow, provided by the UserDefaults extension
Synchronously returns aMapof user defaults from the workflow'sinfo.plistfile. -
getItems(
) → Future< AlfredItems> - Always use this to check for any AlfredItems.
-
getUserDefaults(
{String prefsPath = 'prefs.plist', String infoPath = 'info.plist'}) → Future< Map< String, AlfredUserConfiguration< ?>dynamic, AlfredUserConfigurationConfig> > -
Available on AlfredWorkflow, provided by the UserDefaults extension
Returns aMapof the user defaults from the workflow'sinfo.plistmerged withprefs.plistfile. -
getUserDefaultsSync(
{String prefsPath = 'prefs.plist', String infoPath = 'info.plist'}) → Map< String, AlfredUserConfiguration< ?dynamic, AlfredUserConfigurationConfig> > -
Available on AlfredWorkflow, provided by the UserDefaults extension
Synchronously returns aMapof user defaults from the workflow'sinfo.plistmerged withprefs.plistfile. -
getUserPreferences(
[String path = 'prefs.plist']) → Future< Map< String, dynamic> ?> -
Available on AlfredWorkflow, provided by the UserDefaults extension
Returns aMapof user defaults from the workflow'sprefs.plistfile. -
getUserPreferencesSync(
[String path = 'prefs.plist']) → Map< String, dynamic> ? -
Available on AlfredWorkflow, provided by the UserDefaults extension
Synchronously returns aMapof user defaults from the workflow'sprefs.plistfile. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
{AlfredItem? addToBeginning, AlfredItem? addToEnd, bool toStdout = true}) → Future< void> - Use this convenience method to print the AlfredItems in JSON format to stdout.
-
toJsonString(
{AlfredItem? addToBeginning, AlfredItem? addToEnd}) → Future< String> - Returns a JSON String representation of the AlfredItem items.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultCacheTimeToLive → const int
- defaultMaxCacheEntries → const int