a-marenkov / gsheets

A Dart library for working with Google Sheets API.
Other
78 stars 31 forks source link

get data from specific sheet #81

Open nashihu opened 2 years ago

nashihu commented 2 years ago

Hello, thanks for the library

I'm using several sheets in my datasource. How do i get data from sheet2, sheet3, etc?

Thank you

jeff9315 commented 2 years ago

It's in the example code, we see how to specify both the spreadsheet (_spreadsheertID) and the tab 'example'. If you create different variables or a list of tabs, then you can specify which one to use.

This is the variable for the specific tab in the worksheet.
// fetch spreadsheet by its id
  final ss = await gsheets.spreadsheet(_spreadsheetId);
..
// get worksheet by its title
  var sheet = ss.worksheetByTitle('example');
AConteh33 commented 1 year ago

// This is the error E/flutter (26186): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: NoSuchMethodError: The getter 'cells' was called on null.

//and this is the code var cell = await sheet.cells.cell(column: day, row: time);

//I have done all I could nothing is working keep showing me the error please help if you have the solution.

bradintheusa commented 1 year ago

How do you set the value for sheet