phase3: FIX arg-bang regex (missing \] in char class skipped subscripts). 235->183
This commit is contained in:
@@ -50,7 +50,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
S.of(context).check_option_select_token(product.productAttributes![this.index].name),
|
||||
S.of(context).check_option_select_token(product.productAttributes![this.index].name!),
|
||||
style: new TextStyle(
|
||||
fontSize: 12.5,
|
||||
),
|
||||
@@ -95,7 +95,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
|
||||
'adjust_amount': adjustAmount
|
||||
};
|
||||
var cloneSelections = json.decode(json.encode(selections));
|
||||
int idx = Utils.selectionsContains(cloneSelections, product.productAttributes![index].name, name);
|
||||
int idx = Utils.selectionsContains(cloneSelections, product.productAttributes![index].name!, name);
|
||||
if (idx != -1) {
|
||||
(cloneSelections[product.productAttributes![index].name!.toUpperCase()] as List).removeAt(idx);
|
||||
} else if (cloneSelections.containsKey(product.productAttributes![index].name!.toUpperCase())) {
|
||||
@@ -108,7 +108,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
|
||||
cloneSelections.remove(product.productAttributes![index].name!.toUpperCase());
|
||||
}
|
||||
|
||||
setOptionsStateDisabled(product.productAttributes![index].name, false);
|
||||
setOptionsStateDisabled(product.productAttributes![index].name!, false);
|
||||
|
||||
setState(() {
|
||||
selections = cloneSelections;
|
||||
@@ -121,14 +121,14 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
|
||||
children: <Widget>[],
|
||||
);
|
||||
|
||||
List<ProductOption> productOptions = product.productAttributes![index].productOptions;
|
||||
List<ProductOption> productOptions = product.productAttributes![index].productOptions!;
|
||||
|
||||
if (!optionsState.containsKey(product.productAttributes![index].name)) {
|
||||
List<Map<String, dynamic>> optionState = [];
|
||||
for (var i = 0; i < productOptions.length; i++) {
|
||||
optionState.add({'name': product.productAttributes![index].productOptions![i].name, 'disabled': false, 'check': false});
|
||||
}
|
||||
optionsState[product.productAttributes![index].name] = optionState;
|
||||
optionsState[product.productAttributes![index].name!] = optionState;
|
||||
}
|
||||
|
||||
if (selections.containsKey(product.productAttributes![index].name!.toUpperCase())) {
|
||||
@@ -199,7 +199,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
|
||||
} else {
|
||||
if (_checkOptionIsCheck(productOptions[i].name!)) {
|
||||
setOptionsStateDisabled(
|
||||
product.productAttributes![index].name, true);
|
||||
product.productAttributes![index].name!, true);
|
||||
optionsState[product.productAttributes![index]
|
||||
.name][i]['disabled'] = false;
|
||||
break;
|
||||
@@ -232,16 +232,16 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
|
||||
}
|
||||
|
||||
void disableOptionIfNotSelected() {
|
||||
setOptionsStateDisabled(product.productAttributes![index].name, true);
|
||||
setOptionsStateDisabled(product.productAttributes![index].name!, true);
|
||||
for (var i = 0; i < optionsState[product.productAttributes![index].name].length; i++) {
|
||||
if (Utils.selectionsContains(selections, product.productAttributes![index].name, optionsState[product.productAttributes![index].name][i]['name']) != -1) {
|
||||
if (Utils.selectionsContains(selections, product.productAttributes![index].name!, optionsState[product.productAttributes![index].name][i]['name']) != -1) {
|
||||
optionsState[product.productAttributes![index].name][i]['disabled'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool _checkOptionIsCheck(String name) {
|
||||
if (Utils.selectionsContains(selections, product.productAttributes![index].name, name) != -1) {
|
||||
if (Utils.selectionsContains(selections, product.productAttributes![index].name!, name) != -1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user