just add null aware (??) condition to handle the case when formKey is null.
(formkey.currentState.validate() ?? false) ? const SizedBox() : Container()