CodeSnippetTheme class

Theme configuration for CodeSnippet components.

CodeSnippetTheme provides styling options for code snippet containers including background colors, borders, padding, and visual appearance. It integrates with the shadcn_flutter theming system to ensure consistent styling across code display components.

Used with ComponentTheme to apply theme values throughout the widget tree.

Example:

ComponentTheme<CodeSnippetTheme>(
  data: CodeSnippetTheme(
    backgroundColor: Colors.grey.shade900,
    borderColor: Colors.grey.shade700,
    borderWidth: 1.0,
    borderRadius: BorderRadius.circular(8.0),
    padding: EdgeInsets.all(16.0),
  ),
  child: MyCodeSnippetWidget(),
);

Constructors

CodeSnippetTheme.new({Color? backgroundColor, Color? borderColor, double? borderWidth, BorderRadiusGeometry? borderRadius, EdgeInsetsGeometry? padding})
Creates a CodeSnippetTheme.
const

Properties

backgroundColor Color?
Background color of the code snippet container.
final
borderColor Color?
Border color of the code snippet container.
final
borderRadius BorderRadiusGeometry?
Border radius for the code snippet container corners.
final
borderWidth double?
Border width of the code snippet container in logical pixels.
final
hashCode int
The hash code for this object.
no setteroverride
padding EdgeInsetsGeometry?
Padding for the code content area.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({ValueGetter<Color?>? backgroundColor, ValueGetter<Color?>? borderColor, ValueGetter<double?>? borderWidth, ValueGetter<BorderRadiusGeometry?>? borderRadius, ValueGetter<EdgeInsetsGeometry?>? padding}) CodeSnippetTheme
Creates a copy of this theme with the given values replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override