screenPoints method

Future<({double h, double w})?> screenPoints()

The screen size in points, or null when the runner does not say.

Implementation

Future<({double w, double h})?> screenPoints() async {
  try {
    final screen = (await call('GET', '/status', timeout: const Duration(seconds: 5)))['screen'];
    if (screen is! List || screen.length != 2) return null;
    return (w: (screen[0] as num).toDouble(), h: (screen[1] as num).toDouble());
  } on Object {
    return null;
  }
}