RomanticShaderWidget class

Renders a fragment shader asset with optional gesture-driven uniforms.

This widget manages shader loading, runtime uniform updates, optional animation ticking, and adaptive render scaling.

Inheritance

Constructors

RomanticShaderWidget({Key? key, required String shaderAssetPath, Widget? child, Color fallbackColor = Colors.transparent, bool enableGestureControls = true, dynamic onGestureUpdate(double mouseX, double mouseY, double cameraOffsetX, double cameraOffsetY, double viewportScale)?, double mouseSensitivity = 0.02, ShaderUniforms uniforms = const ShaderUniforms(), required ShaderUniformBindings uniformBindings, Duration animationDuration = Duration.zero, Duration gestureThrottleDuration = const Duration(milliseconds: 16), double renderScale = 1.0, int? targetFrameRate, bool enableAdaptivePerformance = false, Duration adaptiveFrameBudget = const Duration(milliseconds: 16), double adaptiveMinRenderScale = 0.5, Duration adaptiveAdjustmentInterval = const Duration(milliseconds: 500)})
const

Properties

adaptiveAdjustmentInterval Duration
Minimum interval between adaptive scale adjustments.
final
adaptiveFrameBudget Duration
Frame budget used by adaptive performance logic.
final
adaptiveMinRenderScale double
Lower bound used by adaptive performance scaling.
final
animationDuration Duration
final
child Widget?
Child widget to render on top of the shader
final
enableAdaptivePerformance bool
Dynamically adjusts internal render scale based on frame timings.
final
enableGestureControls bool
Enable gesture controls (pan, zoom, mouse tracking)
final
fallbackColor Color
Background color if shader fails to load
final
gestureThrottleDuration Duration
Throttles gesture-driven state commits to reduce repaint pressure.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mouseSensitivity double
final
onGestureUpdate → dynamic Function(double mouseX, double mouseY, double cameraOffsetX, double cameraOffsetY, double viewportScale)?
Callback for when gesture state changes (optional)
final
renderScale double
Internal shader render scale. Values < 1.0 trade detail for performance.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shaderAssetPath String
Path to a compiled Flutter shader asset (.frag).
final
targetFrameRate int?
Optional shader time update cap for animated shaders.
final
uniformBindings ShaderUniformBindings
Shader uniforms that is defined in the shader file. Indexing is explicit and based on shader binding order.
final
uniforms ShaderUniforms
Custom uniforms to pass to the shader
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<RomanticShaderWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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