Flutter Mar 2, 2020

Floating Overlay Widgets Over Transformed UI Elements in Flutter

Article Summary

Jose Alba from Google's Material team tackles a tricky Flutter challenge: how do you overlay a widget that follows another widget—even when it's rotated or transformed—without restructuring your entire codebase?

This official Flutter blog post walks through a common UI problem where developers need floating elements (like autocomplete suggestions) to track transformed widgets. Instead of invasive Stack refactoring, Alba demonstrates Flutter's built-in solution using CompositedTransformTarget and CompositedTransformFollower.

Key Takeaways

Critical Insight

Flutter's Overlay system with LayerLink lets you add floating UI elements that track transformed widgets without touching existing code structure.

The article includes interactive DartPad examples showing the technique in action with rotating containers—try breaking it yourself to understand the edge cases.

Recent from Flutter

Related Articles