A simple widget that renders BBCode in Flutter.

Overview

PubDev

A simple display for BBCode in Flutter. Supports custom tags and styles.

Features

  • Render BBCode into human readable text.
  • Support for custom tags

Preview

Preview 1 Preview 2

Getting started

  1. Install the package using the instruction on the installation page.

Usage

A fully working example can be found on Github.

After installing the package displaying BBCode is rather straighforward. When using this code note that you will be using ALL available BBCode parsers.

Widget parsedBBCode = BBCodeText(data: _yourString);

The default style currently used is TextStyle(color: Colors.black, fontSize: 14). This can be overwritten using the defaultStyle parameter.

In order to make the package versatile as possible it's possible to define your own tags, or overwrite existing ones. To supply your own tag parsers use the optional tagParsers argument.

Additional information

Currently support tags by default

  • [B] - Bold text
  • [I] - Italic text
  • [U] - Underlined text
  • [S] - Strikethrough text
  • [COLOR=#HEX] - Coloured text based on HEX
  • [H1] - Header text, supported up till [H6]
  • [URL=https://google.com] - Supported with or without text. Can also be used to surrouned an URL to make it clickable. Default action is a log message. Opening a webbrowser or any other actions need to be implemented by the developer.
  • [IMG=src] - Display an image from the internet.
  • [QUOTE=Marten] - Used to wrap text in a quote block.
  • [SPOILER=Name] - Used to create a clickable spoiler tag.

Creating your own tags

You can create your own tags by either extending the StyleTag, WrappedStyleTag or AdvancedTag classes. The last one takes care of all BBCode it self. This can be useful in certain situations, but the StyleTag should be sufficient for most style changes. The WrappedStyleTag can be used to wrap a style around the tag. An example of a tag that implements this is the [quote] tag.

Contribute to the project

Feel free to create issues and pull-requests on Github. I will take a look at them as soon as possible.

You might also like...

Custom dropdown widget allows to add highly customizable widget in your projects with proper open and close animations and also comes with form required validation.

Custom dropdown widget allows to add highly customizable widget in your projects with proper open and close animations and also comes with form required validation.

Custom Dropdown Custom Dropdown package lets you add customizable animated dropdown widget. Features Lots of properties to use and customize dropdown

Dec 29, 2022

Iridium-reader-widget - Plug and play reader widget allowing to easily integrate an Iridium viewer inside any app

Plug and play reader widget allowing to easily integrate an Iridium viewer insid

Dec 31, 2022

Kullanmaya hazir widget cozumleri -Ready to use widget solutions

Ready to use widgets ( 🇹🇷 ) Projelerimde yararlı widget çözümleri kullanıyorum ve çoğu zaman orada kalıyor. Bunları hem ben hemde sizden gelenler il

Dec 27, 2022

This widget automatically scrolls the custom child widget to an infinite loop.

This widget automatically scrolls the custom child widget to an infinite loop.

Scroll Loop Auto Scroll This widget automatically scrolls the custom child widget to an infinite loop. Example Features Infinite Auto Scroll Custom ch

Dec 12, 2022

Widget that gives you the size of the widget in runtime.

Tailor Flutter widget that calculates the size of a widget in runtime. Usage Just wrap your widget with Tailor and get the size in the builder. The bu

Nov 2, 2022

QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter.

QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter.

QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter. Need help? Please do not submit an issue for a "

Jan 8, 2023

Flutter plugin to display a simple steps indicator line widget

Flutter plugin to display a simple steps indicator line widget

steps_indicator A simple steps indicator widget Installation Add steps_indicator: ^1.3.0 in your pubspec.yaml dependencies. And import it: import 'pac

Oct 18, 2022

A flutter library provide a simple roulette widget which usually used for lottery

A flutter library provide a simple roulette widget which usually used for lottery

This is a library provide a simple roulette widget which usually used for lottery. Features Quickly build roulettes Build roulettes with different par

Apr 6, 2022

simple flutter bottom navigation bar widget

simple flutter bottom navigation bar widget

bmnav A very flexible Flutter implementation of the Bottom Navigation Bar. Get Started Add bmanv to your pubspec.yaml file: dependencies: bmnav: ^0.

Oct 8, 2022
Comments
  • Bump flutter_lints from 1.0.4 to 2.0.1

    Bump flutter_lints from 1.0.4 to 2.0.1

    Bumps flutter_lints from 1.0.4 to 2.0.1.

    Commits
    • 8e3ce4f Document how to suggest lints for flutter_lints (#1546)
    • b7cd2f4 [pigeon] Minor fixes to NNBD type handling in Dart (#1543)
    • cb22b39 [pigeon] Enable NNBD in tool (#1532)
    • 48cdaf6 [flutter_markdown] update markdown dependency (#1395)
    • 3f8a502 [pigeon] Remove support for non-NNBD (#1524)
    • 4eda7ad [pigeon] Fixes bug where Dart FlutterApis would assert that a nullable argu...
    • dff39d7 [go_router]refactor runtime check to assert (#1362)
    • 5600590 [go_router] Export inherited_go_router.dart file (#1145)
    • d8bf76e [flutter_markdown] Remove build status from README.md (#1326)
    • bc223c1 Remove checked in binaries from flutter/packages. (#1338)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • pub.dev - Release

    pub.dev - Release

    The goal is to release this project to pub.dev.

    The problem is that the BBCode parser created 2 years ago that this project depends on hasn't been updated. I went out the way to do this my self, but sadly packages cannot be uploaded to pub.dev that contain any links.

    There are 2 methods for solving this issue:

    1. Republishing the package on pub.dev as my self.
    2. Including the source in the project itself.
    3. Waiting for the author to update the project.

    3 is preferred, but if the project is discontinued it might be worth to clone the source and become a maintainer.

    opened by MartenM 1
Owner
Marten
I make stuff! Love learning new stuff.
Marten
A Flutter 3D widget that renders Wavefront's object files.

Flutter Cube A Flutter 3D widget that renders Wavefront's object files. Getting Started Add flutter_cube as a dependency in your pubspec.yaml file. de

Zebiao Hu 221 Dec 22, 2022
Widget to count the amount of nested widget tree, useful in the dynamic construction of the interface when it is important to know the depth of widget.

widget_tree_depth_counter Widget Tree Depth Counter WidgetTreeDepthCounter is a simple widget to count the amount of nested widget tree, useful in the

Riccardo Cucia 4 Aug 1, 2022
MindInventory 15 Sep 5, 2022
A simple detailed flutter widget that looks almost the same as the real instagram mention widget.

Instagram Mention Widgets 'small details do matter' ❤️ This package provides simple and almost the same UI details that the real Instagram mention wid

AbdulMuaz Aqeel 20 Oct 10, 2022
Flip widget - A Simple Flip widget For Flutter

flip_widget Flip your widget. Usage FlipWidget( key: _flipKey, child: Co

null 24 Nov 13, 2022
A customizable carousel slider widget in Flutter which supports inifinte scrolling, auto scrolling, custom child widget, custom animations and built-in indicators.

flutter_carousel_widget A customizable carousel slider widget in Flutter. Features Infinite Scroll Custom Child Widget Auto Play Horizontal and Vertic

NIKHIL RAJPUT 7 Nov 26, 2022
Behruz Hurramov 0 Dec 29, 2021
FT-Custom-Widget - A Custom Widget Built With Flutter

Custom Widget Watch it on YouTube Product Screen Sample when you implement compl

Firgia 5 Mar 29, 2022
A Flutter widget to show an icon collection to pick. This widget extend TextField and has a similar behavior as TextFormField

icon_picker A Flutter widget to show an icon collection to pick. This widget extend TextField and has a similar behavior as TextFormField Usage In the

m3uzz Soluções em TI 11 Sep 27, 2022
A new Flutter project. Use of Padding Class(Widget) and Card Class (Widget)

Use_Of_Card_And_Padding_Class A new Flutter project. Use of Padding Class(Widget) and Card Class (Widget) Getting Started This project is a starting p

Avinandan Bose 1 Mar 18, 2022