iamshaunjp / flutter-firebase

All course files for the Flutter & Firebase tutorial playlist on The Net Ninja YouTube channel
580 stars 441 forks source link

Lesson 11 - Register.dart and signin.dart are creating issues with the toggle view. #33

Open thecheebo opened 3 years ago

thecheebo commented 3 years ago

The code final Function toggleView; SignIn({this.toggleView}); and final Function toggleView; Register({this.toggleView});

are both returning this error:

The parameter 'toggleView' can't have a value of 'null' because of its type, but the implicit default value is 'null'. (Documentation) Try adding either an explicit non-'null' default value or the 'required' modifier.

kamaludin21 commented 2 years ago

Try this

for signin:

final Function toggleView;
const SignIn({Key? key, required this.toggleView}) : super(key: key);

for register:

final Function toggleView;
const SignUpScreen({Key? key, required this.toggleView}) : super(key: key);