Serialize to a JSON-encodable map, omitting absent members.
Map<String, dynamic> toJson() => <String, dynamic>{ if (time != null) 'time': time!, if (locator != null) 'locator': locator!, };