language property

String? language
getter/setter pair

The output language used by transcribe calls that pass none.

Settable, and that is load-bearing: FlutterGemma.getActiveStt returns a process-wide singleton, so if the language were fixed at construction the second getActiveStt(language: …) in a process would hand back the recognizer built for the FIRST language and transcribe into it with no error. Retargeting is free here, so there is nothing to invalidate.

Setting an unusable value must throw ArgumentError — a malformed code, or any code on a model with no language token. abstract for exactly that reason: a plain field cannot validate, and a stored-but-never-read value is the shape of the bug this whole API exists to fix (#500).

null means the model's own default ('en' for Whisper), and assigning null CLEARS a previously set language rather than leaving it in place.

Implementation

abstract String? language;