- Fixed _addModifiersRecursively to track OrderLineItemID through recursion - Changed from hardcoded parentOrderLineItemId: 0 to actual parent IDs - Added logic to find root item's OrderLineItemID before starting recursion - Added logic to find each modifier's OrderLineItemID for its children - Fixed API_BASE_URL to AALISTS_API_BASE_URL for environment consistency - Added comprehensive debug logging for troubleshooting This fix ensures nested modifiers (e.g., Customize Spread > Extra) are properly saved to the database with correct parent-child relationships. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
59 lines
1.3 KiB
Dart
59 lines
1.3 KiB
Dart
import "dart:async";
|
|
import "package:flutter/material.dart";
|
|
import "package:provider/provider.dart";
|
|
|
|
import "../app/app_router.dart";
|
|
import "../app/app_state.dart";
|
|
|
|
class SplashScreen extends StatefulWidget {
|
|
const SplashScreen({super.key});
|
|
|
|
@override
|
|
State<SplashScreen> createState() => _SplashScreenState();
|
|
}
|
|
|
|
class _SplashScreenState extends State<SplashScreen> {
|
|
Timer? _timer;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
|
|
_timer = Timer(const Duration(milliseconds: 2400), () {
|
|
if (!mounted) return;
|
|
|
|
final appState = context.read<AppState>();
|
|
|
|
// Navigate based on authentication status
|
|
if (appState.isLoggedIn) {
|
|
Navigator.of(context).pushReplacementNamed(AppRoutes.beaconScan);
|
|
} else {
|
|
Navigator.of(context).pushReplacementNamed(AppRoutes.login);
|
|
}
|
|
});
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_timer?.cancel();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return const Scaffold(
|
|
backgroundColor: Colors.black,
|
|
body: Center(
|
|
child: Text(
|
|
"PAYFRIT",
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 38,
|
|
fontWeight: FontWeight.w800,
|
|
letterSpacing: 3,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|