share method

Future<String> share(
  1. String filePath, {
  2. int expire = 7 * Duration.minutesPerDay,
  3. List<int>? to,
  4. String password = '',
  5. int accessCount = -1,
})

Implementation

Future<String> share(String filePath,
    {int expire = 7 * Duration.minutesPerDay,
    List<int>? to,
    String password = '',
    int accessCount = -1}) async {
  var req = ShareRequest(
      filePath: filePath,
      expire: expire,
      to: to,
      password: password,
      accessCount: accessCount);

  dio.Response<String> res =
      await _client.post('/share', data: serializeRequest(req));

  var resp = getResponse(res);
  var shareResponse = ShareResponse()
    ..mergeFromProto3Json(jsonDecode(resp.data));

  return shareResponse.link;
}