$ show UIWidgets/com.unity.uiwidgets
UIWidgets is a Flutter-inspired UI framework for Unity that enables cross-platform app development within the Unity Engine. It consists of a C++ engine layer (modified Flutter engine) for rendering and a C# runtime layer providing widget libraries (Material and Cupertino), gesture handling, animation systems, and platform integration. The primary entry point is the UIWidgetsPanel component attached to a Unity Canvas, which hosts the UIWidgets view. The framework powers applications like Unity Connect App and Unity Chinese Documentation, featuring samples demonstrating widgets, animations, gestures, and platform-specific integrations. While the core framework exhibits strong architectural patterns, the codebase shows technical drift due to version-specific Unity tight coupling, platform fragmentation, and engine fork maintenance burdens.
The LLM identified 2 files worth highlighting for reuse:
Implements the gesture arena pattern to resolve conflicting pointer gestures (e.g., tap vs drag). This is a core part of the gesture system that allows multiple recognizers to compete for a pointer event. The algorithm is non-obvious and well-encapsulated, making it reusable in other C# UI systems.
Defines the Tween class for interpolating values over time with various curves. This is a fundamental building block of the animation system, used implicitly and explicitly throughout the framework. The implementation is clean, decoupled from Unity-specific types, and could be extracted for use in any C# application requiring timed animations.