CodeDisplay constructor
CodeDisplay(
- String code, {
- CodeDisplayColorThemes? codeColorTheme,
- double? width,
- double? height,
- bool? showCopyButton,
- Widget? copyButtonReplacement,
- BoxDecoration? boxDecoration,
- TextStyle? commentTextStyle,
- TextStyle? baseTextStyle,
- TextStyle? classTextStyle,
- TextStyle? keywordTextStyle,
- TextStyle? stringTextStyle,
- TextStyle? punctuationTextStyle,
- EdgeInsets? padding,
- Key? key,
Creates a CodeDisplay widget.
The code parameter is the code to be displayed.
The codeColorTheme parameter specifies
the color theme for syntax highlighting.
The width and height parameters can be used
to set the dimensions of the widget.
The showCopyButton parameter is used
for deciding if the copy button should be shown.
The boxDecoration parameter allows customizing
the box decoration of the code display.
The commentTextStyle, baseTextStyle, classTextStyle,
keywordTextStyle, stringTextStyle, and punctuationTextStyle
parameters can be used to customize
the styles of different parts of the code.
The padding parameter specifies the padding of the code container.
Implementation
CodeDisplay(
this.code, {
this.codeColorTheme,
this.width,
this.height,
this.showCopyButton,
this.copyButtonReplacement,
this.boxDecoration,
this.commentTextStyle,
this.baseTextStyle,
this.classTextStyle,
this.keywordTextStyle,
this.stringTextStyle,
this.punctuationTextStyle,
this.padding,
super.key,
}) : _formatedCode = formatCode(code);