OryksaTv class

The ORYKSA TV pieces of one app: the presenter, the phoneVoice and the configuration from the server. Create one and keep it while the app runs.

final client = OryksaClient(getToken: myServerToken, platform: OryksaTvPlatform.fireTv.wire);
final tv = OryksaTv(client: client, locale: 'pt-BR');
await tv.presenter.say('Olá! Sou a ORYKSA.');
showOryksaTvAssistant(context, tv: tv);
Inheritance

Constructors

OryksaTv({required OryksaClient client, String? locale, OryksaTvAudioPlayer audioPlayer()?})
The TV pieces on the ORYKSA API through client. locale is the language of your app screen (BCP-47, for example pt-BR); by default the device's.
OryksaTv.withBackend(OryksaTvBackend backend, {String? locale, OryksaTvAudioPlayer audioPlayer()?})
The TV pieces on any backend, for example OryksaTvFakeBackend in tests and demos.

Properties

backend → OryksaTvBackend
Where the pieces get their data.
final
configTtl ↔ Duration
How long the configuration is kept before it is read again (10 minutes). The business may change its voice, texts or rules while the app is open; a new voice_rev then also stops the old cached lines from playing.
getter/setter pair
currentConfig → OryksaTvConfig?
The last configuration read from the server, or null before the first one.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
locale ↔ String
The language of the app screen (BCP-47), as given by the app.
getter/setter pair
phoneVoice → OryksaPhoneVoice
The phone as the microphone (QR).
latefinal
presenter → OryksaPresenter
The presenter: the AI speaks on screen with the voice of the locale and big subtitles.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
config({bool refresh = false}) → Future<OryksaTvConfig>
The TV configuration for locale, kept for 10 minutes (pass refresh to read it again now).
configOrFallback() → Future<OryksaTvConfig>
Like config, but when the server cannot be reached returns a configuration with the English fallback texts (the pieces keep working, without the server's texts).
dispose() → void
Discards any resources used by the object.
override
markConfigStale() → void
The configuration is read again on the next use.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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