refactor(patch_options): disable card tap (#1368)

This commit is contained in:
Pun Butrach 2023-10-15 16:56:43 +07:00 committed by GitHub
parent 196d9fe4d2
commit d97192e0ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,11 +139,16 @@ class IntStringLongListPatchOption extends StatelessWidget {
value: e.toString(),
optionType: type,
onChanged: (newValue) {
values[index] = type == 'StringListPatchOption' ? newValue : type == 'IntListPatchOption' ? int.parse(newValue) : num.parse(newValue);
values[index] = type == 'StringListPatchOption'
? newValue
: type == 'IntListPatchOption'
? int.parse(newValue)
: num.parse(newValue);
onChanged(values, patchOption);
},
removeValue: (value) {
patchOptionValue.value = List.from(patchOptionValue.value)..removeAt(index);
patchOptionValue.value = List.from(patchOptionValue.value)
..removeAt(index);
values.removeAt(index);
onChanged(values, patchOption);
},
@ -158,10 +163,12 @@ class IntStringLongListPatchOption extends StatelessWidget {
child: TextButton(
onPressed: () {
if (type == 'StringListPatchOption') {
patchOptionValue.value = List.from(patchOptionValue.value)..add('');
patchOptionValue.value = List.from(patchOptionValue.value)
..add('');
values.add('');
} else {
patchOptionValue.value = List.from(patchOptionValue.value)..add(0);
patchOptionValue.value = List.from(patchOptionValue.value)
..add(0);
values.add(0);
}
onChanged(values, patchOption);
@ -239,7 +246,6 @@ class PatchOption extends StatelessWidget {
return Padding(
padding: const EdgeInsets.all(8.0),
child: CustomCard(
onTap: () {},
child: Row(
children: [
Expanded(