I am trying to have a Hook
inside a Stateful Widget
and this is what I tried:
class MonthScreen extends Hook<void> {
final Month month;
MonthScreen(this.month, {Key key}) : super(key: key); // -> 'named parameter 'key' is not defined'
@override
_MonthScreenState createState() => _MonthScreenState(month);
}
class _MonthScreenState extends HookState<void, MonthScreen> {
final Month month;
_MonthScreenState(this.month);
@override
void initHook() {
super.initHook();
//initialize things here
}
//...
What am I doing wrong here? Flutter suggesting changing key
to keys
but what do I provide it with then?