rrousselGit / functional_widget

A code generator to write widgets as function without loosing the benefits of classes.
597 stars 46 forks source link

Adding functional_widget_annotation import caused calls in Stateful widget to have errors #71

Closed MostHated closed 4 years ago

MostHated commented 4 years ago

I am not exactly sure if it's related to #70 but as soon as I added import 'package:functional_widget_annotation/functional_widget_annotation.dart'; in a stateful widget, my calls from the private class to wiget.whatEverHere threw errors throughout the entirety of the class, so I could not do anything at that point and had to remove it before I had the opportunity to test it out.

Is there a restriction of wigets having to originate in a stateless class and I just missed the note on it? I read through the readme and don't recall seeing it.

Thanks, -MH

rrousselGit commented 4 years ago

This happens because there's an annotation called "widget" which surprisingly happens to override State.widget

To fix:

import 'package:functional_widget_annotation/functional_widget_annotation.dart' hide widget;
rrousselGit commented 4 years ago

@widget was removed in 0.8.0