whatIs method Null safety

Future<WhatIs?> whatIs(
  1. String did,
  2. String creator
)

Find a WhatIs

This method queries the blockchain for a specific WhatIs by did and creator. This contains a Schema which defines how data is modeled on the Sonr Network.

Implementation

Future<WhatIs?> whatIs(String did, String creator) async {
  try {
    final response = await httpClient.get<QueryWhatIsResponse>('/schema/query/what_is?creator=$creator&did=$did', contentType: "application/json");
    if (!response.isOk || response.body == null) {
      return null;
    }
    return response.body?.whatIs;
  } catch (e) {
    Log.warn("Failed to call query using REST API on $baseUrl/$query");
  }
  return null;
}