isNight static method

bool isNight(
  1. Coordinates coords,
  2. DateTime time
)

Check if it is night at the specified coordinates and time.

If no time is provided then the device time is used.

Parameters

Returns

  • True if it is night at the specified coordinated and time, false otherwise.

Throws

  • An exception if it fails.

Implementation

static bool isNight(final Coordinates coords, final DateTime time) {
  final OperationResult resultString = objectMethod(
    0,
    'MapDetails',
    'isNight',
    args: <String, Object>{
      'coords': coords,
      'refTime': time.millisecondsSinceEpoch,
    },
  );

  return resultString['result'];
}