typeset 0.1.0+7 typeset: ^0.1.0+7 copied to clipboard
This supports the input from backend to be formatted with different formatters
TypeSet #
This supports the input from backend to be formatted with different formatters. Text style that will support bold, italic and underline text coming from the server The implementation will be same as we see on WhatsApp.
i.e.
- Bold Text will be wrapped in *asterisk*
- Italic Text will be wrapped in _underscore_
- Underline Text will be wrapped in ~tilde~
- Bold, Italic and Underline Text will be wrapped in *asterisk* _underscore_ ~tilde~
Installation 💻 #
❗ In order to start using typeset you must have the Flutter SDK installed on your machine.
Add typeset
to your pubspec.yaml
:
dependencies:
typeset:
Install it:
flutter packages get
Usage
import 'package:typeset/typeset.dart';
TypeSet('Hello, *World!*');
// returns 'World' with bold text
TypeSet('Hello, _World_!');
// returns 'World' with italic text
TypeSet('Hello, ~World~!');
// returns 'World' with underline text
TypeSet('*Hello*, _World_ ~World~!');
// returns 'Hello' with bold text, 'World' with italic text and 'World' with underline text
//TypeSet also has a style property which can be used to style the text
TypeSet('Hello, *World!*', style: TextStyle(color: Colors.red));
// returns 'World' with bold text and red color
Features and bugs #
Please file feature requests and bugs at the issue tracker.