Skip to content

Commit 78b9e7c

Browse files
committed
added comments and platform check
1 parent c1c3578 commit 78b9e7c

35 files changed

+266
-78
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
## 0.0.1
22

33
* Initial release
4+
5+
## 0.0.2
6+
* Added KisWeb to detect and prevent webapps

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,23 @@ A Flutter package to view directories and files in a foldable tree structure. Th
66

77
- **Folder and File Tree Structure**: Display files and folders in a nested tree layout.
88
- **Foldable Directories**: Allow users to expand and collapse directories.
9-
- **Custom Icons**: Easily customize folder and file icons.
9+
- **Custom Icons**: Easily customize foldaer and file icons.
1010
- **Custom Text Styles**: Style folder and file names using `TextStyle`.
1111
- **File Tap Handler**: Handle file taps to perform custom actions.
1212

13+
| Platform | Supported |
14+
|------------|------------|
15+
| **Android** ||
16+
| **iOS** ||
17+
| **Windows** ||
18+
| **Linux** ||
19+
| **macOS** ||
20+
| **Web** ||
21+
22+
_Note_: This package is not currently compatible with Web.
23+
24+
<br>
25+
1326
<img src="https://i.imgur.com/CIw6251.gif" alt="gif" width="210" height="390" style="padding-right:45px"/>
1427
<img src = "https://i.imgur.com/dKUlq8v.gif" alt="gif" width="210" height="390"/>
1528

doc/api/file_tree_view/DirectoryTreeStateNotifier-class.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ <h1><span class="kind-class">DirectoryTreeStateNotifier</span> class
6161
</h1></div>
6262

6363

64+
<section class="desc markdown">
65+
<p>A notifier to manage the state of folded or unfolded directories.</p>
66+
</section>
6467

6568

6669
<section>
@@ -185,7 +188,7 @@ <h2>Methods</h2>
185188

186189
</dt>
187190
<dd>
188-
191+
Returns true if the directory is unfolded, otherwise false.
189192

190193

191194
</dd>
@@ -238,7 +241,7 @@ <h2>Methods</h2>
238241

239242
</dt>
240243
<dd>
241-
244+
Toggles the fold state of the directory.
242245

243246

244247
</dd>

doc/api/file_tree_view/DirectoryTreeStateNotifier/isUnfolded.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ <h1><span class="kind-method">isUnfolded</span> method
7171

7272
</section>
7373

74+
<section class="desc markdown">
75+
<p>Returns true if the directory is unfolded, otherwise false.</p>
76+
</section>
7477

7578

7679

doc/api/file_tree_view/DirectoryTreeStateNotifier/toggleFolder.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ <h1><span class="kind-method">toggleFolder</span> method
7171

7272
</section>
7373

74+
<section class="desc markdown">
75+
<p>Toggles the fold state of the directory.</p>
76+
</section>
7477

7578

7679

doc/api/file_tree_view/DirectoryTreeStateProvider-class.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ <h1><span class="kind-class">DirectoryTreeStateProvider</span> class
6161
</h1></div>
6262

6363

64+
<section class="desc markdown">
65+
<p>A provider that supplies <a href="../file_tree_view/DirectoryTreeStateNotifier-class.html">DirectoryTreeStateNotifier</a> to its descendants in the widget tree.</p>
66+
</section>
6467

6568

6669
<section>
@@ -99,7 +102,7 @@ <h2>Constructors</h2>
99102
<span class="name"><a href="../file_tree_view/DirectoryTreeStateProvider/DirectoryTreeStateProvider.html">DirectoryTreeStateProvider</a></span><span class="signature">({<span class="parameter" id="-param-key"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/foundation/Key-class.html">Key</a>?</span> <span class="parameter-name">key</span>, </span><span class="parameter" id="-param-notifier"><span>required</span> <span class="type-annotation"><a href="../file_tree_view/DirectoryTreeStateNotifier-class.html">DirectoryTreeStateNotifier</a></span> <span class="parameter-name">notifier</span>, </span><span class="parameter" id="-param-child"><span>required</span> <span class="type-annotation"><a href="https://api.flutter.dev/flutter/widgets/Widget-class.html">Widget</a></span> <span class="parameter-name">child</span></span>})</span>
100103
</dt>
101104
<dd>
102-
105+
Constructs a <a href="../file_tree_view/DirectoryTreeStateProvider-class.html">DirectoryTreeStateProvider</a> with the given notifier and child widget.
103106
<div class="constructor-modifier features">const</div>
104107
</dd>
105108
</dl>
@@ -346,7 +349,7 @@ <h2>Static Methods</h2>
346349

347350
</dt>
348351
<dd>
349-
352+
Accesses the <a href="../file_tree_view/DirectoryTreeStateNotifier-class.html">DirectoryTreeStateNotifier</a> in the widget tree.
350353

351354

352355
</dd>

doc/api/file_tree_view/DirectoryTreeStateProvider/DirectoryTreeStateProvider.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ <h1><span class="kind-constructor">DirectoryTreeStateProvider</span> constructor
6969
</section>
7070

7171

72+
<section class="desc markdown">
73+
<p>Constructs a <a href="../../file_tree_view/DirectoryTreeStateProvider-class.html">DirectoryTreeStateProvider</a> with the given notifier and child widget.</p>
74+
</section>
7275

7376

7477

doc/api/file_tree_view/DirectoryTreeStateProvider/of.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ <h1><span class="kind-method">of</span> static method
7171

7272
</section>
7373

74+
<section class="desc markdown">
75+
<p>Accesses the <a href="../../file_tree_view/DirectoryTreeStateNotifier-class.html">DirectoryTreeStateNotifier</a> in the widget tree.</p>
76+
</section>
7477

7578

7679

doc/api/file_tree_view/DirectoryTreeViewer-class.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ <h1><span class="kind-class">DirectoryTreeViewer</span> class
6161
</h1></div>
6262

6363

64+
<section class="desc markdown">
65+
<p>A widget to display a directory tree structure with foldable directories and customizable file/folder icons and text styles.</p>
66+
</section>
6467

6568

6669
<section>
@@ -97,7 +100,7 @@ <h2>Constructors</h2>
97100
<span class="name"><a href="../file_tree_view/DirectoryTreeViewer/DirectoryTreeViewer.html">DirectoryTreeViewer</a></span><span class="signature">({<span class="parameter" id="-param-key"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/foundation/Key-class.html">Key</a>?</span> <span class="parameter-name">key</span>, </span><span class="parameter" id="-param-rootPath"><span>required</span> <span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">rootPath</span>, </span><span class="parameter" id="-param-onFileTap"><span class="type-annotation">void</span> <span class="parameter-name">onFileTap</span>(<span class="parameter" id="param-"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-io/File-class.html">File</a></span></span>)?, </span><span class="parameter" id="-param-folderClosedicon"><span class="type-annotation">dynamic</span> <span class="parameter-name">folderClosedicon</span> = <span class="default-value">const Icon(Icons.folder)</span>, </span><span class="parameter" id="-param-folderOpenedicon"><span class="type-annotation">dynamic</span> <span class="parameter-name">folderOpenedicon</span> = <span class="default-value">const Icon(Icons.folder_open)</span>, </span><span class="parameter" id="-param-fileIcon"><span class="type-annotation">dynamic</span> <span class="parameter-name">fileIcon</span> = <span class="default-value">const Icon(Icons.insert_drive_file)</span>, </span><span class="parameter" id="-param-folderNameStyle"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/painting/TextStyle-class.html">TextStyle</a></span> <span class="parameter-name">folderNameStyle</span> = <span class="default-value">const TextStyle()</span>, </span><span class="parameter" id="-param-fileNameStyle"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/painting/TextStyle-class.html">TextStyle</a></span> <span class="parameter-name">fileNameStyle</span> = <span class="default-value">const TextStyle()</span>, </span><span class="parameter" id="-param-fileIconBuilder"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/widgets/Widget-class.html">Widget</a></span> <span class="parameter-name">fileIconBuilder</span>(<span class="parameter" id="param-fileExtension"><span class="type-annotation"><a href="https://api.flutter.dev/flutter/dart-core/String-class.html">String</a></span> <span class="parameter-name">fileExtension</span></span>)?</span>})</span>
98101
</dt>
99102
<dd>
100-
103+
Constructs a <a href="../file_tree_view/DirectoryTreeViewer-class.html">DirectoryTreeViewer</a> with the given properties.
101104
<div class="constructor-modifier features">const</div>
102105
</dd>
103106
</dl>
@@ -115,7 +118,7 @@ <h2>Properties</h2>
115118

116119
</dt>
117120
<dd>
118-
121+
The icon for files. Default is a generic file icon.
119122
<div class="features"><span class="feature">final</span></div>
120123

121124
</dd>
@@ -127,7 +130,7 @@ <h2>Properties</h2>
127130

128131
</dt>
129132
<dd>
130-
133+
A function that returns a custom file icon based on the file extension.
131134
<div class="features"><span class="feature">final</span></div>
132135

133136
</dd>
@@ -139,7 +142,7 @@ <h2>Properties</h2>
139142

140143
</dt>
141144
<dd>
142-
145+
The text style for file names. Default is an empty <a href="https://api.flutter.dev/flutter/painting/TextStyle-class.html">TextStyle</a>.
143146
<div class="features"><span class="feature">final</span></div>
144147

145148
</dd>
@@ -151,7 +154,7 @@ <h2>Properties</h2>
151154

152155
</dt>
153156
<dd>
154-
157+
The icon for closed folders. Default is a folder icon.
155158
<div class="features"><span class="feature">final</span></div>
156159

157160
</dd>
@@ -163,7 +166,7 @@ <h2>Properties</h2>
163166

164167
</dt>
165168
<dd>
166-
169+
The text style for folder names. Default is an empty <a href="https://api.flutter.dev/flutter/painting/TextStyle-class.html">TextStyle</a>.
167170
<div class="features"><span class="feature">final</span></div>
168171

169172
</dd>
@@ -175,7 +178,7 @@ <h2>Properties</h2>
175178

176179
</dt>
177180
<dd>
178-
181+
The icon for opened folders. Default is a folder opened icon.
179182
<div class="features"><span class="feature">final</span></div>
180183

181184
</dd>
@@ -211,7 +214,7 @@ <h2>Properties</h2>
211214

212215
</dt>
213216
<dd>
214-
217+
Callback function when a file is tapped. Accepts a <a href="https://api.flutter.dev/flutter/dart-io/File-class.html">File</a> as parameter.
215218
<div class="features"><span class="feature">final</span></div>
216219

217220
</dd>
@@ -223,7 +226,7 @@ <h2>Properties</h2>
223226

224227
</dt>
225228
<dd>
226-
229+
The root path of the directory to display.
227230
<div class="features"><span class="feature">final</span></div>
228231

229232
</dd>

doc/api/file_tree_view/DirectoryTreeViewer/DirectoryTreeViewer.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,25 @@ <h1><span class="kind-constructor">DirectoryTreeViewer</span> constructor
7777
</section>
7878

7979

80+
<section class="desc markdown">
81+
<p>Constructs a <a href="../../file_tree_view/DirectoryTreeViewer-class.html">DirectoryTreeViewer</a> with the given properties.</p>
82+
</section>
8083

8184

8285

8386
<section class="summary source-code" id="source">
8487
<h2><span>Implementation</span></h2>
85-
<pre class="language-dart"><code class="language-dart">const DirectoryTreeViewer(
86-
{super.key,
87-
required this.rootPath,
88-
this.onFileTap,
89-
this.folderClosedicon = const Icon(Icons.folder),
90-
this.folderOpenedicon = const Icon(Icons.folder_open,),
91-
this.fileIcon = const Icon(Icons.insert_drive_file),
92-
this.folderNameStyle=const TextStyle(),
93-
this.fileNameStyle=const TextStyle(),
94-
this.fileIconBuilder
95-
});</code></pre>
88+
<pre class="language-dart"><code class="language-dart">const DirectoryTreeViewer({
89+
super.key,
90+
required this.rootPath,
91+
this.onFileTap,
92+
this.folderClosedicon = const Icon(Icons.folder),
93+
this.folderOpenedicon = const Icon(Icons.folder_open),
94+
this.fileIcon = const Icon(Icons.insert_drive_file),
95+
this.folderNameStyle = const TextStyle(),
96+
this.fileNameStyle = const TextStyle(),
97+
this.fileIconBuilder,
98+
});</code></pre>
9699
</section>
97100

98101

0 commit comments

Comments
 (0)