isGeopoint static method

bool isGeopoint(
  1. String type,
  2. num degree
)

Implementation

static bool isGeopoint(String type, num degree) {
  if (type == 'latitude' && degree.abs() > 90) {
    throw CloudBaseException(
      code: CloudBaseExceptionCode.INVALID_PARAM,
      message: 'latitude should be a number ranges from -90 to 90',
    );
  } else if (type == 'longitude' && degree.abs() > 180) {
    throw CloudBaseException(
      code: CloudBaseExceptionCode.INVALID_PARAM,
      message: 'longitude should be a number ranges from -180 to 180',
    );
  }

  return true;
}