Case sensitivity in Flutter

945

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!

Share:
945
Alexandre Jean
Author by

Alexandre Jean

Cheers

Updated on December 17, 2022

Comments

  • Alexandre Jean
    Alexandre Jean over 1 year

    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?

  • Alexandre Jean
    Alexandre Jean over 4 years
    Thank you - the github link is spot on and official. Any other such non case sensitive behavior you know of?