CodeSnippet class

A code snippet component with copy button (Supabase-style)

Inheritance

Constructors

CodeSnippet({required String code, String? language, bool showLineNumbers = false, bool showCopyButton = true, double? maxHeight, String? title, Key? key})
const

Properties

code → String
The code to display
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one component replaces another component in the tree.
finalinherited
language → String?
Programming language (for syntax highlighting hints)
final
maxHeight → double?
Maximum height (scrollable if exceeded)
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showCopyButton → bool
Whether to show copy button
final
showLineNumbers → bool
Whether to show line numbers
final
title → String?
Title/filename
final

Methods

createElement() → Element
Creates a StatefulElement to manage this component's location in the tree.
inherited
createState() → State<CodeSnippet>
Creates the mutable state for this component at a given location in the tree.
override
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.
inherited

Static Properties

styles → List<StyleRule>
final