From e25f36550bf4d70da20e7ab827bc25c007eea34c Mon Sep 17 00:00:00 2001 From: splohmer <113967431+splohmer@users.noreply.github.com> Date: Thu, 21 Aug 2025 08:00:22 +0200 Subject: [PATCH] FIX: adding line higher than current maxRows will delete data in the sheet Currently if you use the function insertRow with an row index higher than maxRows - 1, will lead to data loss of the sheet data. This is because only in the case rowIndex <= maxRows - 1 the variable _data is filled, not in the other case. Later on the sheet data will be set with _data. --- lib/src/sheet/sheet.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/sheet/sheet.dart b/lib/src/sheet/sheet.dart index c1a6906f..1f9f3805 100644 --- a/lib/src/sheet/sheet.dart +++ b/lib/src/sheet/sheet.dart @@ -664,6 +664,8 @@ class Sheet { }); } }); + } else { + _data = _sheetData; } } _data[rowIndex] = {0: Data.newData(this, rowIndex, 0)};