serializers top-level property

Map<String, dynamic> serializers
getter/setter pair

Map of serializers for each datatype in flux query response

Implementation

Map<String, dynamic> serializers = {
  'boolean': (dynamic x) => x == 'true',
  'unsignedLong': (dynamic x) => x as int,
  'long': (dynamic x) {
    if (x is num) {
      return x.toInt();
    }
    if (x is String) {
      return (x == '' ? null : int.parse(x));
    }
  },
  'double': (dynamic x) {
    if (x is num) {
      return x.toDouble();
    } else if (x is double) {
      return x;
    } else if ('+Inf' == x) {
      return double.infinity;
    } else if ('-Inf' == x) {
      return -double.infinity;
    }
  },
  'string': identity,
  'base64Binary': identity,
  'dateTime:RFC3339': (String x) => (x == '' ? null : x),
};