TranslationBindings class
The platform APIs the apple_translation library talks to.
Replace instance in tests to run the Dart layer against fakes.
Constructors
- TranslationBindings({AppleTranslationHostApi? host, AppleTranslationPlatformApi? platform, bool registerCallbacks = true})
- Creates bindings, defaulting to the real platform channels.
Properties
- activeBatchCount → int
-
How many streaming batches are routed, for leak checks in tests.
no setter
- callbackHandler → AppleTranslationCallbackApi
-
Receives native callbacks for streaming batches.
latefinal
-
finalizer
→ Finalizer<
int> -
Releases native handles whose Dart owners were garbage collected.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → AppleTranslationHostApi
-
The Translation API (registered only when the framework exists).
final
- platform → AppleTranslationPlatformApi
-
The always-available platform API.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
nextRequestId(
) → int - Reserves an id for a streaming request.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerBatch(
int requestId, BatchSink sink) → void -
Routes batch events for
requestIdtosink. -
toString(
) → String -
A string representation of this object.
inherited
-
unregisterBatch(
int requestId) → void -
Stops routing events for
requestId.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ TranslationBindings
-
The bindings every object uses.
getter/setter pair