From 3f9256491dbe60db43571c7ab1cb7c532172ec90 Mon Sep 17 00:00:00 2001 From: peima Date: Sat, 1 Aug 2026 02:36:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(runtime):=20checkout=20table=5Ftoken(store.?= =?UTF-8?q?state.tableNumber!)=20->=20tableNumber=20=3F=3F=20''.=20?= =?UTF-8?q?=E6=99=AE=E9=80=9A=E7=BD=91=E8=B4=AD=E7=94=A8=E6=88=B7=E6=97=A0?= =?UTF-8?q?=E9=A4=90=E6=A1=8C=E5=8F=B7(null)=E6=97=B6=E5=B4=A9=E6=BA=83.?= =?UTF-8?q?=20desktop=20L309/mobile=20L284.=20Fixes=20checkout/310=20Unexp?= =?UTF-8?q?ected=20null=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main.dart | 5 +++++ lib/widgets/desktop/desktop_checkout.dart | 2 +- lib/widgets/mobile/mobile_checkout.dart | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index d3aa075..f2eecbe 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -33,6 +33,11 @@ import 'utils/utils.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); + FlutterError.onError = (details) { + FlutterError.presentError(details); + print('CK_ERROR: ${details.exceptionAsString()}'); + print('CK_STACK: ${details.stack}'); + }; // Enable configureApp will cause route problem. // configureApp(); setPathUrlStrategy(); diff --git a/lib/widgets/desktop/desktop_checkout.dart b/lib/widgets/desktop/desktop_checkout.dart index 12e3ff7..8fc9c84 100644 --- a/lib/widgets/desktop/desktop_checkout.dart +++ b/lib/widgets/desktop/desktop_checkout.dart @@ -306,7 +306,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi mainAxisSize: MainAxisSize.min, children: [ Text( - S.of(context).table_token(store.state.tableNumber!), + S.of(context).table_token(store.state.tableNumber ?? ''), style: TextStyle( fontSize: 20.0, fontWeight: FontWeight.bold, diff --git a/lib/widgets/mobile/mobile_checkout.dart b/lib/widgets/mobile/mobile_checkout.dart index 6e0dfa0..92bda21 100644 --- a/lib/widgets/mobile/mobile_checkout.dart +++ b/lib/widgets/mobile/mobile_checkout.dart @@ -281,7 +281,7 @@ class MobileCheckoutState extends State with SingleTickerProvide mainAxisSize: MainAxisSize.min, children: [ Text( - S.of(context).table_token(store.state.tableNumber!), + S.of(context).table_token(store.state.tableNumber ?? ''), style: TextStyle( fontSize: 20.0, fontWeight: FontWeight.bold,