Flutter FolderView
A customizable Flutter widget for displaying hierarchical data in tree and folder views.
Features
- π² Dual view modes (Tree / Folder)
- π Three node types (Folder / Parent / Child)
- π¨ Customizable themes (icons, text, lines, colors)
- π― Interactive (tap, double-tap, right-click handlers)
- β¨ Multiple line styles (Connector / Scope / None)
Installation
dependencies:
flutter_folderview: ^0.1.0
Usage
import 'package:flutter_folderview/flutter_folderview.dart';
FolderView(
data: [
Node(
id: '1',
label: 'Documents',
type: NodeType.folder,
children: [
Node(
id: '2',
label: 'Work',
type: NodeType.parent,
children: [
Node(id: '3', label: 'Report.pdf', type: NodeType.child),
],
),
],
),
],
mode: ViewMode.folder, // or ViewMode.tree
onNodeTap: (node) => print('Tapped: ${node.label}'),
)
View Modes
ViewMode.folder: Shows folders at root with parent-child hierarchyViewMode.tree: Shows parent nodes at root (folders flattened)
Line Styles
theme: FlutterFolderViewTheme(
lineTheme: FolderViewLineTheme(
lineStyle: LineStyle.connector, // ββ ββ style
// lineStyle: LineStyle.scope, // VS Code style
// lineStyle: LineStyle.none, // No lines
),
)
Example
Run the example app for more demos:
cd example
flutter run
See example/ for complete examples with custom themes and different data structures.
Libraries
- flutter_folderview
- models/node
- services/size_service
- themes/flutter_folder_view_theme
- themes/folder_view_icon_theme
- themes/folder_view_line_theme
- themes/folder_view_node_style_theme
- themes/folder_view_scrollbar_theme
- themes/folder_view_spacing_theme
- themes/folder_view_text_theme
- themes/folder_view_theme
- widgets/custom_ink_well
- widgets/folder_view
- widgets/folder_view_content
- widgets/folder_view_horizontal_scrollbar
- widgets/folder_view_vertical_scrollbar
- widgets/node_widget
- widgets/synced_scroll_controllers