StyledContainer class
A versatile styled container that integrates all premium visual effects.
StyledContainer provides a unified API for applying:
- Neumorphism effects
- Glow effects
- Glassmorphism (backdrop blur)
- Pulse borders
- Gradient backgrounds
- Animated state transitions
It can be configured via ModernStyleOptions or individual properties.
Example usage:
StyledContainer(
styleOptions: ModernStyleOptions.premium(),
child: Text('Premium Card'),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- StyledContainer
Constructors
-
StyledContainer({Key? key, required Widget child, ModernStyleOptions? styleOptions, BoxDecoration? decoration, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, double? width, double? height, BoxConstraints? constraints, BorderRadius? borderRadius, bool enableGlow = false, double glowIntensity = 0.3, Color? glowColor, bool enableNeumorphism = false, int neumorphicDepth = 1, bool enableGlassmorphism = false, double blurAmount = 10.0, bool enablePulseBorder = false, Color? pulseBorderColor, Color? backgroundColor, Gradient? gradient, List<
BoxShadow> ? shadows, Duration animationDuration = const Duration(milliseconds: 200), Curve animationCurve = Curves.easeOutCubic, bool animationsEnabled = true, VoidCallback? onTap, VoidCallback? onLongPress, bool isPressed = false, bool isHovered = false, bool isDarkMode = true, double pressedScale = 0.97, double hoveredScale = 1.02, AlignmentGeometry? alignment, Clip clipBehavior = Clip.antiAlias}) -
const
Properties
- alignment → AlignmentGeometry?
-
Alignment of the child.
final
- animationCurve → Curve
-
Animation curve for state transitions.
final
- animationDuration → Duration
-
Animation duration for state transitions.
final
- animationsEnabled → bool
-
Whether animations are enabled.
final
- backgroundColor → Color?
-
Background color.
final
- blurAmount → double
-
Blur amount for glassmorphism.
final
- borderRadius → BorderRadius?
-
Border radius.
final
- child → Widget
-
The child widget to display inside the container.
final
- clipBehavior → Clip
-
Clip behavior.
final
- constraints → BoxConstraints?
-
Box constraints.
final
- decoration → BoxDecoration?
-
Custom decoration for the container.
final
- enableGlassmorphism → bool
-
Enable glassmorphism (backdrop blur).
final
- enableGlow → bool
-
Enable glow effect.
final
- enableNeumorphism → bool
-
Enable neumorphism.
final
- enablePulseBorder → bool
-
Enable pulsing border.
final
- glowColor → Color?
-
Custom glow color.
final
- glowIntensity → double
-
Glow intensity (0.0 to 1.0).
final
- gradient → Gradient?
-
Background gradient.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
Fixed height.
final
- hoveredScale → double
-
Scale factor when hovered.
final
- isDarkMode → bool
-
Whether to use dark mode styling.
final
- isHovered → bool
-
Whether the container is in hover state (for desktop).
final
- isPressed → bool
-
Whether the container is in pressed state.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → EdgeInsetsGeometry?
-
Margin outside the container.
final
- neumorphicDepth → int
-
Neumorphic depth level (1, 2, or 3).
final
- onLongPress → VoidCallback?
-
Callback when container is long pressed.
final
- onTap → VoidCallback?
-
Callback when container is tapped.
final
- padding → EdgeInsetsGeometry?
-
Padding inside the container.
final
- pressedScale → double
-
Scale factor when pressed.
final
- pulseBorderColor → Color?
-
Pulse border color.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shadows
→ List<
BoxShadow> ? -
Custom shadows.
final
- styleOptions → ModernStyleOptions?
-
Style configuration. Takes precedence over individual properties.
final
- width → double?
-
Fixed width.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StyledContainer> -
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