getXYPair method
Implementation
Pair<double, double> getXYPair(
String key, {
bool includeXY = true,
double xDefault = 0,
double yDefault = 0,
}) {
double x = xDefault;
double y = yDefault;
if (includeXY) {
double? value = this[key]?.asDouble();
if (value != null) {
x = y = value;
}
double? valueM = this["-$key"]?.asDouble();
if (valueM != null) {
x = y = -1 * valueM;
}
}
double? xP = this["$key-xy|$key-x"]?.asDouble() ?? null;
double? xM = this["-$key-xy|-$key-x"]?.asDouble() ?? null;
double? yP = this["$key-xy|$key-y"]?.asDouble() ?? null;
double? yM = this["-$key-xy|-$key-y"]?.asDouble() ?? null;
if (xM != null) {
xM = xM * -1;
}
if (yM != null) {
yM = yM * -1;
}
return Pair(xM ?? xP ?? x, yM ?? yP ?? y);
}