From 02ce9be9b4d8f6fd23b5d51b0bccd847dbcfd372 Mon Sep 17 00:00:00 2001 From: Valentin Eudeline Date: Thu, 25 Feb 2021 08:55:12 +0000 Subject: [PATCH] Trying to fix the security pin removal issue --- lib/views/settings.dart | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/views/settings.dart b/lib/views/settings.dart index fcfbd3ab..f2178d4c 100644 --- a/lib/views/settings.dart +++ b/lib/views/settings.dart @@ -315,13 +315,10 @@ class _SettingsState extends State { textFields: [ DialogTextField( validator: (text) { - if (int.tryParse(text) == null || int.tryParse(text) < 0) { - return L10n.of(context).pleaseEnter4Digits; + if (text.length == 0 || (text.length == 4 && int.tryparse(text) > 0)) { + return null; } - if (text.length != 4 && text.isNotEmpty) { - return L10n.of(context).pleaseEnter4Digits; - } - return null; + return L10n.of(context).pleaseEnter4Digits; }, keyboardType: TextInputType.number, obscureText: true,