flutter_bbcode library

Classes

AbstractListTag
Base class for the List tags. Since both ordered and unordered list share some functionality in terms of rendering.
AbstractTag
The base class for any BBCode tag.
AdvancedTag
An advanced tag takes fully control over it's children. This can be useful when it requires different styling. Do note that it should respect the latest StyleTag and tap action of the renderer. This is mostly to ensure that the UrlTag keeps working.
BBCodeText
A Widget that displays rendered BBCode using the RichText widget.
BBStylesheet
A BBStylesheet contains all style related information required to render a text that contains BBCode including the parsers for tags.
BoldTag
This file holds all basic tags that come with the project. These range from the bold, italic, underline to img tags. Feel free to add any tags you feel like the project is currently missing. Basic implementation for b using the StyleTag. Defaults ot FontWeight.bold.
CenterAlignTag
ColorTag
Implements the color tag using the StyleTag. Only supports HEX colours.
FlutterRenderer
The flutter rendered walks through list of bbob.Nodes. The output is a InlineSpan which can be used by the RichText widget.
HeaderTag
Basic implementation of the h<number> tag. _textSize is used to define the new textSize.
ImgTag
Default img tag. Extends AdvancedTag because it's children should not be displayed. Instead we use those to create the image widget.
ItalicTag
LeftAlignTag
ListItem
Represents the * tag used in list to define an item.
ListItemStyle
Used to style the prefix of a list item.
ListRenderData
Data used to render the list properly. It contains both the style for the list and other relevant information used to make the list.
ListTag
Represents BBCode list. Requires both styles for ordered and unordered lists.
OrderedList
Represents the ordered list tag.
ParsedElement
A ParsedElement is used to store parsed elements that might need future edits.
QuoteTag
RenderData
Empty class from which other nodes can extend. Render data is used to give information about the rendering process to child nodes.
RightAlignTag
SpoilerTag
StrikeThroughTag
StyleTag
The StyleTag changes the way the text is rendered. It pushes a new style on to the stack and pops it after it has been used. If more control is required the onTagStart and onTagEnd methods can be overwritten. The UrlTag does this for example. Most of the style tags should inhirit from this.
UnderlineTag
UnorderedList
Represents the unordered list tag.
UrlTag
Default implementation of the URL tag. Defaults to a log function when clicked.
WrappedStyleTag
An wrapped style tag allows the tag to wrap the children with a style. This can for example be useful for \QUOTE tags that require a different styling around them.

Enums

ListType
The style of the list. This is used by the list items to generate the correct style

Functions

defaultBBStylesheet({TextStyle? textStyle}) BBStylesheet
Returns the default BBCode style.
parseBBCode(String data, {BBStylesheet? stylesheet, dynamic onError(Object error, StackTrace? stackTrace)?}) List<InlineSpan>
Parses BBCode InlineSpan elements. These elements can then be used in a RichText widget.

Typedefs

BBCodeErrorWidgetBuilder = Widget Function(BuildContext context, Object error, StackTrace? stackTrace)
Signature used by BBCodeText.errorBuilder to create a replacement when BBCode could not be parsed correctly.

Exceptions / Errors

StylesheetException
Thrown when illegal actions performed on a BBStyleSheet
TagRenderException
An exception when rendering a tag results in an error. This is usually due to faulty implementations.