Mobx.dart: Missing "part 'Counter.g.dart';"

Created on 7 Sep 2019  ·  8Comments  ·  Source: mobxjs/mobx.dart

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

image
image
image

flutter packages pub run build_runner build

It's not generated Counter.g.dart
image

Most helpful comment

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 _

All 8 comments

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 _

您的文件以大写字母命名CCounter.dart。小重命名它ccounter.dart,那么部分文件将被考虑。您也可以在标记的红色矩形中看到它。

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 _

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jiyarong picture jiyarong  ·  4Comments

thedejifab picture thedejifab  ·  5Comments

jascodes picture jascodes  ·  5Comments

vadimtsushko picture vadimtsushko  ·  5Comments

pavanpodila picture pavanpodila  ·  5Comments