phase3: nullfix arg-bang handler (argument_type/invalid_assignment). 872 -> 621

This commit is contained in:
2026-07-25 18:16:40 +08:00
parent c21ccbd54d
commit a76b872966
65 changed files with 282 additions and 257 deletions

View File

@@ -133,7 +133,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
if (selections.containsKey(product.productAttributes![index].name!.toUpperCase())) {
Map<String, dynamic> attrExtraJson = Utils.stringToJson(
Map<String, dynamic> attrExtraJson = Utils.stringToJson(!
product.productAttributes![index].extra);
if (attrExtraJson != null) {
var selectLimitIfFieldEqualsTo = Rule.getRule(
@@ -187,17 +187,17 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
}
for (var i = 0; i < productOptions.length; i++) {
Map<String, dynamic> extraJson = Utils.stringToJson(
productOptions[i].extra);
Map<String, dynamic> extraJson = Utils.stringToJson(!
productOptions[i].extra!);
if (extraJson != null) {
Map<String, dynamic> exclusiveRule = Rule.getRule(
extraJson, Rule.RULE_EXCLUSIVE_SELECTION);
Map<String, dynamic> multiItemRule = Rule.getRule(extraJson, Rule.RULE_ACTUAL_QTY_IS);
if (exclusiveRule != null) {
if (thisLimitQty > 0 && !_checkOptionIsCheck(productOptions[i].name)) {
if (thisLimitQty > 0 && !_checkOptionIsCheck(productOptions[i].name!)) {
optionsState[product.productAttributes![index].name][i]['disabled'] = true;
} else {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
setOptionsStateDisabled(
product.productAttributes![index].name, true);
optionsState[product.productAttributes![index]
@@ -207,7 +207,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
}
}
if (multiItemRule != null) {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
if (multiItemRule[Rule.RULE_ACTUAL_QTY_IS] > thisLimitQty - (selections[product.productAttributes![index].name!.toUpperCase()] as List).length) {
disableOptionIfNotSelected();
}
@@ -249,9 +249,9 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
Widget _getOptionCheck(ProductOption productOption, bool optDisabled, int optIndex) {
bool disabled = optDisabled;
bool check = _checkOptionIsCheck(productOption.name);
bool check = _checkOptionIsCheck(productOption.name!);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!);
// Utils.jsonPrettyPrint(extraJson);
double extraAdjustAmount = 0.0;
@@ -333,7 +333,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
productOption.name,
productOption.name!,
style: new TextStyle(
fontSize: 14.0,
color: check ? selectedTextColor : deselectTextColor,

View File

@@ -131,7 +131,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
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'];
}
@@ -141,7 +141,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
}
if (selections.containsKey(product.productAttributes![index].name!.toUpperCase())) {
Map<String, dynamic> attrExtraJson = Utils.stringToJson(
Map<String, dynamic> attrExtraJson = Utils.stringToJson(!
product.productAttributes![index].extra);
if (attrExtraJson != null) {
var selectLimitIfFieldEqualsTo = Rule.getRule(
@@ -195,17 +195,17 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
}
for (var i = 0; i < productOptions.length; i++) {
Map<String, dynamic> extraJson = Utils.stringToJson(
productOptions[i].extra);
Map<String, dynamic> extraJson = Utils.stringToJson(!
productOptions[i].extra!);
if (extraJson != null) {
Map<String, dynamic> exclusiveRule = Rule.getRule(
extraJson, Rule.RULE_EXCLUSIVE_SELECTION);
Map<String, dynamic> multiItemRule = Rule.getRule(extraJson, Rule.RULE_ACTUAL_QTY_IS);
if (exclusiveRule != null) {
if (thisLimitQty > 0 && !_checkOptionIsCheck(productOptions[i].name)) {
if (thisLimitQty > 0 && !_checkOptionIsCheck(productOptions[i].name!)) {
optionsState[product.productAttributes![index].name][i]['disabled'] = true;
} else {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
setOptionsStateDisabled(
product.productAttributes![index].name, true);
optionsState[product.productAttributes![index]
@@ -215,7 +215,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
}
}
if (multiItemRule != null) {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
if (multiItemRule[Rule.RULE_ACTUAL_QTY_IS] > thisLimitQty - (selections[product.productAttributes![index].name!.toUpperCase()] as List).length) {
disableOptionIfNotSelected();
}
@@ -257,9 +257,9 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
Widget _getOptionQty(ProductOption productOption, bool optDisabled, int quantity, int optIndex) {
bool disabled = optDisabled;
bool check = _checkOptionIsCheck(productOption.name);
bool check = _checkOptionIsCheck(productOption.name!);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!);
// Utils.jsonPrettyPrint(extraJson);
double extraAdjustAmount = 0.0;
@@ -351,7 +351,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
productOption.name,
productOption.name!,
style: new TextStyle(
fontSize: 14.0,
color: check ? selectedTextColor : deselectTextColor,

View File

@@ -96,12 +96,12 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
}
}
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!);
if (extraJson != null) {
Map<String, dynamic> exclusiveRule = Rule.getRule(
extraJson, Rule.RULE_EXCLUSIVE_SELECTION);
if (exclusiveRule != null) {
if (_checkOptionIsCheck(productOption.name)) {
if (_checkOptionIsCheck(productOption.name!)) {
setOptionsStateDisabled(product.productAttributes![index].name, false);
}
}
@@ -129,12 +129,12 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
}
for (var i = 0; i < productOptions.length; i++) {
Map<String, dynamic> extraJson = Utils.stringToJson(productOptions[i].extra);
Map<String, dynamic> extraJson = Utils.stringToJson(productOptions[i].extra!);
if (extraJson != null) {
Map<String, dynamic> exclusiveRule = Rule.getRule(
extraJson, Rule.RULE_EXCLUSIVE_SELECTION);
if (exclusiveRule != null) {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
setOptionsStateDisabled(product.productAttributes![index].name, true);
optionsState[product.productAttributes![index].name][i]['disabled'] = false;
break;
@@ -161,9 +161,9 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
Widget _getOptionRadio(ProductOption productOption, bool optDisabled, int optIndex) {
bool disabled = optDisabled;
bool check = _checkOptionIsCheck(productOption.name);
bool check = _checkOptionIsCheck(productOption.name!);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!);
// Utils.jsonPrettyPrint(extraJson);
double extraAdjustAmount = 0.0;
@@ -245,7 +245,7 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
productOption.name,
productOption.name!,
style: new TextStyle(
fontSize: 14.0,
color: check ? selectedTextColor : deselectTextColor,