TContainer constructor
const
TContainer({
- Key? key,
- Widget? child,
- double? width,
- double? height,
- EdgeInsets? margin,
- EdgeInsets? padding,
- BoxBorder? border,
- Color? borderColor,
- bool showBorder = false,
- double? radius,
- BorderRadius? borderRadius,
- Color? backgroundColor,
- BoxShadow? shadow,
- bool showShadow = false,
- AlignmentGeometry? alignment,
- void onTap()?,
- bool showRipple = true,
- bool circular = false,
Create a rounded container with flexible customization options.
Parameters:
- width: The width of the container.
- height: The height of the container.
- borderRadius: The border radius for rounded corners.
- radius: Optional shorthand for border radius.
- padding: The internal padding of the container.
- margin: The external margin around the container.
- child: The widget to display inside the container.
- backgroundColor: The background color of the container.
- border: Optional custom border for the container.
- borderColor: The color of the border (used if
border
is not provided). - showBorder: Whether to display the border.
- shadow: Optional custom shadow for the container.
- showShadow: Whether to display a default shadow.
- alignment: Align the child widget inside the container.
- onTap: Callback for tap gestures on the container.
- showRipple: Whether to show a ripple effect on tap.
- circle: Whether the container should be circular.
Implementation
const TContainer({
super.key,
this.child,
this.width,
this.height,
this.margin,
this.padding,
this.border,
this.borderColor,
this.showBorder = false,
this.radius,
this.borderRadius,
this.backgroundColor,
this.shadow,
this.showShadow = false,
this.alignment,
this.onTap,
this.showRipple = true,
this.circular = false,
});