apiMap top-level property

Map<String, Future Function(Object? url, {Object? headers})> apiMap
final

Implementation

final apiMap = {
  "get": (Object? url, {Object? debug, Object? headers}) {
    bool _debug = false;
    if (debug != null) {
      _debug = debug as bool;
    }
    Map<String, String> _headers = {};
    if (headers is Map) {
      headers.forEach((key, value) {
        _headers[key.toString()] = value.toString();
      });
    }
    return Api.get(url as String, debug: _debug, headers: _headers);
  },
  "post": (Object? url, {Object? body, Object? debug, Object? headers}) {
    bool _debug = false;
    if (debug != null) {
      _debug = debug as bool;
    }
    Map<String, String> _headers = {};
    if (headers is Map) {
      headers.forEach((key, value) {
        _headers[key.toString()] = value.toString();
      });
    }
    return Api.post(url as String,
        body: body, debug: _debug, headers: _headers);
  },
  "uploadFile": (Object? url,
      {Object? headers, Object? imagePath, Object? fieldName}) {
    Map<String, String> _headers = {};
    if (headers is Map) {
      headers.forEach((key, value) {
        _headers[key.toString()] = value.toString();
      });
    }
    return Api.uploadFile(url as String,
        headers: _headers,
        imagePath: imagePath as String,
        fieldName: fieldName as String);
  }
};