URL select modal now works when tapping text

This commit is contained in:
Imran Remtulla
2023-01-29 17:29:41 -05:00
parent 60e3b68ebd
commit ffe29009ed

View File

@@ -564,10 +564,7 @@ class _UrlSelectionModalState extends State<UrlSelectionModal> {
widget.onlyOneSelectionAllowed ? tr('selectURL') : tr('selectURLs')), widget.onlyOneSelectionAllowed ? tr('selectURL') : tr('selectURLs')),
content: Column(children: [ content: Column(children: [
...urlWithDescriptionSelections.keys.map((urlWithD) { ...urlWithDescriptionSelections.keys.map((urlWithD) {
return Row(children: [ select(bool? value) {
Checkbox(
value: urlWithDescriptionSelections[urlWithD],
onChanged: (value) {
setState(() { setState(() {
value ??= false; value ??= false;
if (value! && widget.onlyOneSelectionAllowed) { if (value! && widget.onlyOneSelectionAllowed) {
@@ -576,6 +573,13 @@ class _UrlSelectionModalState extends State<UrlSelectionModal> {
urlWithDescriptionSelections[urlWithD] = value!; urlWithDescriptionSelections[urlWithD] = value!;
} }
}); });
}
return Row(children: [
Checkbox(
value: urlWithDescriptionSelections[urlWithD],
onChanged: (value) {
select(value);
}), }),
const SizedBox( const SizedBox(
width: 8, width: 8,
@@ -599,13 +603,18 @@ class _UrlSelectionModalState extends State<UrlSelectionModal> {
const TextStyle(decoration: TextDecoration.underline), const TextStyle(decoration: TextDecoration.underline),
textAlign: TextAlign.start, textAlign: TextAlign.start,
)), )),
Text( GestureDetector(
onTap: () {
select(!(urlWithDescriptionSelections[urlWithD] ?? false));
},
child: Text(
urlWithD.value.length > 128 urlWithD.value.length > 128
? '${urlWithD.value.substring(0, 128)}...' ? '${urlWithD.value.substring(0, 128)}...'
: urlWithD.value, : urlWithD.value,
style: const TextStyle( style: const TextStyle(
fontStyle: FontStyle.italic, fontSize: 12), fontStyle: FontStyle.italic, fontSize: 12),
), ),
),
const SizedBox( const SizedBox(
height: 8, height: 8,
) )