简体   繁体   中英

What is the purpose of hiding EmailAuthProvider for firebase_auth?

What is the purpose of the "hide" I see in almost all the example imports like the one below?

import 'package:firebase_auth/firebase_auth.dart'        
    hide EmailAuthProvider, PhoneAuthProvider;           // new

Even after multiple google searches and searches here, I can't find the answer. It is probably buried in some Dart tutorial somewhere, but I am really getting tired of searching through documentation that ends abruptly with a "404" or points to documentation that clearly labels itself as archived.

The keyword hide is used to only partially import names from the referenced library. In your case, you import all names except for the ones EmailAuthProvider and PhoneAuthProvider .

This can be useful when you import two libraries that contain the same name. Then you can hide one to make it clear which one to use.

For context, take a look at the dart language tour .

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