shadows 0.9.0 copy "shadows: ^0.9.0" to clipboard
shadows: ^0.9.0 copied to clipboard

Flutter extensions on `BoxShadow`s and `List`s of them, as well helper methods for converting a `double` => Material "elevation" shadows.

👥 Shadows #

WORK IN PROGRESS

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 [BoxDecoration]s 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
    • [Elevation.asBoxShadows](double elevation, {Color? color})
    • [Elevation.asBoxDecoration](double elevation, {Color? color})
  • 🟦 [ElevationUtils] extension on List<BoxShadow>
    • 🟦 [materialize] will apply the Material-standard shadow opacity map [kElevationShadowOpacityRamp] to a List<BoxShadow>

🧫 Examples #

🕴 Elevation #

🟦 ElevationUtils #

👓 BoxShadowUtils #

BoxShadowsUtils #

🌇 Roadmap #

  1. Provide examples.
  2. Develop more utilities, like generating List<BoxShadow> from BoxShadow or applying some algorithm to the blurRadiuses in a List<BoxShadow>, etc.

🐞 Bugs #

  1. None known.
4
likes
120
pub points
59%
popularity

Publisher

verified publisherzaba.app

Flutter extensions on `BoxShadow`s and `List`s of them, as well helper methods for converting a `double` => Material "elevation" shadows.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on shadows