Home > database >  A value of type 'Type' can't be returned from the method 'createState' beca
A value of type 'Type' can't be returned from the method 'createState' beca

Time:08-22

I got This Weird Error

"A value of type 'Type' can't be returned from the method 'createState' because it has a return type of 'State'."

@override
 State<RegisterView> createState() => _RegisterViewState;
 }
   class _RegisterViewState extends State<RegisterView> {
   late final TextEditingController _email;
   late final TextEditingController _password;```
   

CodePudding user response:

It will be _RegisterViewState()

State<RegisterView> createState() => _RegisterViewState();// here ()
  @override
  State<RegisterView> createState() => _RegisterViewState();
}

class _RegisterViewState extends State<RegisterView> {
  • Related