-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[flutter_markdown] Pass parent TextStyle down to MarkdownElementBuilder.visitElementAfter #3281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f2e66c3
8f6047d
f3770fc
de053eb
22c6b16
1315839
75adc21
f40060b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
## NEXT | ||
## 0.6.15 | ||
|
||
* Introduce a new `MarkdownElementBuilder.visitElementAfterWithContext()` method passing the widget `BuildContext` and | ||
the parent texts' `TextStyle`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. text's |
||
This should allow custom syntax implementations to get data from the current context, as well as properly style any | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changelog should just describe the change (the first sentence); it doesn't need to provide the motivation for it. |
||
text, e.g. a color syntax can make parts of a headline colored, while still keeping the font size of the headline. | ||
* Aligns Dart and Flutter SDK constraints. | ||
|
||
## 0.6.14 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,13 +70,33 @@ abstract class MarkdownElementBuilder { | |
/// If you needn't build a widget, return null. | ||
Widget? visitText(md.Text text, TextStyle? preferredStyle) => null; | ||
|
||
/// Called when an Element has been reached, after its children have been | ||
/// visited. | ||
/// | ||
/// If [MarkdownWidget.styleSheet] has a style of this tag, will passing | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't parse as a sentence. I'm assuming this should say something like "has a style for this tag, it will be passed as [preferredStyle]."? |
||
/// to [preferredStyle]. | ||
/// | ||
/// If parent element has [TextStyle]'s set, it will be passed as | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "has a [TextStyle] set" |
||
/// [parentStyle]. | ||
/// | ||
/// If you needn't build a widget, return null. | ||
Widget? visitElementAfterWithContext( | ||
BuildContext context, | ||
md.Element element, | ||
TextStyle? preferredStyle, | ||
TextStyle? parentStyle, | ||
) { | ||
return visitElementAfter(element, preferredStyle); | ||
} | ||
|
||
/// Called when an Element has been reached, after its children have been | ||
/// visited. | ||
/// | ||
/// If [MarkdownWidget.styleSheet] has a style of this tag, will passing | ||
/// to [preferredStyle]. | ||
/// | ||
/// If you needn't build a widget, return null. | ||
@Deprecated('Use visitElementAfterWithContext() instead.') | ||
Widget? visitElementAfter(md.Element element, TextStyle? preferredStyle) => | ||
null; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Introduces"
See the CHANGELOG style guide linked from the PR descirption.