Closed gslender closed 1 year ago
Note that JsonSerializable on the very same setup works fine. Just adding the needed dependencies for a simple json example cause the build_runner to generate the file, but it still lacks the needed functional_widget code. So there is definitely something wrong that's specific to functional_widget
Flutter 3.7.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision c07f788888 (3 days ago) • 2023-02-22 17:52:33 -0600 Engine • revision 0f359063c4 Tools • Dart 2.19.2 • DevTools 2.20.1
Also tried a @freezed example and it works fine, but also noticed you pushed the generated file into a different part with part 'main.freezed.dart'
but not sure if that's something you require with functional_widget - the docs don't suggest that's needed, so just wondering
Hello!
The annotation cannot be used on methods. It can only be applied on top-level functions
So:
// OK
@swidget
Widget foo(BuildContext context, {int value = 0, int value2 = 2}) {
return Text('$value $value2');
}
clas Foo {
// Bad
@swidget
Widget foo(BuildContext context, {int value = 0, int value2 = 2}) {
return Text('$value $value2');
}
}
functional_widget doesn't even know that your method was annotated
Describe the bug When using a basic example / starter app, and using the current release of functional_widget and dependencies, it doesn't produce any output files. Nothing is generated. It looks as though build_runner silently just exits without any output.
To Reproduce
And this is what the pubspec.yaml looks like
Expected behavior that it generates the needed main.g.dart file ??