Closed Aidanvii7 closed 4 years ago
Is this still happening if you give a name to your extension?
It is yea, I tried with a named extension first.
There is a workaround. It generates widgets correctly if the extensions library is imported with a name.
import 'my_extension' as my_extension;
It seems extensions are still accessible without needing a library prefix, so the above will result in an unused import warning, no big deal though.
Thinking about it, it's likely just because functional_widget
uses an outdates analyzer
This should be fixed now as analyzer
has been upgraded
Steps to reproduce
dependencies: flutter: sdk: flutter functional_widget_annotation: ^0.5.1
builders: functional_widget: ^0.7.1
extension on BuildContext {
}
@widget Widget example(BuildContext context) => const Placeholder();
class Example extends StatelessWidget { const Example({Key key}) : super(key: key);
@override Widget build(BuildContext _context) => example(_context); }
class Example extends StatelessWidget { const Example(this.context, {Key key}) : super(key: key);
final dynamic context;
@override Widget build(BuildContext _context) => example(context); }