Add full cart functionality with API integration: - Created Cart and OrderLineItem models with robust JSON parsing - Implemented cart API methods (getOrCreateCart, setLineItem, getCart, submitOrder) - Added cart state management to AppState with item count tracking - Built cart view screen with item display, quantity editing, and removal - Added cart badge to menu screen showing item count - Implemented real add-to-cart logic with recursive modifier handling - Added category name display in menu browsing - Fixed API response case sensitivity (ORDER/ORDERLINEITEMS) - Enhanced MenuItem model with categoryName field 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
26 lines
1,001 B
Dart
26 lines
1,001 B
Dart
import "package:flutter/material.dart";
|
|
|
|
import "../screens/cart_view_screen.dart";
|
|
import "../screens/login_screen.dart";
|
|
import "../screens/menu_browse_screen.dart";
|
|
import "../screens/restaurant_select_screen.dart";
|
|
import "../screens/service_point_select_screen.dart";
|
|
import "../screens/splash_screen.dart";
|
|
|
|
class AppRoutes {
|
|
static const String splash = "/";
|
|
static const String login = "/login";
|
|
static const String restaurantSelect = "/restaurants";
|
|
static const String servicePointSelect = "/service-points";
|
|
static const String menuBrowse = "/menu";
|
|
static const String cartView = "/cart";
|
|
|
|
static Map<String, WidgetBuilder> get routes => {
|
|
splash: (_) => const SplashScreen(),
|
|
login: (_) => const LoginScreen(),
|
|
restaurantSelect: (_) => const RestaurantSelectScreen(),
|
|
servicePointSelect: (_) => const ServicePointSelectScreen(),
|
|
menuBrowse: (_) => const MenuBrowseScreen(),
|
|
cartView: (_) => const CartViewScreen(),
|
|
};
|
|
}
|