phase3: improve arg-bang handler (allow ! in chains, ; terminator). 574->440

This commit is contained in:
2026-07-26 10:41:02 +08:00
parent 36f36b815f
commit 154d696e70
50 changed files with 138 additions and 138 deletions

View File

@@ -311,7 +311,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
void _addToCart(BuildContext context) {
if (widget.cartLineItemIndex != -1) {
if (cartInfo.productList![widget.cartLineItemIndex].quantity! + 1.0 > widget.product!.leftNum) {
if (cartInfo.productList![widget.cartLineItemIndex].quantity! + 1.0 > widget.product!.leftNum!) {
Fluttertoast.showToast(
msg: S.of(context).product_insufficient,
toastLength: Toast.LENGTH_SHORT,
@@ -336,7 +336,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
);
} else {
eventBus.fire(new OnProductWillAddToCart(widget.product!, {},
widget.product!.price, widget.product!.description,
widget.product!.price!, widget.product!.description!,
widget.business!, buttonKey: startKey));
}
}

View File

@@ -251,7 +251,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
bool disabled = optDisabled;
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;

View File

@@ -259,7 +259,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
bool disabled = optDisabled;
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;

View File

@@ -96,7 +96,7 @@ 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);
@@ -163,7 +163,7 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
bool disabled = optDisabled;
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;

View File

@@ -29,7 +29,7 @@ class ParabolicAnimationWidget extends AnimatedWidget {
Widget build(BuildContext context) {
_calPoints();
final Animation<double> animation = listenable;
final Animation<double> animation = listenable!;
final double time = animation.value;
// 设time=1 已知两点坐标 和 初速度 可求出 加速度 a
@@ -66,17 +66,17 @@ class ParabolicAnimationWidget extends AnimatedWidget {
void _calPoints() {
if (_startOffset == null) {
RenderBox stackBox = stackKey.currentContext!.findRenderObject();
RenderBox stackBox = stackKey.currentContext!.findRenderObject()!;
Offset stackBoxOffset = stackBox.globalToLocal(Offset.zero);
EdgeInsets startMargin = _margin(startKey);
RenderBox startBox = startKey.currentContext!.findRenderObject();
RenderBox startBox = startKey.currentContext!.findRenderObject()!;
_startOffset = startBox.localToGlobal(Offset(
startMargin.left + startAdjustOffset.dx,
stackBoxOffset.dy + startMargin.top + startAdjustOffset.dy));
EdgeInsets endMargin = _margin(endKey);
RenderBox endBox = endKey.currentContext!.findRenderObject();
RenderBox endBox = endKey.currentContext!.findRenderObject()!;
_endOffset = endBox.localToGlobal(Offset(
endMargin.left + endAdjustOffset.dx,
stackBoxOffset.dy + endMargin.top + endAdjustOffset.dy));

View File

@@ -49,11 +49,11 @@ class PopupAnimationWidget extends AnimatedWidget {
void _calAnimation() {
if (_startOffset == null) {
final RenderBox stackBox = stackKey.currentContext!.findRenderObject();
final RenderBox stackBox = stackKey.currentContext!.findRenderObject()!;
final Offset stackBoxOffset = stackBox.globalToLocal(Offset.zero);
final EdgeInsets startMargin = _margin(startKey);
final RenderBox startBox = startKey.currentContext!.findRenderObject();
final RenderBox startBox = startKey.currentContext!.findRenderObject()!;
_startOffset = startBox.localToGlobal(Offset(
startMargin.left + popupOffset.dx,

View File

@@ -57,7 +57,7 @@ class ReadMoreTextState extends State<ReadMoreText> {
@override
Widget build(BuildContext context) {
final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context);
TextStyle effectiveTextStyle = widget.style;
TextStyle effectiveTextStyle = widget.style!;
if (widget.style == null || widget.style!.inherit) {
effectiveTextStyle = defaultTextStyle.style.merge(widget.style);
}
@@ -122,7 +122,7 @@ class ReadMoreTextState extends State<ReadMoreText> {
textSize.width - linkSize.width,
textSize.height,
));
endIndex = textPainter.getOffsetBefore(pos.offset);
endIndex = textPainter.getOffsetBefore(pos.offset)!;
}
else {
var pos = textPainter.getPositionForOffset(