mirror of
https://github.com/Iconica-Development/flutter_address_form.git
synced 2025-05-19 10:43:45 +02:00
added assert to validate
This commit is contained in:
parent
51de713b0e
commit
f4fe6e04c3
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue