phase3: FIX arg-bang regex (missing \] in char class skipped subscripts). 235->183
This commit is contained in:
@@ -41,7 +41,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
|
||||
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,
|
||||
),
|
||||
@@ -86,7 +86,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
|
||||
'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) {
|
||||
if (quantity == 1) {
|
||||
cloneSelections[product.productAttributes![index].name!.toUpperCase()][idx]['quantity'] += 1;
|
||||
@@ -112,7 +112,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
|
||||
cloneSelections.remove(product.productAttributes![index].name!.toUpperCase());
|
||||
}
|
||||
|
||||
setOptionsStateDisabled(product.productAttributes![index].name, false);
|
||||
setOptionsStateDisabled(product.productAttributes![index].name!, false);
|
||||
|
||||
setState(() {
|
||||
selections = cloneSelections;
|
||||
@@ -125,19 +125,19 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
|
||||
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++) {
|
||||
int qty = 0;
|
||||
int idx = Utils.selectionsContains(selections, product.productAttributes![index].name, productOptions[i].name!);
|
||||
int idx = Utils.selectionsContains(selections, product.productAttributes![index].name!, productOptions[i].name!);
|
||||
if (idx != -1) {
|
||||
qty = selections[product.productAttributes![index].name!.toUpperCase()][idx]['quantity'];
|
||||
}
|
||||
optionState.add({'name': product.productAttributes![index].productOptions![i].name, 'disabled': false, 'quantity': qty, 'check': false});
|
||||
}
|
||||
optionsState[product.productAttributes![index].name] = optionState;
|
||||
optionsState[product.productAttributes![index].name!] = optionState;
|
||||
}
|
||||
|
||||
if (selections.containsKey(product.productAttributes![index].name!.toUpperCase())) {
|
||||
@@ -207,7 +207,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
|
||||
} 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;
|
||||
@@ -240,16 +240,16 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
|
||||
}
|
||||
|
||||
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