简体   繁体   中英

Importing a top-level member of a library in Dart

What is the Dart equivalent of the following Python syntax for importing just a part of a module? This imports just urlopen from the urllib2 module.

from urllib2 import urlopen

To import only a part of a library, you can do the following. This imports only foo and bar :

import 'package:lib1/lib1.dart' show foo, bar; 

And this imports everything except foo :

import 'package:lib2/lib2.dart' hide foo;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM