Add: CartProvider

This commit is contained in:
2024-05-15 13:49:18 +03:00
parent e52357edf5
commit c54176212a
5 changed files with 89 additions and 54 deletions

View File

@@ -5,7 +5,9 @@ import 'dart:js_interop_unsafe' as js_util;
import 'package:flutter/material.dart';
import 'package:gymlink_module_web/main.dart';
import 'package:gymlink_module_web/pages/main.dart';
import 'package:gymlink_module_web/providers/cart.dart';
import 'package:gymlink_module_web/theme.dart';
import 'package:provider/provider.dart';
@js.JSExport()
class MyAppStateWeb extends State<MyApp> {
@@ -30,11 +32,14 @@ class MyAppStateWeb extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'GymLink Module',
theme: theme,
debugShowCheckedModeBanner: false,
home: MainPage(isLoading: _isLoading),
return ChangeNotifierProvider(
create: (_) => CartProvider(),
child: MaterialApp(
title: 'GymLink Module',
theme: theme,
debugShowCheckedModeBanner: false,
home: MainPage(isLoading: _isLoading),
),
);
}