Package selection guidance compiled from public package information, community data, and project usage.
Floating View is a Flutter plugin that enables picture-in-picture-like functionality, allowing widgets to float over other content—similar to YouTube's collapsing window behavior. It supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. Developers can create draggable, resizable, and interactive floating windows for enhanced user experiences in apps requiring persistent UI elements. The plugin integrates smoothly with existing Flutter projects via a simple command-line installation.
Use cases
Implementing persistent chat widgets
Creating floating controls for media playback
Enabling multitasking with small overlay panels
Building always-visible navigation tools
Designing interactive floating menus
Key features
Draggable and resizable floating windows
Cross-platform support (Android, iOS, Web, macOS, Windows, Linux)
May require platform-specific permissions on some OSes
Performance impact with complex nested widgets
Limited native animation support on some platforms
Potential UI conflicts with full-screen layouts
Requires careful handling of lifecycle events
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
FloatingView Package
The FloatingView package enables you to create a floating window similar to YouTube's floating video feature. This allows the window to float on the screen and be draggable while scrolling.
Note:FloatingView will disappear when changing routes. To display it across routes, wrap your desired route screen with the FloatingView and use the same controller. The controller can be passed down in the widget tree or stored in state management solutions such as BLoC, Provider, etc. The FloatingView will be passed down across the screen using the Hero widget, which is currently the only option available.
Initialize the controller and store the widget you want to display, such as a video, screen, or text. Here is an example of using FloatingView with a Video Player or a simple screen:
Note:controller.initialize() will run the previous onDispose() method to clear the previous controller data if you initialize another FloatingView while having an active one.
Using the APIs:
You can use the passed-down controller to control the FloatingView state like this: