You can do that in different ways:
Read moreWhat is import in Dart?
Importing makes the components in a library available to the caller code . The import keyword is used to achieve the same. A dart file can have multiple import statements. Built in Dart library URIs use the dart: scheme to refer to a library.
Read moreHow do you import Dart IO in flutter?
To use the dart:io library in your code:
Read moreHow do you use the dart package?
To use a package, do the following:
Read moreHow do you run a dart file?
Run the app To run the app from the command line, use the Dart VM by running the dart run command in the app’s top directory : $ cd cli $ dart run Hello world: 42! If you want to run the app with debugging support, see Dart DevTools.
Read moreHow do I import a dart file?
Contents in this project Include Import Another Folder Dart File in Flutter Call Widget Example in Android iOS :-
Read moreHow do you run a dart script?
To run a Dart console application:
Read more