fromMap method
Returns true when even's atrributes parsed successfully
Implementation
bool fromMap(Map<dynamic, dynamic> argsMap) {
int argsCounter = 0;
int stateVal = 0;
argsMap.forEach((key, value) {
if ((key == PjsipConnectPlatform.kArgAccId) && (value is int)) {
accId = value;
argsCounter += 1;
} else if ((key == PjsipConnectPlatform.kRegState) && (value is int)) {
stateVal = value;
argsCounter += 1;
} else if ((key == PjsipConnectPlatform.kResponse) && (value is String)) {
response = value;
argsCounter += 1;
}
});
switch (stateVal) {
case PjsipConnectFlutter.kRegStateSuccess:
regState = RegState.success;
case PjsipConnectFlutter.kRegStateFailed:
regState = RegState.failed;
case PjsipConnectFlutter.kRegStateRemoved:
regState = RegState.removed;
}
return (argsCounter == 3);
}