If you want to use only part of a library, you can selectively import the library. For example:
// Import only foo and bar.
import 'package:lib1/lib1.dart' show foo, bar;
// Import all names EXCEPT foo.
import 'package:lib2/lib2.dart' hide foo;