upload method

Future upload(
  1. String filePath, {
  2. required String locale,
  3. bool overwrite = false,
  4. bool reviewed = false,
  5. List<String> tagsAdded = const [],
  6. List<String> tagsUpdated = const [],
})

Implementation

Future upload(
  String filePath, {
  required String locale,
  bool overwrite = false,
  bool reviewed = false,
  List<String> tagsAdded = const [],
  List<String> tagsUpdated = const [],
}) async =>
    _dio.post(
      _uploadUrl,
      data: FormData.fromMap({
        "file": await MultipartFile.fromFile(filePath),
      }),
      queryParameters: {
        "lang_code": locale,
        "overwrite": overwrite,
        "reviewed": reviewed,
        for (String tag in tagsAdded) "tag_added": tag,
        for (String tag in tagsUpdated) "tag_updated": tag,
      },
    );