@@ -202,23 +202,32 @@ class _SolidFileState extends State<SolidFile> {
202202
203203 /// Resolves the base path asynchronously.
204204 ///
205- /// Defaults to the app data directory path via [getDataDirPath] .
206- /// Falls back to POD root if the app data directory cannot be determined.
205+ /// If [widget.currentPath] is explicitly provided, it is used as the base
206+ /// path. This allows the widget to start from any location on the POD,
207+ /// including the root. Otherwise, defaults to the app data directory path
208+ /// via [getDataDirPath] . Falls back to POD root if the app data directory
209+ /// cannot be determined.
207210
208211 Future <void > _resolveBasePath () async {
209- try {
210- final appDataPath = await getDataDirPath ();
211- _resolvedBasePath = PathUtils .normalise (appDataPath);
212- } catch (e) {
213- // Fall back to POD root if getDataDirPath fails.
214-
215- debugPrint ('Failed to get app data path, falling back to POD root: $e ' );
216- _resolvedBasePath = SolidFile .podRoot;
212+ if (widget.currentPath != null ) {
213+ // Use the explicitly provided path as the base.
214+
215+ _resolvedBasePath = PathUtils .normalise (widget.currentPath! );
216+ } else {
217+ try {
218+ final appDataPath = await getDataDirPath ();
219+ _resolvedBasePath = PathUtils .normalise (appDataPath);
220+ } catch (e) {
221+ // Fall back to POD root if getDataDirPath fails.
222+
223+ debugPrint (
224+ 'Failed to get app data path, falling back to POD root: $e ' ,
225+ );
226+ _resolvedBasePath = SolidFile .podRoot;
227+ }
217228 }
218229
219- _currentPath = widget.currentPath != null
220- ? PathUtils .normalise (widget.currentPath! )
221- : _resolvedBasePath! ;
230+ _currentPath = _resolvedBasePath! ;
222231 setState (() {
223232 _isResolvingBasePath = false ;
224233 });
@@ -379,6 +388,9 @@ class _SolidFileState extends State<SolidFile> {
379388 }
380389
381390 /// Builds the file browser widget.
391+ ///
392+ /// Passes the resolved [_currentPath] as the initial path so the browser
393+ /// starts from the correct location (e.g., POD root for "All POD Files").
382394
383395 Widget _buildFileBrowser () {
384396 return SolidFileBrowserBuilder .build (
@@ -389,6 +401,7 @@ class _SolidFileState extends State<SolidFile> {
389401 widget.autoConfig,
390402 widget.friendlyFolderName,
391403 ),
404+ initialPath: widget.currentPath,
392405 onFileSelected: widget.onFileSelected,
393406 onFileDownload: widget.onFileDownload,
394407 onFileDelete: widget.onFileDelete,
0 commit comments