Full-Screen Gradient Playground
Featuring an independently scrollable configuration panel, pinned live preview, smart WCAG color contrast analyzer, 36+ curated presets, and instant Flutter Dart code export.
Curated Gradient Presets
Filter by aesthetic mood, Flutter UI role (AppBars, CTAs, Cards), or gradient geometry for fast app styling.
Deep Purple Glow
Hyper Sunset
Emerald Water
Cosmic Nebula
Aurora Sweep
Malibu Sunset
Golden Hour
Twilight Horizon
Dusk Ember
Ocean Blue
Deep Sea Trench
Pacific Mist
Coastal Lagoon
Violet Mirage
Mystic Plum
Royal Lavender
Flutter Blue
Cerulean Tide
Frost Azure
Berry Smoothie
Flamingo Rush
Neon Rose
Lush Bamboo
Mint Condition
Deep Forest
Citrus Zest
Solar Flare
Warm Flame
Obsidian Night
Carbon Glow
Midnight Velvet
Cotton Candy
Peach Sorbet
Soft Dream
Cyberpunk Drive
Electric Volt
Laser Matrix
Material Indigo Teal
Material Flame
Material Cyan Sky
Aurora Borealis
Cosmic Orbit Glow
Nebula Galaxy Sweep
Matcha Botanical
Forest Canopy Header
Bamboo Dew CTA
Deep Sage Surface
Solar Flare CTA
Phoenix Ember Action
Magma Glow Spotlight
Titanium Slate Nav
Liquid Silver Card
Obsidian Carbon OLED
Cupertino Indigo AppBar
Modern Teal AppBar
Electric Violet Button
Emerald Success Pill
Frost Glass Surface
Ambient Orb Spotlight
Fitness Activity Conic
Ready-to-Use Flutter UI Patterns
Real-world Flutter widgets utilizing Linear, Radial, and Sweep gradients with copy-pasteable Dart code.
Gradient Container
Standard Flutter Container decorated with a smooth LinearGradient and rounded border radius.
Gradient Elevated Button
Modern pill button using Ink or Container inside ElevatedButton for ripple ink splashes.
Gradient Card
Rich card surface suitable for dashboard summaries, headers, and media items.
Gradient Text (ShaderMask)
Paints vibrant text in Flutter using ShaderMask and BlendMode.srcIn with createShader.
Circular Gradient Avatar
Radial or Sweep gradient circular indicator for user profile pictures and badges.
Background Gradient Scaffold
Full-screen app background gradient applied cleanly to the Scaffold body.
Flutter Gradients Documentation
A comprehensive reference for Flutter’s painting library: understanding LinearGradient, RadialGradient, and SweepGradient.
1What is a Flutter Gradient?
In Flutter, the abstract Gradient class is part of the dart:ui and flutter/painting.dart library. Gradients represent a 2D shader that smoothly transitions between two or more colors across a geometry.
Gradients are most frequently supplied to a BoxDecoration via the gradient parameter, which is then rendered by a Container, DecoratedBox, or converted into an Skia/Impeller shader via createShader(rect) for use with custom painters or ShaderMask.
2LinearGradient
A LinearGradient transitions colors smoothly along a straight vector defined from a begin alignment to an end alignment.
LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF6A11CB),
Color(0xFF2575FC),
],
stops: [0.0, 1.0], // Optional: distribution of color stops
tileMode: TileMode.clamp, // clamp, repeated, mirror, decal
transform: GradientRotation(0.785), // Optional rotation
)Specifies start and termination points using Alignment(-1.0, -1.0) (top-left) to Alignment(1.0, 1.0) (bottom-right).
colors takes a list of at least 2 Color instances. stops specifies fractions from 0.0 to 1.0.
Defines what happens when the gradient is tiled: TileMode.clamp, TileMode.repeated, TileMode.mirror, or TileMode.decal.
Pass a GradientTransform like GradientRotation(radians) to rotate without adjusting begin/end points manually.
3RadialGradient
A RadialGradient paints color transitions emanating outwards in concentric circles from a center point up to a given radius.
RadialGradient(
center: Alignment.center,
radius: 0.8,
focal: Alignment(-0.2, -0.2), // Optional focal light point
focalRadius: 0.1,
colors: [
Color(0xFFFF007F),
Color(0xFF7928CA),
],
tileMode: TileMode.clamp,
)The radius of the gradient as a fraction of the shortest side of the painting bounding box.
Allows offsetting the visual "bright spot" or light source inside the radial circle, simulating realistic spherical shading.
4SweepGradient
A SweepGradient (analogous to conic gradients in web design) sweeps color transitions clockwise in an angular arc around a center point.
import 'dart:math' as math;
SweepGradient(
center: Alignment.center,
startAngle: 0.0,
endAngle: math.pi * 2,
colors: [
Color(0xFF00F5D4),
Color(0xFF7B2CBF),
Color(0xFFF15BB5),
Color(0xFF00F5D4), // Wrap back to first color for seamless seam
],
)Pro-Tip: To avoid a sharp, visible line where a SweepGradient completes its 360-degree circle (math.pi * 2), set the final color in your colors array to match the initial color stop.
Flutter Performance Best Practices
- Use
const LinearGradient(...)whenever colors and alignments are static to allow Flutter to avoid re-allocating memory during widget rebuilds. - When using
ShaderMaskfor animated or scrolling lists, wrap it in aRepaintBoundaryto prevent redundant GPU shader recompilations on every tick. - For complex gradient headers that never change, prefer caching into a static constant or rendering on a cached canvas layer.
Common Questions About Flutter Gradients
Everything you need to know about implementing gradients in your Flutter apps.