From ffe29009ed28624706187c68967aaa70bfd76da5 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sun, 29 Jan 2023 17:29:41 -0500 Subject: [PATCH] URL select modal now works when tapping text --- lib/pages/import_export.dart | 37 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/lib/pages/import_export.dart b/lib/pages/import_export.dart index f6d1dcf..df29739 100644 --- a/lib/pages/import_export.dart +++ b/lib/pages/import_export.dart @@ -564,18 +564,22 @@ class _UrlSelectionModalState extends State { widget.onlyOneSelectionAllowed ? tr('selectURL') : tr('selectURLs')), content: Column(children: [ ...urlWithDescriptionSelections.keys.map((urlWithD) { + select(bool? value) { + setState(() { + value ??= false; + if (value! && widget.onlyOneSelectionAllowed) { + selectOnlyOne(urlWithD.key); + } else { + urlWithDescriptionSelections[urlWithD] = value!; + } + }); + } + return Row(children: [ Checkbox( value: urlWithDescriptionSelections[urlWithD], onChanged: (value) { - setState(() { - value ??= false; - if (value! && widget.onlyOneSelectionAllowed) { - selectOnlyOne(urlWithD.key); - } else { - urlWithDescriptionSelections[urlWithD] = value!; - } - }); + select(value); }), const SizedBox( width: 8, @@ -599,12 +603,17 @@ class _UrlSelectionModalState extends State { const TextStyle(decoration: TextDecoration.underline), textAlign: TextAlign.start, )), - Text( - urlWithD.value.length > 128 - ? '${urlWithD.value.substring(0, 128)}...' - : urlWithD.value, - style: const TextStyle( - fontStyle: FontStyle.italic, fontSize: 12), + GestureDetector( + onTap: () { + select(!(urlWithDescriptionSelections[urlWithD] ?? false)); + }, + child: Text( + urlWithD.value.length > 128 + ? '${urlWithD.value.substring(0, 128)}...' + : urlWithD.value, + style: const TextStyle( + fontStyle: FontStyle.italic, fontSize: 12), + ), ), const SizedBox( height: 8,