Learn/Advanced UI/Glassmorphism & Neumorphism

Glassmorphism & Neumorphism

Create stunning frosted glass and soft shadow UI effects

6 min~4 min read+45 FX

You can read this lesson publicly. Sign in to unlock exercises, quiz, and FX progress tracking.

Table of Contents

  1. 1. Visual Effects Trade-off Model
  2. 2. This Lesson In Simple Words
  3. 3. Your level focus
  4. 4. One practical habit
  5. 5. Deep Understanding Guide
  6. 6. Why this lesson matters
  7. 7. Study flow for better retention
  8. 8. Architecture Lens

Having trouble? AI is here to help

Ask context-aware questions about this lesson. Free plan: 5 questions/day. Upgrade to Premium for higher daily limits.

Use the AI button at the bottom of the screen

Glassmorphism & Neumorphism

Glassmorphism creates frosted glass effects using blur and transparency to simulate a sheet of frosted glass layered over your content. Neumorphism uses soft, opposing shadows to create subtle raised or depressed surfaces that mimic physical objects. Both design trends add visual depth and a modern aesthetic to your Flutter applications.

dart
1// ── GLASSMORPHISM ──
2import 'dart:ui';
3
4class GlassCard extends StatelessWidget {
5 final Widget child;
6 const GlassCard({super.key, required this.child});
7
8 @override
9 Widget build(BuildContext context) {
10 return ClipRRect(
11 borderRadius: BorderRadius.circular(20),
12 child: BackdropFilter(
13 filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
14 child: Container(
15 decoration: BoxDecoration(
16 color: Colors.white.withOpacity(0.2),
17 borderRadius: BorderRadius.circular(20),
18 border: Border.all(color: Colors.white.withOpacity(0.3)),
19 ),
20 padding: const EdgeInsets.all(20),
21 child: child,
22 ),
23 ),
24 );
25 }
26}
27
28// ── NEUMORPHISM ──
29class NeuCard extends StatelessWidget {
30 final Widget child;
31 const NeuCard({super.key, required this.child});
32
33 @override
34 Widget build(BuildContext context) {
35 return Container(
36 decoration: BoxDecoration(
37 color: const Color(0xFFE0E5EC),
38 borderRadius: BorderRadius.circular(20),
39 boxShadow: [
40 // Light shadow (top-left)
41 const BoxShadow(
42 color: Colors.white,
43 offset: Offset(-6, -6),
44 blurRadius: 15,
45 ),
46 // Dark shadow (bottom-right)
47 BoxShadow(
48 color: Colors.grey.shade400,
49 offset: const Offset(6, 6),
50 blurRadius: 15,
51 ),
52 ],
53 ),
54 padding: const EdgeInsets.all(20),
55 child: child,
56 );
57 }
58}
59
60// Pressed (concave) Neumorphism:
61Container(
62 decoration: BoxDecoration(
63 color: const Color(0xFFE0E5EC),
64 borderRadius: BorderRadius.circular(20),
65 boxShadow: [
66 BoxShadow(color: Colors.grey.shade400, offset: const Offset(-3, -3), blurRadius: 8),
67 const BoxShadow(color: Colors.white, offset: Offset(3, 3), blurRadius: 8),
68 ],
69 ),
70)

Performance Note

💡 Performance Note

BackdropFilter for glassmorphism can be expensive. Use RepaintBoundary around it and avoid using it on rapidly animating content. Neumorphism is lighter on performance.

Visual Effects Trade-off Model

Advanced visual styles should pass a usability and performance gate:

  • Confirm readability first, then aesthetics.
  • Use glass effects sparingly on focal surfaces only.
  • Keep contrast and touch affordance strong under decorative layers.
  • Test effect cost on mid-range devices before broad rollout.

Beautiful interfaces must remain clear and responsive under real usage conditions.

Effect Quality Checklist

  • Foreground text contrast remains accessible over blurred backgrounds.
  • Blur and shadow intensities are consistent with design system tokens.
  • Animations involving blur do not create frame drops.
  • Effect fallback exists for lower-powered devices when needed.
  • Interactive elements remain obvious and easy to tap.

This Lesson In Simple Words

Create stunning frosted glass and soft shadow UI effects. Animation gives feedback and personality to UI when it supports user intent clearly.

Your level focus

Operate with production and interview-level clarity.

One practical habit

Animate only what helps understanding, and keep transition timing consistent.

Deep Understanding Guide

Why this lesson matters

Good motion guides attention; bad motion distracts and can hurt performance.

Study flow for better retention

  1. Tie each concept to scale, failure handling, and delivery strategy.
  2. Prefer simple implicit animations first, then move to explicit control for complex flows.
  3. If you can defend trade-offs under constraints, your understanding is strong.

Common Mistakes To Avoid

  • Adding animation everywhere without UX purpose.
  • Rebuilding large widget trees for tiny animated changes.
  • Using inconsistent durations that make flows feel random.
  • Ignoring accessibility needs for users sensitive to motion.

Practice Sprint (15-25 Minutes)

  • Before running sample code, predict output and behavior in one sentence.
  • Create one implicit and one explicit animation for the same component.
  • Use Hero transition between two screens with meaningful shared element.
  • Profile animation frame times and remove one avoidable rebuild hotspot.
  • Complete the required exercises without using hints on the first attempt.
  • Answer this question out loud before checking quiz options: "Which widget creates the blur effect for glassmorphism?".

Code Comprehension Drill

  • State the purpose of the code block in one line before reading details.
  • Mark inputs, state changes, and final output.
  • Change one small value and predict what should happen before running.
  • Run again and compare your prediction with actual behavior.

Architecture Lens

Animation architecture should separate timing logic from reusable visual components.

As your app grows, keep UI, state, and data responsibilities separate so each part stays testable and easier to modify.

Lesson Completion Checklist

  • I can explain "Glassmorphism & Neumorphism" in simple words without reading notes.
  • I can describe one real app situation where this concept is required.
  • I know at least one mistake to avoid: Adding animation everywhere without UX purpose.
  • I can modify one code sample and correctly predict the behavior change.
  • I can finish required exercises with understanding, not trial-and-error guesses.

Frequently Asked Questions

Which widget creates the blur effect for glassmorphism?

BackdropFilter applies a filter (like blur) to everything behind the widget, creating the frosted glass effect.

How does neumorphism create its 3D effect?

Neumorphism uses a light shadow on one side and dark shadow on the other, simulating soft light on a surface.

Why must BackdropFilter be wrapped in ClipRRect?

Without clipping, BackdropFilter blurs everything behind it. ClipRRect constrains the effect to the widget's shape.

Suggest Improvement

Something seems incorrect, unclear, or missing? Let us know.

About The Author

FlutterCraft editorial lessons are reviewed by experienced Flutter developers and updated to stay aligned with modern Flutter and Dart best practices.

Reference docs: Flutter Documentation, Dart Language Tour, and official package documentation where relevant.

Sign in to continue with exercises and quiz for this lesson.

Sign In to Continue