foil library

Wrap a widget with Foil, providing a rainbow shimmer that twinkles as the accelerometer moves as well as tons of additional neat gradient features.

pub.dev Listing | API Doc | GitHub

API References: Foil | Foils | Roll | Crinkle | Foil.sheet | Steps | GradientUtils

Extra Goodies

  1. Three new variety of Gradient that do not gradate, but hard-transition:

    • LinearSteps
    • RadialSteps
    • SweepSteps 😏
  2. Foils abstract class with a variety of static const Gradients

  3. GradientUtils extensions for each Gradient

    • Gradient copyWith() methods
  4. GradientTween specializing Tween<Gradient> to use Gradient.lerp().

Classes

Crinkle
Provide animation to a piece of Foil by wrapping it in a Roll with a specified Crinkle.
Foil
accelerometer-animated Foil Wrap a widget with new Foil, providing a rainbow shimmer that twinkles as the accelerometer moves.
Foils
Pre-rolled Gradients for deployment as Foil.gradient or anywhere else a Gradient is called for.
GradientTween
An interpolation between two Gradients.
LinearSteps
A 2D linear stepped "gradient".
RadialSteps
A 2D radial stepping "gradient".
Roll
Provide a Roll for Foil.
RollState
Provide a Roll of Foil such that any descendents may obtain their Foil.gradient value from this definition.
Scalar
A Scalar provides an opportunity to scale axis-based double data. Default constructor takes named paramters per axis. Use Scalar.xy as a shortcut to only provide positional double values.
Sheet
A wrapper for the parameters that pertain to an Animated/Container.
SweepSteps
A 2D stepping sweep "gradient".
TranslateGradient
This class's transform method considers TextDirection and will consider positive values as translation to the right if ltr and translate left for positive values if rtl.

Extensions

GradientUtils on Gradient
Offers copyWith method to make duplicate Gradients.
LinearGradientUtils on LinearGradient
Offers copyWith method to make duplicate Gradients.
RadialGradientUtils on RadialGradient
Offers copyWith method to make duplicate Gradients.
SweepGradientUtils on SweepGradient
Offers copyWith method to make duplicate Gradients.

Typedefs

TransformGradient = GradientTransform Function(double x, double y)
The definition of a Function that positionally accepts a
double x then double y and returns a GradientTransform,
such as the default for this package: TranslateGradient.