I copied the demo, of https://mobx.pub/getting-started.
Found that they still reported mistakes, do not know where the lack of configuration



flutter packages pub run build_runner build
It's not generated Counter.g.dart

Your file is named with a capital C: Counter.dart. Rename it with small c as in counter.dart, then the part file will be considered. You can also see it in the red rectangle you marked.
Files in dart are always named in lowercase and words separated by underscore _
您的文件以大写字母命名
C:Counter.dart。小重命名它c为counter.dart,那么部分文件将被考虑。您也可以在标记的红色矩形中看到它。dart中的文件总是以小写形式命名,单词以下划线分隔
_
Your file is named with a capital
C:Counter.dart. Rename it with smallcas incounter.dart, then the part file will be considered. You can also see it in the red rectangle you marked.Files in dart are always named in lowercase and words separated by underscore
_
Thank you. I spent the afternoon solving this problem.
Oh man...learning can sometimes be hard and fun :-)
Can this case be detected by us?
Possible by looking at all the import / header declarations of the library. But I wonder if we even get invoked as build_runner itself does some sanity checks before invoking the PartBuilder. It will only do if there is a proper part statement.
I'm lead to believe that our builder may be invoked on every file. Remember that bug I introduced awhile back, where every dart file in the project being evaluated was getting a warning? 😜
Cool...then worth a shot checking it out
This library has so much space for improvement. It takes years to get through all errors
Most helpful comment
Your file is named with a capital
C:Counter.dart. Rename it with smallcas incounter.dart, then the part file will be considered. You can also see it in the red rectangle you marked.Files in dart are always named in lowercase and words separated by underscore
_