Skip to content
On this page

Rich Text

A representation of Typography.

NikuRichText accepts all the props as same as RichText.

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

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

Example Usage

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

"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