From f4fe6e04c36a788c49fad532aa4216bd5eda5b09 Mon Sep 17 00:00:00 2001 From: Thomas Klein Langenhorst Date: Tue, 25 Oct 2022 15:49:49 +0200 Subject: [PATCH] added assert to validate --- lib/src/address_form.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/address_form.dart b/lib/src/address_form.dart index 5b5d10b..3378e3d 100644 --- a/lib/src/address_form.dart +++ b/lib/src/address_form.dart @@ -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(); }