getData method

Future<String> getData(
  1. String fileID
)

GET the data of fileID's file as a string

Implementation

Future<String> getData(String fileID) async {
  final file = await driveAPI.files.get(
    fileID,
    downloadOptions: DownloadOptions.fullMedia,
  ) as Media;

  String fileData = "";
  await file.stream.listen((bytes) {
    fileData += String.fromCharCodes(bytes);
  }).asFuture();
  return fileData;
}