The method 'validate' can't be unconditionally invoked because the receiver can be 'null'. Try making the call conditional (using '?.') or adding a null check to the target ('!').
/* dart 2.0 must implement null safety, try add use safe calls "?"
when declaring variable or use null check operator "!" behind object
*/
bool validate() {
bool status = false;
final form = formKey.currentState;
form?.save();
if (form!.validate()) {
form.save();
status = true;
} else {
status = false;
}
return status;
}