Back to Projects
Flutter PackagesActive

Flutter FolderView

A customizable Flutter widget for displaying hierarchical data in tree and folder views

dartflutter

Pub Version License

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 isExpanded state was removed from Node, replaced by externally injected expandedNodeIds for flexible state management.
  • Performance optimizations: Uses ValueNotifier to prevent unnecessary widget tree rebuilds, and FlattenService reuses a single mutable list instead of recursive list spreading. ListView.builder with itemExtent ensures performant rendering of large node sets.
  • just_tooltip integration: Replaced Flutter's built-in Tooltip with just_tooltip for 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 to node.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.

Comments