Show Progress When Uploading file to google drive in Flutter

Viewed 133

How to show the progress, of files being uploaded to google drive in flutter? below is my code, how can I rewrite it to show the progress in percentage?

Not mean progress bar, I just want to show the progress percentage. Thanks.

    await driveApi.files
            .create(
          fileToUpload,
          supportsAllDrives: true,
          uploadMedia: drive.Media(
            zipFile.openRead(),
            zipFile.lengthSync(),
          ),
        )
            .then((value) async {
          await zipFile.delete();
          ScaffoldMessenger.of(context).showSnackBar(
            const SnackBar(
              content: Text('File uploaded successfully'),
            ),
          );
        });

1 Answers

check this link github this show how you can use it..

Related