-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw if annotation is placed on methods instead of static functions #74
Comments
From your screen shot, it appears that you decorated a method instead of a
top-level function
Move the decorated method outside of the class and it should work
…On Fri, Sep 4, 2020, 15:14 Sergey Molchanovsky ***@***.***> wrote:
It simply does not working (nothing generates).
That's my steps:
- added part 'checkup_results_screen.g.dart'; (not mentioned in docs
but I guess it is needed)
- annotated my methods with @swidget <https://github.com/Swidget>
[image: image]
<https://user-images.githubusercontent.com/12999702/92243117-9989bf00-eec9-11ea-8c97-9847e8829e00.png>
I also tried to remove underscore and build word.
- it's unclear from the docs if I must pass context into function or
not (I tried both)
- run the build_runner
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#74>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEZ3I3JUEZJTCXBWOALO2H3SEDR43ANCNFSM4QYKVRTA>
.
|
Yes, it actually does. |
I'll see if we can throw an error in that situation |
This finally helped solve my issue. I spent hours today trying to figure out why build_runner wouldn't find the files with @swidget in them. I looked in verbose output and the files with @swidget were not even being acted upon. I was using the annotation on a method in my class. it wasn't clear from the docs that these methods should be moved outside of the class. If this warning cannot be accomplished in the build runner or annotation processing, it would be very helpful to spell this out in the docs. If I missed it somewhere please show me where. |
It simply does not working (nothing generates).
That's my steps:
part 'checkup_results_screen.g.dart';
(not mentioned in docs but I guess it is needed)I also tried to remove underscore and
build
word.My pubspec:
I also tried to put
functional_widget
intodev_dependencies
The text was updated successfully, but these errors were encountered: