mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-01 14:34:24 +02:00
refactor(patch_options): disable card tap (#1368)
This commit is contained in:
parent
196d9fe4d2
commit
d97192e0ee
@ -77,7 +77,7 @@ class IntAndStringPatchOption extends StatelessWidget {
|
|||||||
if (patchOption.required && value == null) {
|
if (patchOption.required && value == null) {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children:[
|
children: [
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
I18nText(
|
I18nText(
|
||||||
'patchOptionsView.requiredOption',
|
'patchOptionsView.requiredOption',
|
||||||
@ -139,11 +139,16 @@ class IntStringLongListPatchOption extends StatelessWidget {
|
|||||||
value: e.toString(),
|
value: e.toString(),
|
||||||
optionType: type,
|
optionType: type,
|
||||||
onChanged: (newValue) {
|
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);
|
onChanged(values, patchOption);
|
||||||
},
|
},
|
||||||
removeValue: (value) {
|
removeValue: (value) {
|
||||||
patchOptionValue.value = List.from(patchOptionValue.value)..removeAt(index);
|
patchOptionValue.value = List.from(patchOptionValue.value)
|
||||||
|
..removeAt(index);
|
||||||
values.removeAt(index);
|
values.removeAt(index);
|
||||||
onChanged(values, patchOption);
|
onChanged(values, patchOption);
|
||||||
},
|
},
|
||||||
@ -158,10 +163,12 @@ class IntStringLongListPatchOption extends StatelessWidget {
|
|||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (type == 'StringListPatchOption') {
|
if (type == 'StringListPatchOption') {
|
||||||
patchOptionValue.value = List.from(patchOptionValue.value)..add('');
|
patchOptionValue.value = List.from(patchOptionValue.value)
|
||||||
|
..add('');
|
||||||
values.add('');
|
values.add('');
|
||||||
} else {
|
} else {
|
||||||
patchOptionValue.value = List.from(patchOptionValue.value)..add(0);
|
patchOptionValue.value = List.from(patchOptionValue.value)
|
||||||
|
..add(0);
|
||||||
values.add(0);
|
values.add(0);
|
||||||
}
|
}
|
||||||
onChanged(values, patchOption);
|
onChanged(values, patchOption);
|
||||||
@ -239,7 +246,6 @@ class PatchOption extends StatelessWidget {
|
|||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
onTap: () {},
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user