How can I import all files in a folder?

前端 未结 3 1999
余生分开走
余生分开走 2021-02-07 12:44

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

3条回答
  •  甜味超标
    2021-02-07 13:24

    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;
    

提交回复
热议问题