Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Latest commit

 

History

History
19 lines (16 loc) · 538 Bytes

File metadata and controls

19 lines (16 loc) · 538 Bytes

flutter_html_code

Code widget for flutter_html. Uses the flutter_highlighter package to render <code> blocks. Detects the language from the attribute or uses the defaultLanguage.

Registering the CodeExtension:

Widget html = Html(
    extensions: [
        CodeExtension(
            style: TextStyle(fontSize: 16),
            theme: shadesOfPurpleTheme,
            borderRadius: BorderRadius.circular(4),
            defaultLanguage: html,
        ),
    ],
);