I have a library "foo" that consists of the "bar" part and imports the dart: io library. The library and part are declared as follows: "foo.dart":
// in foo.dart library foo; import 'dart:io'; part "bar.dart"; // resolves class Foo { Bar bar = new Bar(); // resolves HttpServer server = new HttpServer(); // resolves }
'foo.dart' and 'bar.dart' are in the same directory.
'bar.dart' refers to the foo library, for example:
// in bar.dart part of foo; // does not resolve class Bar { Foo foo = new Foo(); // does not resolve HttpServer server = new HttpServer // does not resolve }
But in the Dart editor, I see a warning in bar.dart saying "Can't solve foo." Accordingly, any import (such as "dart: io") that I declare in foo.dart is not available to bar.dart and does not apply to my definitions of foo.dart, and since bar.dart is part of foo, it is not allowed to import any additional libraries or declare any additional parts.
I would like to arrange my code in such a way that: * any import that I enter in foo.dart is available for bar.dart (and other parts of the source) * library definitions made in one part of the library source are available for other parts of the source libraries. * (obviously) library definitions made in bar.dart are available for foo.dart (this already works as expected)
Can someone please help me figure out how to do this?
source share