· Flutter Deep Dives · 4 min read

flutter_animate BlurEffect - Reveal Flutter Content Without a Hard Cut

Learn how to use flutter_animate BlurEffect for privacy reveals, async previews, and focus states without changing Flutter layout.

Flutter blur animation revealing a content card

flutter_animate’s BlurEffect is useful when content should become readable gradually, not simply appear after a rebuild. A blurred image preview, privacy-protected account number, or loading placeholder can sharpen into place while its layout box stays exactly where Flutter measured it.

Why blur is different from fade

I initially used opacity for a private profile preview. It prevented the hard cut, but it also made the content look like it was missing. A blur communicates “the content exists, but it is not ready to read yet.” That distinction matters for image previews and permission-gated screens.

The effect changes the rendered layer, not the widget’s layout constraints. The parent still measures the same card before, during, and after the animation.

RequirementBetter choiceWhy
Hide content completelyFadeEffect or VisibilityEffectBlur still reveals shapes and colors
Show a preview becoming readableBlurEffectPreserves context while reducing detail
Keep a fixed card from jumpingBlurEffect + stable sizeThe filter does not remeasure the child
Protect genuinely sensitive dataRedaction or replacement widgetBlur is not a security boundary

A blurred image reveal

The important part is starting with a noticeable blur and ending at zero. A small end value can make the transition too subtle, while a very large value increases the cost of the filtered layer.

import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';

class PreviewCard extends StatefulWidget {
  const PreviewCard({super.key});

  @override
  State<PreviewCard> createState() => _PreviewCardState();
}

class _PreviewCardState extends State<PreviewCard> {
  bool _isReady = false;

  Future<void> _loadPreview() async {
    await Future<void>.delayed(const Duration(milliseconds: 700));
    if (!mounted) return;
    setState(() => _isReady = true);
  }

  @override
  void initState() {
    super.initState();
    _loadPreview();
  }

  @override
  Widget build(BuildContext context) {
    return Card(
      clipBehavior: Clip.antiAlias,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: [
          Image.network(
            'https://images.unsplash.com/photo-1519681393784-d120267933ba?w=900',
            height: 180,
            fit: BoxFit.cover,
          ),
          Padding(
            padding: const EdgeInsets.all(16),
            child: Text(
              _isReady ? 'Preview ready' : 'Preparing preview…',
              style: Theme.of(context).textTheme.titleMedium,
            ),
          ),
        ],
      ),
    )
        .animate(target: _isReady ? 1.0 : 0.0)
        .blur(
          begin: 12.0,
          end: 0.0,
          duration: 450.ms,
          curve: Curves.easeOutCubic,
        );
  }
}

The target value makes the animation state-driven. When _isReady changes from false to true, the same effect chain moves from its initial value to its final value. There is no separate AnimationController to reset, and a rebuild caused by unrelated state does not replay the reveal.

The traps that show up in real screens

First, do not confuse a blur with redaction. A blurred email address may still be inferred from its length, and a blurred image can still expose recognizable details. Use a solid placeholder or replace the sensitive child when the content must not be recoverable.

Second, avoid placing a large, continuously blurred list inside a scrolling viewport. ImageFilter.blur requires compositing work for every visible filtered layer. On a low-end Android device, ten large cards with a permanent blur can cost more than one short reveal.

SituationSafer implementation
One hero image reveals onceAnimate blur for 300–600 ms
Many list thumbnails load togetherBlur only the active item, or use a low-detail placeholder
User toggles privacy modeKeep a redacted replacement mounted instead of animating blur
Text becomes readable after loadingBlur the visual preview, but update semantics deliberately

For accessibility, remember that visual blur does not remove text from the semantics tree. If a screen reader should not announce the hidden value yet, render a separate semantic label or use ExcludeSemantics while the protected state is active. Also test the animation with reduced-motion settings; a static redacted state is often clearer than a slow blur for users who request less motion.

BlurEffect works best as a short transition between two meaningful states: unavailable and readable, placeholder and image, or unfocused and focused. Keep the radius moderate, keep the child mounted, and treat privacy as a data-rendering decision rather than an animation problem.

Key takeaways

  • BlurEffect changes visual detail without changing layout size.
  • Use target when the blur follows async or state changes.
  • Large permanent blur layers can hurt scrolling performance.
  • Blur is a visual treatment, not secure data masking.
  • Check semantics and reduced-motion behavior before shipping.
Share:
Back to Blog