flutter_cart 0.0.9 flutter_cart: ^0.0.9 copied to clipboard
A flutter package for the cart management. This package helps you to perform basic cart operation like (Add to cart, Remove from cart, Get total count) etc.
import 'package:example/routes/routes.dart';
import 'package:flutter/material.dart';
import 'package:flutter_cart/flutter_cart.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
var cart = FlutterCart();
await cart.initializeCart(isPersistenceSupportEnabled: true);
runApp(const ProviderScope(child: MyApp()));
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routerConfig: router,
title: 'Example Cart',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
appBarTheme: const AppBarTheme(
color: Colors.deepPurple,
titleTextStyle: TextStyle(
color: Colors.white, fontWeight: FontWeight.w500, fontSize: 20),
),
),
debugShowCheckedModeBanner: false,
);
}
}