ControlSectionBuilder class

Utility class for building common control panel sections.

This builder reduces boilerplate by providing reusable widgets for:

  • Sliders (numeric values)
  • Switches (boolean values)
  • Color pickers
  • Section headers
  • State-specific control groups (colors, overrides)

Usage:

final builder = ControlSectionBuilder(
  state: myState,
  onUpdate: () => setState(() {}),
  isDarkMode: isDarkMode,
  context: context,
);

builder.buildSlider('Width', state.width, 100, 400, (v) => state.width = v);

Constructors

ControlSectionBuilder({required BaseComponentState state, required VoidCallback onUpdate, required bool isDarkMode, required BuildContext context})

Properties

context → BuildContext
final
hashCode → int
The hash code for this object.
no setterinherited
isDarkMode → bool
final
onUpdate → VoidCallback
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → BaseComponentState
final
subtitleColor → Color
Get subtitle color based on dark mode
no setter
textColor → Color
Get text color based on dark mode
no setter

Methods

buildAnimatedBorderControls() → List<Widget>
Build animated border controls
buildColorPicker(String label, Color color, ValueChanged<Color> onChanged) → Widget
Build a color picker with preview swatch
buildCommonPropertiesSection({List<Widget>? additionalDimensionControls, List<Widget>? additionalNeumorphicControls, List<Widget>? additionalControls}) → Widget
Build a complete Common Properties section
buildDimensionControls({double minWidth = 100.0, double maxWidth = 400.0, double minHeight = 40.0, double maxHeight = 200.0, double minPadding = 0.0, double maxPaddingH = 80.0, double maxPaddingV = 40.0}) → List<Widget>
Build dimension controls (width, height, paddingH, paddingV)
buildDropdown<T>({required String label, required T value, required List<T> items, required String labelBuilder(T), required ValueChanged<T?> onChanged}) → Widget
Build a dropdown selector
buildNeumorphicControls({double minDistance = 2.0, double maxDistance = 20.0, double minBlur = 5.0, double maxBlur = 30.0, double minRadius = 0.0, double maxRadius = 50.0}) → List<Widget>
Build neumorphic shadow controls (distance, blur, intensities, borderRadius)
buildSection({required String title, String? subtitle, required List<Widget> children, bool initiallyExpanded = false}) → Widget
Build an expansion tile section
buildSlider(String label, double value, double min, double max, ValueChanged<double> onChanged, {String? displayValue, int decimals = 0}) → Widget
Build a labeled slider with value display
buildStandard4StateLayout({List<Widget>? additionalCommonControls, List<Widget>? additionalRestControls, List<Widget>? additionalHoverControls, List<Widget>? additionalPressedControls, List<Widget>? additionalDisabledControls}) → Widget
Build a standard 4-state control panel layout Returns a Column with Common Properties + 4 state sections
buildStandardStateSection(String stateName) → Widget
Build a complete state section for a standard 4-state component using the state's built-in properties
buildStateSection({required String stateName, required bool overrideEnabled, required ValueChanged<bool> onOverrideChanged, required Color baseColor, required Color textColor, required Color iconColor, required ValueChanged<Color> onBaseColorChanged, required ValueChanged<Color> onTextColorChanged, required ValueChanged<Color> onIconColorChanged, double? distanceOverride, double? blurOverride, double? lightIntensityOverride, double? darkIntensityOverride, ValueChanged<double?>? onDistanceOverrideChanged, ValueChanged<double?>? onBlurOverrideChanged, ValueChanged<double?>? onLightIntensityOverrideChanged, ValueChanged<double?>? onDarkIntensityOverrideChanged, List<Widget>? additionalControls}) → Widget
Build controls for a specific state (rest, hover, pressed, disabled)
buildSubsectionHeader(String title) → Widget
Build a subsection header
buildSwitch(String label, bool value, ValueChanged<bool> onChanged) → Widget
Build a labeled switch
buildTextInput(String label, String value, ValueChanged<String> onChanged) → Widget
Build a text input field
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