A simple library for get file-list of local disk.
See example.dart.
example/example.dart
// import '../lib/hi_files.dart';
import 'package:hi_files/hi_files.dart';
main() {
String path = 'E:\\Users\\Test';
C_Files dir = new C_Files(path);
dir.getSync();
print(dir.filesCount.toString() + ' files');
print(dir.dirsCount.toString() + ' Directories');
for (int i = 0; i < dir.filename.length; i++ ) {
switch (dir.type[i]) {
case 0:
print(dir.directory[i]);
break;
case 1:
print(dir.filename[i]);
}
}
List<String> extensions = ['xml', 'css'];
C_Files dir2 = new C_Files(path, extensions);
dir2.getSync();
print (dir2.filename.length);
for (String s in dir2.filename) {
print(s);
}
}
Add this to your package's pubspec.yaml file:
dependencies:
hi_files: "^0.1.1-a"
You can install packages from the command line:
with pub:
$ pub get
Alternatively, your editor might support pub get
.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:hi_files/hi_files.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.2.0 | Mar 30, 2014 |
|
|
0.1.1 | Mar 29, 2014 |
|
|
0.1.0 | Mar 23, 2014 |
|
|
0.1.1-a | Mar 29, 2014 |
|
|
This package version is not analyzed, because it is more than two years old. Check the latest stable version for its analysis.