FakeTcccCall constructor

FakeTcccCall({
  1. String callId = 'fake-call',
  2. String channelId = '10086',
  3. DateTime? startedAt,
  4. TcccCallSnapshot? status,
  5. TcccCallResult? result,
  6. TcccOutcome dtmfResultBuilder(
    1. String digit
    )?,
})

Implementation

FakeTcccCall({
  this.callId = 'fake-call',
  this.channelId = '10086',
  DateTime? startedAt,
  TcccCallSnapshot? status,
  TcccCallResult? result,
  this.dtmfResultBuilder,
}) : startedAt = startedAt ?? DateTime.utc(2026, 1, 1, 12),
     _result = result,
     _statusNotifier = ValueNotifier<TcccCallSnapshot>(
       status ??
           TcccCallSnapshot(
             state: TcccCallState.preparing,
             callId: callId,
             channelId: channelId,
             callStartedAt: startedAt ?? DateTime.utc(2026, 1, 1, 12),
           ),
     ),
     _ended = Completer<TcccCallResult>() {
  _events = StreamController<TcccEvent>.broadcast(sync: true);
  if (result != null && !_ended.isCompleted) {
    _ended.complete(result);
  }
}