1

Using the gsheets library, I can calculate the total number of rows in a specific sheet:

var sheet = ss.worksheetByTitle('test');
var rows = await sheet?.values.map.allRows();
var totalRows = rows?.length;

However, the above code requires fetching the row data from the sheet. Is it possible to get the total number of rows without fetching the actual data?

B Faley
  • 17,120
  • 43
  • 133
  • 223

2 Answers2

0

you can use Worksheet().rowCount;

I found it in this file Gsheets here

Bigfoot
  • 336
  • 1
  • 3
-1

You can easily do this by allRow method here is an example: //get worksheetbytitle first! var allRows = await _workSheet?.values.map.allRows(); var totalRows = allRows?.length; // print row data for (var i = 0; i < allRows!.length; i++) { print(allRows[i]); }

  1. List item