Repository navigation
Suppress Markdown images by default and add LlmMessageStyle.imageBuilder - #206
Merged
Merged
Conversation
`LlmMessageView` previously rendered LLM output through `MarkdownBody` without specifying an `imageBuilder`, causing `flutter_markdown_plus` to use `kDefaultImageBuilder` and automatically fetch remote image URLs or open local file paths from untrusted model output. - Suppress Markdown images in `LlmMessageView` by default (`SizedBox.shrink()`). - Add an optional `imageBuilder` property to `LlmMessageStyle` (defaults to `null`) so applications can explicitly opt in to custom Markdown image rendering. - Make `LlmMessageStyle` `final`. - Suppress Markdown images in the example `RecipeResponseView` and forward `imageBuilder` in `_darkLlmMessageStyle()`. - Add unit and widget tests in `test/llm_message_image_test.dart` and bump version to `1.1.0`.
ditman
approved these changes
Nov 17, 2026
ditman
left a comment
Member
There was a problem hiding this comment.
This sounds like a breaking change, so it probably should roll a major version.
Also, the lints:
info - example/lib/recipes/views/recipe_list_view.dart:5:1 - 'package:flutter/material.dart' is deprecated and shouldn't be used. Use package:material_ui/material_ui.dart instead. This feature was deprecated after v3.47.0-0.0.pre. Try replacing the use of the deprecated member with the replacement. - deprecated_member_use
We need to migrate to package:material_ui (that probably can happen in a separate PR)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes b/528774200
Fixes b/584414975
LlmMessageViewpreviously rendered LLM output throughMarkdownBodywithout specifying animageBuilder, causingflutter_markdown_plusto usekDefaultImageBuilderand automatically fetch remote image URLs or open local file paths from untrusted model output.LlmMessageViewby default (SizedBox.shrink()).imageBuilderproperty toLlmMessageStyle(defaults tonull) so applications can explicitly opt in to custom Markdown image rendering.LlmMessageStylefinal.RecipeResponseViewand forwardimageBuilderin_darkLlmMessageStyle().test/llm_message_image_test.dartand bump version to1.1.0.Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. You must list at least one issue.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.