Code Display Box

The code display box is an enhanced version of the flutter_highlight widget.
Widget Class Location
The FUICodeDisplayBox widget class could be found in:
Widget Theme Location
The FUICodeDisplayBoxTheme class serves as the theme class for the FUICodeDisplayBox. Kindly explore this theme class to ascertain various settings applicable to the FUICodeDisplayBox.
Accessing the theme
To access the theme class object, do the following:
Usage
Common Usage
To have a different theme
The FUICodeDisplayBox accepts two primary parameters: text, which represents the source code in string format, and lang, which specifies the desired language for the syntax parser.
Parameters
Parameters | Description |
|---|---|
String text | The source code or just text data to be parsed and highlighted according to the syntax defined in |
TextStyle? textStyle | The text style of the text data. Use this to override the default style (e.g. fontSize, fontWeight, etc.). |
String lang | The language code name for the highlighter. Please refer to https://github.com/git-touch/highlight.dart/tree/master/highlight/lib/languages for the available language parser / highlighter. |
Map<String, TextStyle> theme | This field only takes in the available map value from https://github.com/git-touch/highlight.dart/tree/master/flutter_highlight/lib/themes. Please refer to the list of themes available. |
double? width | The desired width of the display box. |
double? height | The desired height of the display box. |