getOauthConsumer function

Future<Map<String, String>> getOauthConsumer()

Implementation

Future<Map<String, String>> getOauthConsumer() async {
  if (_oauthConsumer != null) return _oauthConsumer!;
  final resp = await http.get(Uri.parse(OAUTH_CONSUMER_URL));
  if (resp.statusCode != 200) {
    throw GarthException("Failed to fetch OAuth consumer info");
  }
  _oauthConsumer = Map<String, String>.from(jsonDecode(resp.body));
  return _oauthConsumer!;
}