jsonParserHelper static method

dynamic jsonParserHelper(
  1. dynamic key,
  2. dynamic value
)

Json parser helper to read messages and converting data to native objects

Implementation

static dynamic jsonParserHelper(key, value) {
  if (key == 'ts' &&
      value is String &&
      value.length >= 20 &&
      value.length <= 24) {
    var date = DateTime.parse(value);
    return date;
  } else if (key == 'acs' && value is Map) {
    return AccessMode(value);
  }
  return value;
}