pub struct MarkdownBody {
pub key: Option<KeyRef>,
pub config: MarkdownConfig,
}Expand description
Markdown laid out in a column, for a parent that scrolls or sizes it.
Fields§
§key: Option<KeyRef>§config: MarkdownConfigfit_content is true by default.
Implementations§
Source§impl MarkdownBody
impl MarkdownBody
Sourcepub fn new(data: impl Into<String>) -> MarkdownBody
pub fn new(data: impl Into<String>) -> MarkdownBody
Renders the Markdown data.
Source§impl MarkdownBody
impl MarkdownBody
Sourcepub fn key(self, key: KeyRef) -> MarkdownBody
pub fn key(self, key: KeyRef) -> MarkdownBody
Sets the key.
Sourcepub fn options(self, options: Options) -> MarkdownBody
pub fn options(self, options: Options) -> MarkdownBody
Sets the extensions the text is parsed with.
Sourcepub fn style_sheet(self, style_sheet: MarkdownStyleSheet) -> MarkdownBody
pub fn style_sheet(self, style_sheet: MarkdownStyleSheet) -> MarkdownBody
Sets the look, in place of the inherited DefaultMarkdownStyle.
Sourcepub fn fit_content(self, fit_content: bool) -> MarkdownBody
pub fn fit_content(self, fit_content: bool) -> MarkdownBody
Sets whether a block takes its content’s width rather than the full width.
Sourcepub fn on_tap_link(
self,
on_tap_link: impl Fn(&mut App, &str, &str) + 'static,
) -> MarkdownBody
pub fn on_tap_link( self, on_tap_link: impl Fn(&mut App, &str, &str) + 'static, ) -> MarkdownBody
Calls on_tap_link with a tapped link’s address and title.
Sourcepub fn image(
self,
image: impl Fn(&mut App, &Image) -> WidgetRef + 'static,
) -> MarkdownBody
pub fn image( self, image: impl Fn(&mut App, &Image) -> WidgetRef + 'static, ) -> MarkdownBody
Builds each image with image.
Sourcepub fn checkbox(
self,
checkbox: impl Fn(&mut App, bool) -> WidgetRef + 'static,
) -> MarkdownBody
pub fn checkbox( self, checkbox: impl Fn(&mut App, bool) -> WidgetRef + 'static, ) -> MarkdownBody
Builds each task item’s checkbox with checkbox.
Sourcepub fn bullet(
self,
bullet: impl Fn(&mut App, &Bullet) -> WidgetRef + 'static,
) -> MarkdownBody
pub fn bullet( self, bullet: impl Fn(&mut App, &Bullet) -> WidgetRef + 'static, ) -> MarkdownBody
Builds each list item’s bullet with bullet.
Sourcepub fn highlight_code(
self,
highlight_code: impl Fn(&mut App, Option<&str>, &str) -> TextSpan + 'static,
) -> MarkdownBody
pub fn highlight_code( self, highlight_code: impl Fn(&mut App, Option<&str>, &str) -> TextSpan + 'static, ) -> MarkdownBody
Spans each code block’s text with highlight_code.
Trait Implementations§
Source§impl Debug for MarkdownBody
impl Debug for MarkdownBody
Source§impl StatelessWidget for MarkdownBody
impl StatelessWidget for MarkdownBody
Source§fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
Describes the part of the user interface represented by this widget. Read more
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
Dart’s
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn debug_check_constructor(&self)
fn debug_check_constructor(&self)
Dart’s constructor asserts that relate two or more arguments. Read more
Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Dart’s
this is PreferredSizeWidget: a widget that implements PreferredSizeWidget
answers with itself, which is what a parent asking an erased child for its preferred
size reads.Auto Trait Implementations§
impl !RefUnwindSafe for MarkdownBody
impl !Send for MarkdownBody
impl !Sync for MarkdownBody
impl !UnwindSafe for MarkdownBody
impl Forget for MarkdownBody
impl Freeze for MarkdownBodywhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
InternalBitFlags: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
PhantomData<String>: Freeze,
*const RcInner<Paint> is !null: Freeze,
PhantomData<RcInner<Paint>>: Freeze,
PhantomData<Shadow>: Freeze,
PhantomData<FontFeature>: Freeze,
PhantomData<FontVariation>: Freeze,
*const RcInner<dyn BoxBorder> is !null: Freeze,
PhantomData<RcInner<dyn BoxBorder>>: Freeze,
PhantomData<BoxShadow>: Freeze,
*const RcInner<dyn Gradient> is !null: Freeze,
PhantomData<RcInner<dyn Gradient>>: Freeze,
*const RcInner<dyn TableColumnWidth> is !null: Freeze,
PhantomData<RcInner<dyn TableColumnWidth>>: Freeze,
*const RcInner<dyn Fn(&mut App, &str, &str)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &str, &str)>>: Freeze,
*const RcInner<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>>>: Freeze,
*const RcInner<dyn Fn(&mut App, bool) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, bool) -> Rc<dyn Widget>>>: Freeze,
*const RcInner<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>>>: Freeze,
*const RcInner<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan>>: Freeze,
impl Move for MarkdownBody
impl Unpin for MarkdownBodywhere
Rc<dyn Key>: Unpin,
*const u8 is !null: Unpin,
InternalBitFlags: Unpin,
&'static dyn ColorExtension: Unpin,
Rc<dyn ColorExtension>: Unpin,
Rc<Paint>: Unpin,
Rc<dyn BoxBorder>: Unpin,
Rc<dyn Gradient>: Unpin,
Rc<dyn TableColumnWidth>: Unpin,
Rc<dyn Fn(&mut App, &str, &str)>: Unpin,
Rc<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>>: Unpin,
Rc<dyn Fn(&mut App, bool) -> Rc<dyn Widget>>: Unpin,
Rc<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>>: Unpin,
Rc<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan>: Unpin,
impl UnsafeUnpin for MarkdownBodywhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const RcInner<Paint> is !null: UnsafeUnpin,
PhantomData<RcInner<Paint>>: UnsafeUnpin,
PhantomData<Shadow>: UnsafeUnpin,
PhantomData<FontFeature>: UnsafeUnpin,
PhantomData<FontVariation>: UnsafeUnpin,
*const RcInner<dyn BoxBorder> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn BoxBorder>>: UnsafeUnpin,
PhantomData<BoxShadow>: UnsafeUnpin,
*const RcInner<dyn Gradient> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Gradient>>: UnsafeUnpin,
*const RcInner<dyn TableColumnWidth> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn TableColumnWidth>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &str, &str)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &str, &str)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &Image) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, bool) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, bool) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &Bullet) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, Option<&str>, &str) -> TextSpan>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
The widget as a tree node, made where this is called: its
creation_location.