Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

simple rich text

easily format flutter rich text with simple format characters:

r’/this is all three/ (bold, underlined, and /italicized/). {push:home}click to navigate to home screen’

simple_rich_text
easily format flutter rich text with simple format characters.

format characters

character format effect
asterisk (*) bold
slash (/) italicize
underscore (_) underline

attributes

attribute pairs are placed in curly brackets immediately after first character marker.
each pair is separated by a semicolon (;).
each pair has syntax name:value.

key meaning
color red, green, blue, black, white, grey, etc
pop pop the navigation stack
push push the value onto the navigation stack
repl replace the top route on the navigation stack

features

  • support text hyperlinks to other screens by preceding formatted text with route inside curly brackets: e.g., “… {calendar}go to calendar screen“.

sample inputs:

'this is /italic/'

'this is *bold*'

'*_/this is all three*_/ (*bold*, _underlined_, and /italicized/)'

'you can quote characters to not format a word *bold*'

'this is _underline_'

'go to _{/myroute}home_ page'

'this is ~important~(red).'

'this is _*bold and underlined*_.'

requirements

ancestor must have textdirection set (required by internal richtext widget), either through materialapp widget or explicitly wrapped by a directionality widget:

directionality(
    child: simplerichtext(text: 'peter', term: 't'),
    textdirection: textdirection.ltr)

pull requests

pull requests are welcome!

usage

add a new dependency line to your project/pubspec.yaml file:

dependencies:
  ...
  simple_rich_text: ^1.0.28      # use latest version

don’t forget to flutter pub get.

examples

see the example directory rich text.


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.