What is the difference between import, part,part of and export?

i couldn’t understand the difference of using those 4 words,could anyone explain please?


What I think I understood so far … :sweat_smile:

Import : To use another files and packages. To use file A classes in a file B for instance.

Export : Used in a barrel file. Your file (for instance models.dart) exports several model files. It’s his only use. Then, to use any model, you just have to import this barrel file.

Part : Injects all the content of a file into your file right here almost as if it was here in the first place. You often see this when you’ll use generators which must add content to a file.


@belalgamal you can also check this medium article out:

1 Like

Sorry, this file doesn’t open with me

@belalgamal try this one

1 Like