Skip to content

Commit b007376

Browse files
Fix test failures - handle loading state in error callback and fix numbered list detection
Co-authored-by: santoshvandari <63558580+santoshvandari@users.noreply.github.com>
1 parent 85e0fb3 commit b007376

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

lib/src/docx_view.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,15 @@ class _DocxViewState extends State<DocxView> {
194194

195195
/// Handles errors by calling the [onError] callback if provided, or displaying the error message.
196196
void _handleError(Exception error) {
197+
setState(() {
198+
isLoading = false;
199+
});
200+
197201
if (widget.onError != null) {
198202
widget.onError!(error);
199203
} else {
200204
setState(() {
201205
fileContent = error.toString();
202-
isLoading = false;
203206
});
204207
}
205208
}

lib/src/extract_text_from_docx.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ String extractTextFromDocxBytes(Uint8List bytes) {
4343
paragraph.findAllElements('w:t').map((node) => node.innerText).join();
4444

4545
// Check for numbering information in the paragraph
46-
final numIdNode = paragraph.findElements('w:numId').firstOrNull;
46+
final numIdNode = paragraph.findAllElements('w:numId').firstOrNull;
4747
final numId = numIdNode?.getAttribute('w:val');
4848

4949
// Manage numbering: increment or reset based on numId changes

0 commit comments

Comments
 (0)