fix: handle null context in MarkdownHtmlWidget and improve test stability with pumpAndSettle calls

This commit is contained in:
mso7nueh
2026-01-13 13:03:58 +03:00
parent 7b425e56f1
commit c786821275
9 changed files with 22 additions and 1 deletions

View File

@@ -41,7 +41,7 @@ class MarkdownHtmlWidget extends StatelessWidget {
extensionSet: md.ExtensionSet.gitHubFlavored,
);
final screenWidth = MediaQuery.of(context).size.width;
final screenWidth = MediaQuery.maybeOf(context)?.size.width ?? 400.0;
final defaultImageWidth = imageWidth ?? (screenWidth - 32);
final defaultTextColor = textColor ?? Colors.black87;
final defaultFontSize = fontSize ?? 16.0;