shadows library

👥 Shadows

Provides 👓 BoxShadowUtils extension on BoxShadow for manipulation of shadows by copyWith.

  • Consider the operator overrides for even simpler syntax.

Provides ⛅ BoxShadowsUtils extension on List<BoxShadow> for mass shadow manipulation.

Provides 🕴 Elevation class with static methods used to simply produce BoxDecorations from Flutter's top-level kElevationToShadow.

Reference

  • 👓 BoxShadowUtils extension on BoxShadow
    • 📋 copyWith Copy With replacement properties
    • * "Multiply" this BoxShadow by a Color
    • * "Multiply" this blurRadius by a num
    • + "Add" to this spreadRadius a double smudgeSpread
    • - "Subtract" from this spreadRadius a double squishSpread
    • 📏 % "Modulate" this offset by Offset offsetScale
  • BoxShadowsUtils extension on List<BoxShadow>
    • 🎨 colorize a List<BoxShadow> with single [Color] or List colors
      • Optionally ❓ preserveOpacity of the originals
    • 📊 rampOpacity of a List<BoxShadow> with single [double] or List stops
      • Optionally 🎨 override a color and ramp simultaneously
  • 🕴 Elevation's static decoration methods
  • ElevationUtils extension on List<BoxShadow>

Classes

BoxDecoration
An immutable description of how to paint a box.
BoxShadow
A shadow cast by a box.
Color
An immutable 32 bit color value in ARGB format.
Elevation
🕴 Elevation double => <BoxShadow>[]
Offset
An immutable 2D floating-point offset.

Extensions

BoxShadowsUtils on List<BoxShadow>
⛅ Box Shadows Utilities
BoxShadowUtils on BoxShadow
👓 Box Shadow Utilities
ElevationUtils on List<BoxShadow>
Provides 🟦 materialize for a tuple of BoxShadows.

Constants

kElevationShadowOpacityRamp → const List<double>
🟦 0.2, 0.14, 0.12 Considering the shadows in kElevationToShadow use these three Colors:
kElevationToShadow → const Map<int, List<BoxShadow>>
Map of elevation offsets used by Material Design to BoxShadow definitions.