Flutter - How to add a row in Excel Online

Viewed 26

I am trying to develop an application which will work with an Excel sheet stored in OneDrive (Excel Online). I want to use flutter to add data into the excel sheet however I cannot find any APIs to do so. So far I only found the flutter excel package, however as per my understanding it is only used for local files.

I can download the file, update it and then reupload the file however, I would prefer everything to happen online. Is it possible to do so? I know flutter has a Google Sheets API is a similar thing available for Excel Online?

1 Answers
  1. You should create GCP project to access Google Cloud APIs. For creating a google cloud project, see https://developers.google.com/workspace/guides/get-started.

  2. You need to enable Google Sheet API.

  3. You need to create required credentials in the created project. https://developers.google.com/workspace/guides/create-credentials

      i. API key  - For public sheets.
     ii. OAuth Credentials - For private sheets.
    iii. Service Account Credentials - For private sheets.
    
  4. Refer here for the Google sheet API for writing to a particular sheet. There you can have curl requests for each operations.
    https://developers.google.com/sheets/api/samples/writing

  5. Finally, you can use the curl request in flutter as mentioned here. https://pub.dev/documentation/curl/latest/

Related