ModernStyleOptions class

Style configuration for modern MediaSFU components.

This class provides a unified way to customize the appearance of modern UI components. It supports custom decorations, colors, shadows, animations, and builder hooks for maximum flexibility.

Example usage:

ModernStyleOptions(
  containerDecoration: BoxDecoration(
    gradient: MediasfuColors.metallicGradient(),
    borderRadius: BorderRadius.circular(16),
  ),
  glowEnabled: true,
  glowIntensity: 0.5,
  animationDuration: MediasfuAnimations.fast,
)

Constructors

ModernStyleOptions.new({BoxDecoration? containerDecoration, BoxDecoration? hoverDecoration, BoxDecoration? activeDecoration, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, bool glowEnabled = false, double glowIntensity = 0.3, Color? glowColor, bool neumorphicEnabled = false, int neumorphicDepth = 1, bool pulseBorderEnabled = false, Color? pulseBorderColor, bool showSkeleton = false, BorderRadius? borderRadius, Border? border, Color? backgroundColor, Gradient? backgroundGradient, List<BoxShadow>? shadows, Duration? animationDuration, Curve? animationCurve, bool animationsEnabled = true, double disabledOpacity = 0.5, Matrix4? transform, Clip clipBehavior = Clip.none, Widget overlayBuilder(BuildContext context, Widget child)?, Widget foregroundBuilder(BuildContext context)?, Widget backgroundBuilder(BuildContext context)?, BoxConstraints? constraints, double? minHeight, double? minWidth, double? maxHeight, double? maxWidth, double? height, double? width, AlignmentGeometry? alignment, bool adaptiveStyling = true, Brightness? brightnessOverride, ColorFilter? colorFilter, double? blurAmount, bool backdropBlurEnabled = false, BlendMode? blendMode})
const

Properties

activeDecoration → BoxDecoration?
Custom decoration for pressed/active states.
final
adaptiveStyling → bool
Whether to use adaptive styling based on platform.
final
alignment → AlignmentGeometry?
Alignment of child within the container.
final
animationCurve → Curve?
Animation curve for state transitions.
final
animationDuration → Duration?
Animation duration for state transitions.
final
animationsEnabled → bool
Enable/disable animations.
final
backdropBlurEnabled → bool
Enable backdrop filter blur.
final
backgroundBuilder → Widget Function(BuildContext context)?
Builder for custom background effects.
final
backgroundColor → Color?
Custom background color.
final
backgroundGradient → Gradient?
Custom gradient background.
final
blendMode → BlendMode?
Custom blend mode for decorations.
final
blurAmount → double?
Blur effect for glassmorphism.
final
border → Border?
Custom border.
final
borderRadius → BorderRadius?
Custom border radius.
final
brightnessOverride → Brightness?
Theme brightness override (light/dark).
final
clipBehavior → Clip
Custom clip behavior.
final
colorFilter → ColorFilter?
Custom color filter to apply.
final
constraints → BoxConstraints?
Custom constraints for the container.
final
containerDecoration → BoxDecoration?
Custom decoration for the container. If provided, this overrides the default decoration.
final
disabledOpacity → double
Opacity for disabled state.
final
effectiveConstraints → BoxConstraints?
Gets effective constraints based on min/max/fixed dimensions.
no setter
foregroundBuilder → Widget Function(BuildContext context)?
Builder for custom foreground effects.
final
glowColor → Color?
Custom color for the glow effect.
final
glowEnabled → bool
Enable glow effect around the container.
final
glowIntensity → double
Intensity of the glow effect (0.0 to 1.0).
final
hashCode → int
The hash code for this object.
no setterinherited
height → double?
Fixed height for the container.
final
hoverDecoration → BoxDecoration?
Custom decoration for hover/focus states.
final
margin → EdgeInsetsGeometry?
Custom margin for the container.
final
maxHeight → double?
Maximum height for the container.
final
maxWidth → double?
Maximum width for the container.
final
minHeight → double?
Minimum height for the container.
final
minWidth → double?
Minimum width for the container.
final
neumorphicDepth → int
Depth of neumorphic effect (1, 2, or 3).
final
neumorphicEnabled → bool
Enable neumorphic (soft 3D) effect.
final
overlayBuilder → Widget Function(BuildContext context, Widget child)?
Builder for overlaying custom content.
final
padding → EdgeInsetsGeometry?
Custom padding for the container.
final
pulseBorderColor → Color?
Color of the pulse border.
final
pulseBorderEnabled → bool
Enable pulse border animation.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shadows → List<BoxShadow>?
Custom box shadows.
final
showSkeleton → bool
Enable skeleton loading state.
final
transform → Matrix4?
Custom transform for container.
final
width → double?
Fixed width for the container.
final

Methods

copyWith({BoxDecoration? containerDecoration, BoxDecoration? hoverDecoration, BoxDecoration? activeDecoration, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, bool? glowEnabled, double? glowIntensity, Color? glowColor, bool? neumorphicEnabled, int? neumorphicDepth, bool? pulseBorderEnabled, Color? pulseBorderColor, bool? showSkeleton, BorderRadius? borderRadius, Border? border, Color? backgroundColor, Gradient? backgroundGradient, List<BoxShadow>? shadows, Duration? animationDuration, Curve? animationCurve, bool? animationsEnabled, double? disabledOpacity, Matrix4? transform, Clip? clipBehavior, Widget overlayBuilder(BuildContext context, Widget child)?, Widget foregroundBuilder(BuildContext context)?, Widget backgroundBuilder(BuildContext context)?, BoxConstraints? constraints, double? minHeight, double? minWidth, double? maxHeight, double? maxWidth, double? height, double? width, AlignmentGeometry? alignment, bool? adaptiveStyling, Brightness? brightnessOverride, ColorFilter? colorFilter, double? blurAmount, bool? backdropBlurEnabled, BlendMode? blendMode}) → ModernStyleOptions
Creates a copy with updated values.
merge(ModernStyleOptions? other) → ModernStyleOptions
Merges this with another ModernStyleOptions. Values from other take precedence when not null.
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 Methods

glass({double blur = 10, Color? backgroundColor, BorderRadius? borderRadius}) → ModernStyleOptions
Creates a glassmorphic style preset.
glow({Color? color, double intensity = 0.4, BorderRadius? borderRadius}) → ModernStyleOptions
Creates a glow-focused style preset.
gradient({required Gradient gradient, BorderRadius? borderRadius, List<BoxShadow>? shadows}) → ModernStyleOptions
Creates a gradient background style preset.
minimal({Color? backgroundColor, BorderRadius? borderRadius}) → ModernStyleOptions
Creates a minimal/subtle style preset.
neumorphic({int depth = 2, BorderRadius? borderRadius}) → ModernStyleOptions
Creates a neumorphic style preset.
premium({Color? backgroundColor, Color? glowColor, BorderRadius? borderRadius}) → ModernStyleOptions
Creates a premium/elevated style preset.
pulsing({Color? color, BorderRadius? borderRadius}) → ModernStyleOptions
Creates a pulsing border style preset.

Constants

none → const ModernStyleOptions
Returns default empty style options.