Flutter FolderView
A customizable Flutter widget for displaying hierarchical data in tree and folder views
Overview
Flutter FolderView is a Flutter widget that visualizes hierarchical data in both tree and folder formats. It can represent folder-to-subfolder-to-file structures just like a file explorer, supporting three node types (folder, parent, child) and two view modes (folder, tree).
Key Features
- Dual view modes: Switch between hierarchical folder structure (
ViewMode.folder) and flattened tree structure (ViewMode.tree) - Multiple line styles: Connector (
├─ └─), scope (vertical lines), or none - Rich theming system: Per-node-type customization of icons, text styles, hover/click colors, and widgets
- Per-node tooltips: 4-directional tooltips powered by
just_tooltip— with arrows, animations, and programmatic control - Dynamic styling: Resolver functions determine icons, text styles, and labels at runtime based on node data
- Large dataset optimization: Smooth scrolling with 20,000+ nodes via incremental expand/collapse, text width caching, and lazy measurement
- Synchronized scrolling: Horizontal and vertical scrollbar synchronization with custom scrollbar theming
Supported Platforms
Android, iOS, Web, macOS, Windows, Linux
Technical Highlights
- Immutable node model: Since v0.5.0, the
isExpandedstate was removed fromNode, replaced by externally injectedexpandedNodeIdsfor flexible state management. - Performance optimizations: Uses
ValueNotifierto prevent unnecessary widget tree rebuilds, andFlattenServicereuses a single mutable list instead of recursive list spreading.ListView.builderwithitemExtentensures performant rendering of large node sets. - just_tooltip integration: Replaced Flutter's built-in Tooltip with
just_tooltipfor 4-directional placement, alignment, arrows, and diverse animations (fade, scale, slide, rotation, etc.). - Generic type support: All theme classes support
<T>generics for type-safe access tonode.data.
Why It Stands Out
While several tree/folder view widgets exist in the Flutter ecosystem, flutter_folderview differentiates itself by supporting both folder and tree modes simultaneously while offering fine-grained per-node-type theme customization. Its practical optimizations — incremental expand/collapse, text width caching — maintain smooth performance even with 20,000+ nodes, making it viable for production use. The rich tooltip options and resolver-based dynamic styling extend its applicability beyond simple file explorer UIs to diverse hierarchical data visualization scenarios.