3

I'm creating an application that writes data to a google sheet and I now need to be able to READ that data to be used in an function that will assist with an autocomplete functionality. i.e. I need to be able to extract specific information from different rows and cells in the Google Sheet. Are there any examples of how to use the Google Sheet API for Flutter in order to read data from the sheet and be used in an application?

I used this tutorial for writing to the sheet: https://medium.com/mindorks/storing-data-from-the-flutter-app-google-sheets-e4498e9cda5d

I have read through this "Basic reading" document: https://developers.google.com/sheets/api/samples/reading

As well as the documentation for the googleapis flutter package: https://pub.dev/packages/googleapis

This stackoverflow answer (https://stackoverflow.com/a/48485898/9554434) was given as a suggestion for using APIs, but not how to specifically use the Google Sheets API.

Any assistance would be appreciated.

Michael T
  • 756
  • 3
  • 13
  • 31
  • Mybe try getting a look at [this method](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/get) that basically explains how to get the data of a Spreadsheet once you have it setted up. – Mateo Randwolf Feb 26 '20 at 15:47
  • Thanks @Mateo I did stumble upon that too, but didn't know how to translate it into Dart code. – Michael T Feb 26 '20 at 16:17

1 Answers1

0

Good thing, there is a part 2 of "Getting data from Google Sheets → Flutter App — Part 2". You can continue of what you've done with the first tutorial.

If you've followed the exact same method from the first tutorial, you'll need to update the AppScript adding the doGet() and update your form controller code to return the data from the AppScript.

If you really need to use Google API's, check this for reference. Also, this gsheets plugin could also help.

MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65