Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I import all files in a folder?

Tags:

dart

Say I got a bunch of dart scripts in a folder,

Is there anything I can do like import 'foo/*.dart'?

P.S. What if I got an array of filenames and wanna import those files?

like image 804
NamiW Avatar asked Sep 16 '14 03:09

NamiW


People also ask

How do I load all files in a directory in Python?

You can mainly use two methods to open all files inside a directory in Python: the os. listdir() function and the glob. glob() function.


1 Answers

You need to import each library individually.

What you can do is to create a library that imports all other libraries and reexports them.
you can then import this one library and get all libraries imported at once.

library all_in_one;

export library1.dart;
export library2.dart;
export library3.dart;
like image 61
Günter Zöchbauer Avatar answered Nov 03 '22 12:11

Günter Zöchbauer