Skip to content

Rich Text

A representation of Typography.

NikuRichText accepts all the props as same as RichText.

dart
// Using namespace
n.RichText(
    n.TextSpan(""),
);

// Using Niku Prefix
NikuRichText(
    NikuTextSpan(""),
);

Example Usage

dart
n.RichText(
    "Rich Text: ".n.span
        ..color = Colors.black
        ..children = [
            n.TextSpan("with "),
            n.TextSpan("underline")..underline,
            n.TextSpan(" and "),
            n.TextSpan("italic")..italic,
        ],
);

Using extension

dart
"Rich Text: ".n.rich
    ..useSpan((w) => w
        ..color = Colors.black
        ..children = [
            "with ".n.span,
            "underline".n.span..underline,
            " and ".n.span,
            "italic".n.span..italic,
        ]);

Defination

View Defination on pub.dev