Sorry for my ignorance, but does that amount to loading a library on demand? If so, yes, Dart can do this:
import 'package:deferred/hello.dart' deferred as hello;
// When you need the library, invoke loadLibrary() using the library’s identifier.
greet() async {
await hello.loadLibrary();
hello.printGreeting();
}