Skip to content
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

@cwidget not generating ConsumerWidget as expected #103

Open
yuhao-nyc opened this issue May 4, 2022 · 3 comments
Open

@cwidget not generating ConsumerWidget as expected #103

yuhao-nyc opened this issue May 4, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@yuhao-nyc
Copy link

yuhao-nyc commented May 4, 2022

Describe the bug
updating @swidget to @cwidget to generate a ConsumerWidget instead of StatelessWidget.

The build_runner is not generating for me for some reason. It's still StatelessWidget. Try to delete the g.dart file still getting the same StatelessWidget.

flutter_riverpod: ^0.14.0+3
functional_widget_annotation: ^0.9.0
functional_widget: ^0.9.0+1
in my local. Not sure what am I missing

To Reproduce

part 'test_widget.g.dart';

@cwidget
Widget testWidget(BuildContext context) {
return Container()
}

Expected behavior
A clear and concise description of what you expected to happen.

@yuhao-nyc yuhao-nyc added the bug Something isn't working label May 4, 2022
@fior-di-latte
Copy link

fior-di-latte commented May 24, 2022

I can confirm the bug. @cwidget is not working, in the the corresponding generated g.dart-file the created Widget inherits from Stateless Widget instead of ConsumerWidget. Thus, there is trouble finding the _ref argument in the build method.

@itaispector
Copy link

itaispector commented Jul 13, 2022

Just to add that for me, no matter what annotation, build runner always generates a Stateless Widget.
functional_widget_annotation: ^0.10.0
functional_widget: ^0.10.0

@itaispector
Copy link

I had a dependency of freezed package. When I updated it to the latest version, it solves my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants