toPairAsMap method

Map<String, dynamic>? toPairAsMap(
  1. P pair, {
  2. TypeMapper? xMapper,
  3. TypeMapper? yMapper,
})

Implementation

Map<String, dynamic>? toPairAsMap(P pair,
    {TypeMapper? xMapper, TypeMapper? yMapper}) {
  if (xMapper == null && yMapper == null) {
    return toPair(pair, (X? x, Y? y) => {'x': x, 'y': y});
  } else {
    xMapper ??= (o) => o;
    yMapper ??= (o) => o;
    return toPair(pair, (X? x, Y? y) => {'x': xMapper!(x), 'y': yMapper!(y)});
  }
}