Open tajquanghuy opened 1 year ago
when I call this function Future uploadFormData() async { final ggSheet = GSheets(credentials); final ss = await ggSheet.spreadsheet(spreadsheetId).catchError((error) { }); var sheet = ss.worksheetByTitle(spreadsheetName); sheet ??= await ss.addWorksheet(spreadsheetName).catchError((error) { }); final dataForms = await sheet.values.map.allRows().catchError((error) { //not caught error }); final index = (dataForms?.length ?? 0) + Constants.nextGoogleSheetRowPosition; return await sheet.values.insertRow(index, formData.getFormDataToList()).catchError((error) { //not caught error }); } final result = await uploadFormData().catchError((error){ //not caught error });
when I call this function Future uploadFormData() async {
final ggSheet = GSheets(credentials);
final ss = await ggSheet.spreadsheet(spreadsheetId).catchError((error) {
});
var sheet = ss.worksheetByTitle(spreadsheetName);
sheet ??= await ss.addWorksheet(spreadsheetName).catchError((error) {
});
final dataForms = await sheet.values.map.allRows().catchError((error) {
//not caught error
});
final index = (dataForms?.length ?? 0) + Constants.nextGoogleSheetRowPosition;
return await sheet.values.insertRow(index, formData.getFormDataToList()).catchError((error) {
//not caught error
});
}
final result = await uploadFormData().catchError((error){
//not caught error
});