createCallFromState function
ActiveCall
createCallFromState(
- String state, {
- CallDirection? callDirection,
- bool initiated = false,
Implementation
ActiveCall createCallFromState(String state,
{CallDirection? callDirection, bool initiated = false}) {
List<String> tokens = state.split('|');
return ActiveCall(
from: tokens[1],
to: tokens[2],
initiated: initiated ? DateTime.now() : null,
callDirection: callDirection ??
("Incoming" == tokens[3]
? CallDirection.incoming
: CallDirection.outgoing),
customParams: parseCustomParams(tokens));
}