TiltBaseContainer widget

Learn about TiltBaseContainer widget parameters. TiltBaseContainer widget will have default tilt, shadow, and light effects.

TiltBaseContainer widget can only be used in the Tilt widget.

A base container widget that provides tilt and simulated light and shadow effects.
Use normal shadow effects only for child.

Simple usage

...

/// Tilt with TiltBaseContainer for effects.
Tilt(
  child: TiltBaseContainer(
    child: SizedBox(
      width: 150,
      height: 300,
      child: DecoratedBox(
        decoration: const BoxDecoration(color: Colors.grey),
      ),
    ),
  ),
),

/// Tilt with built-in Tilt.base for effects.
/// Tilt.base is a convenient widget that composes Tilt and TiltBaseContainer.
Tilt.base(
  child: SizedBox(
    width: 150,
    height: 300,
    child: DecoratedBox(
      decoration: const BoxDecoration(color: Colors.grey),
    ),
  ),
),

...

TiltBaseContainer widget parameters

ParameterTypeDefaultDescription
child requiredWidget-The main child widget to which tilt and effects are applied.
childLayoutChildLayoutChildLayout()Other child layouts.
e.g. parallax outer, inner, behind.
lightConfigLightConfigLightConfig()Light effect config.
shadowConfigShadowBaseConfigShadowBaseConfig()Shadow effect config.
borderBoxBorder?nullBoxDecoration border.
borderRadiusBorderRadiusGeometry?nullBoxDecoration borderRadius.
clipBehaviorClipClip.antiAliasClip behavior for the container.
filterQualityFilterQuality?nullFilter quality for the transform.

ChildLayout

ParameterTypeDefaultDescription
outerList<Widget><Widget>[]As with Stack, you can use the Stack layout to create widgets that are outer of the child.
e.g. parallax effects.
innerList<Widget><Widget>[]As with Stack, you can use the Stack layout to create widgets that are inner of the child.
e.g. parallax effects.
behindList<Widget><Widget>[]As with Stack, you can use the Stack layout to create widgets that are behind of the child.
e.g. parallax effects.

LightConfig

ParameterTypeDefaultDescription
disableboolfalseOnly disable the light effect.
colorColorColor(0xFFFFFFFF)Light color.
minIntensitydouble0.0Color minimum opacity, also initial opacity.
maxIntensitydouble0.5Color maximum opacity for tilt progresses.
spreadFactordouble4.0Light spread factor, relative to current widget size.
directionLightDirectionLightDirection.aroundLight direction.
Affects:
[ShadowBaseConfig.direction] (not affected after configuration).
enableReverseboolfalseReverse light direction.
Affects:
[ShadowBaseConfig.direction] (not affected after configuration).
[ShadowBaseConfig.enableReverse] (not affected after configuration).

ShadowBaseConfig

ParameterTypeDefaultDescription
disableboolfalseOnly disable the shadow effect.
colorColorColor(0xFF9E9E9E)Shadow color.
minIntensitydouble0.0Color minimum opacity, also initial opacity.
maxIntensitydouble0.5Color maximum opacity as tilt progresses.
offsetInitialOffsetOffset(0.0, 0.0)Initial value of shadow offset.
e.g. (0.0, 0.0) center.
(40.0, 40.0) Offset 40 to the top left.
offsetFactordouble0.1Shadow offset factor, relative to current widget size.
directionShadowDirection?nullShadow direction.
enableReversebool?nullReverse shadow direction.
spreadInitialdouble0.0Initial value of shadow spread radius.
spreadFactordouble0.0Shadow spread radius factor, relative to current widget size.
minBlurRadiusdouble10.0Minimum blur radius, also initial blur radius.
maxBlurRadiusdouble20.0Maximum blur radius for tilt progresses.