update cart
This commit is contained in:
@@ -26,11 +26,27 @@ import 'package:worker/generated/l10n/app_localizations.dart';
|
||||
/// - Quick action sections
|
||||
/// - Bottom navigation
|
||||
/// - Floating action button (Chat)
|
||||
class HomePage extends ConsumerWidget {
|
||||
///
|
||||
/// Initializes cart on mount to load items from API.
|
||||
class HomePage extends ConsumerStatefulWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
ConsumerState<HomePage> createState() => _HomePageState();
|
||||
}
|
||||
|
||||
class _HomePageState extends ConsumerState<HomePage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// Initialize cart from API on app startup
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
ref.read(cartProvider.notifier).initialize();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context);
|
||||
|
||||
// Watch member card state
|
||||
|
||||
Reference in New Issue
Block a user