setDashboardURL method
Sets the API's base URL to retrieve the data. Make sure you follow the next steps:
- For this method to work correctly, you should call methods in the following order:
Failing to follow this order might result in unexpected behavior.
- Also make sure you have declared the same value for the MapViewConfiguration.apiDomain parameter if using our MapView widget.
Failing to implement this parameter might result in unexpected behavior.
url
should include only the protocol and the domain (e.g., "https://dashboard.situm.com").
Do not include paths or query parameters.
Implementation
Future<void> setDashboardURL(String? url) async {
if (url == null) {
url = "https://dashboard.situm.com";
} else {
if (!url.startsWith(RegExp(r'https://'))) {
url = "https://$url";
}
if (url.endsWith('/')) {
url = url.substring(0, url.length - 1);
}
}
await methodChannel.invokeMethod(
"setDashboardURL",
<String, dynamic>{
'url': url,
},
);
}