Reputation: 682
As Dart is case sensitive, therefore I was expecting all of Flutter to be case sensitive. Found out that importing packages is quite often non case sensitive.
Can anyone confirm and link to official documentation? I could not find definite answer on my own. Any other Flutter behaviors that are not case sensitive to be aware of? Am I missing something?
Upvotes: 4
Views: 1756
Reputation: 34769
Seems it's related to the operating system running the program
Check out the comment on this issue
It quotes:
Windows doesn't care if a file is named Test.dart or test.dart. For Windows (and Dart on Windows), it's the same. However, when we copy the file over to Android, it is important that we distinguish between the two. For Android (and Dart on Android) Test.dart and test.dart are not the same!
However it seems to be fixed with this PR
Official dart style guide says to name files with lowercase_with_underscores
, find the doc here. It's always better to follow the official style guides for naming, be it files, functions or classes.
Checkout official style guide here.
Hope that helps!
Upvotes: 4