fix(runtime): checkout table_token(store.state.tableNumber!) -> tableNumber ?? ''. 普通网购用户无餐桌号(null)时崩溃. desktop L309/mobile L284. Fixes checkout/310 Unexpected null value

This commit is contained in:
2026-08-01 02:36:01 +08:00
parent 95e40f31cc
commit 3f9256491d
3 changed files with 7 additions and 2 deletions

View File

@@ -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();

View File

@@ -306,7 +306,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> 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,

View File

@@ -281,7 +281,7 @@ class MobileCheckoutState extends State<MobileCheckout> 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,