-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-ioos-androidtype-questionA question about expected behavior or functionalityA question about expected behavior or functionality
Description
Thank you for taking the time to file an issue!
This tracker is for issues related to:
- Dart core libraries ("dart:async", "dart:io", etc.)
SDK:
Dart SDK version: 2.10.3 (stable) (Tue Oct 27 14:44:30 2020 +0100) on "windows_x64"
Running on Google Pixel 4a Android 11 (Flutter)
Issue
While building an application which needs to be able to browse through local files. I think I stumped on a bug. The Direcotry.listSync (and also the Directory.list) methods do not return any files.
I have checked, there are files in the Download folder and I have tried in other directories as well.
Directories are listed, but files are not.
Steps to Reproduce
import 'dart:io';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final files = Directory('/storage/emulated/0/Download').listSync();
print(files);
return MaterialApp(
home: Scaffold(
body: ListView.builder(
itemCount: files.length,
itemBuilder: (context, i) => Text(files[i].path),
),
),
);
}
}Related issue on flutter github:
Metadata
Metadata
Assignees
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-ioos-androidtype-questionA question about expected behavior or functionalityA question about expected behavior or functionality