Motion.elevated constructor
Motion.elevated({
- Key? key,
- required int elevation,
- required Widget child,
- MotionController? controller,
- BorderRadius? borderRadius,
- bool glare = true,
- bool shadow = true,
- bool translation = true,
- FilterQuality? filterQuality = defaultFilterQuality,
Creates a Motion widget by setting configurations according to the elevation of the widget.
This will influence the shadow's movement and offset, if greater than 0.
Higher elevation
values allows to :
- Blur and lower the shadow from behind your widget, as if it was floating higher
- Increase the distance by which the widget will be translated on the X and Y axises
elevation
may range from 0 to 100, allowing you to easily stay consistent accross your design.
Implementation
factory Motion.elevated({
Key? key,
required int elevation,
required Widget child,
MotionController? controller,
BorderRadius? borderRadius,
bool glare = true,
bool shadow = true,
bool translation = true,
FilterQuality? filterQuality = defaultFilterQuality,
}) =>
Motion(
key: key,
child: child,
controller: controller,
glare: glare ? GlareConfiguration.fromElevation(elevation) : null,
shadow: shadow ? ShadowConfiguration.fromElevation(elevation) : null,
translation: translation
? TranslationConfiguration.fromElevation(elevation)
: null,
borderRadius: borderRadius,
filterQuality: filterQuality,
);