added assert to validate

This commit is contained in:
Thomas Klein Langenhorst 2022-10-25 15:49:49 +02:00
parent 51de713b0e
commit f4fe6e04c3

View file

@ -169,6 +169,8 @@ class AddressController extends ChangeNotifier {
AddressModel get model => _model;
bool validate() {
assert(_formKey.currentState != null,
'Validation can only be used if a FormKey is attached to the current Form');
return _formKey.currentState!.validate();
}