updateFile method

Future<void> updateFile(
  1. String fileID,
  2. String data
)

Overwrite an existing file of fileID with new data

Please use this command with caution, as this is equivalent to deleting the existing data in the file.

If you need to append data to the end of a file, use appendFile.

Implementation

Future<void> updateFile(String fileID, String data) => driveAPI.files.update(
      File(),
      fileID,
      uploadMedia: Media(
        Stream.value(ascii.encode(data)),
        data.length,
      ),
    );