英文:
There is two file import in flutter with same file name but different case
问题
Picture shown that two imports exists.../SignUp_repo.dart
and ../signup_repo.dart
.
I have tried flutter clean
and flutter pub get
but still got the same issue. If I import between both, only one import will work (The one with uppercase file name import).
Hope anyone can help me to solve this issue. Thanks!
英文:
Picture shown that two imports exists.../SignUp_repo.dart
and ../signup_repo.dart
.
I have tried flutter clean
and flutter pub get
but still got the same issue. If I import between both, only one import will work (The one with uppercase file name import).
Hope anyone can help me to solve this issue. Thanks!
答案1
得分: 3
你可以在导入时使用 as
前缀。
import '../SignUp/domain/repositories/SignUp_repo.dart' as signUp
然后可以这样使用 signUp.SignUpRepo
。你也可以对另一个做同样的操作。
英文:
You can use the as
prefix while importing.
import '../SignUp/domain/repositories/SignUp_repo.dart' as signUp
And use it like signUp.SignUpRepo
. You can do the same for another.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论