VoiceCallView class
A live voice call as a standalone screen — the same call the chat composer's mic button opens, without a chat around it.
The chat panel mounts VoiceCallOverlay over its own message list and hands the transcript back to the thread. A host that wants a voice-first surface — a spoken interview, a guided intake, a hands-free assistant — wants the same call with nothing behind it and the transcript handed back to its own code instead. That is all this adds: it owns the controller's lifecycle, resolves the server's voice configuration if the host has not, and reports one VoiceCallOutcome when the call is over.
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => VoiceCallView(
configuration: BotConfiguration(
userID: userId,
projectSecretKey: key,
authToken: jwt,
// Per-call context reaches the model through `user_context`.
userContext: {'role': 'Backend Engineer', 'cv': cvText},
),
speakerName: 'Dana',
onEnded: (outcome) => grade(outcome.captions),
),
));
The host must declare the mic permission (NSMicrophoneUsageDescription
/ RECORD_AUDIO); without it the call ends immediately with a
VoiceMicPermissionDenied error rather than hanging on "connecting".
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- VoiceCallView
Constructors
- VoiceCallView({required BotConfiguration configuration, required void onEnded(VoiceCallOutcome outcome), String? speakerName, bool? captionsDefault, bool autoPop = true, Key? key})
-
const
Properties
- autoPop → bool
-
Pop this route after onEnded. Set false when the host wants to swap the
screen itself (e.g. straight into a result).
final
- captionsDefault → bool?
-
Whether live captions start visible. Defaults to the project's setting.
final
- configuration → BotConfiguration
-
Identity, project key and — importantly —
userContext, which the SDK sends in the call'sinitframe. That is how per-call context reaches a model whose persona otherwise comes from the dashboard.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onEnded → void Function(VoiceCallOutcome outcome)
-
Called exactly once, when the call is over or could not start.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- speakerName → String?
-
Who is speaking, shown on the call surface. Defaults to the project's
configured bot name.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< VoiceCallView> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited