fetchBrokerUrlFromPath static method

Future<String> fetchBrokerUrlFromPath(
  1. String path,
  2. String otherwise
)

Implementation

static Future<String> fetchBrokerUrlFromPath(
  String path,
  String otherwise,
) async {
  try {
    final response = await http.get(Uri.parse(path));
    if (response.statusCode == 200) {
      return response.body.trim();
    }
  } catch (e) {
    return otherwise;
  }
  return otherwise;
}