diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ae729ce..d729060 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -22,8 +22,8 @@ + android:icon="@mipmap/launcher_icon" + android:label="Retailer"> p.id == product.id); + if (existingProduct != null) { + existingProduct.quantity = quantity; + updateTotalPrice();// Notify listeners + } + } } diff --git a/lib/main.dart b/lib/main.dart index 5bbb7e5..98b69e6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,6 +8,7 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; + import 'package:get/get.dart'; import 'firebase_options.dart'; diff --git a/lib/notification_services.dart b/lib/notification_services.dart index 6777ade..d92dd0e 100644 --- a/lib/notification_services.dart +++ b/lib/notification_services.dart @@ -1,10 +1,12 @@ import 'dart:io'; + import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; + class NotificationServices { //initialising firebase message plugin FirebaseMessaging messaging = FirebaseMessaging.instance; diff --git a/lib/screens/inventory/inventory_product_detail_screen.dart b/lib/screens/inventory/inventory_product_detail_screen.dart index c0d7870..5d0fd36 100644 --- a/lib/screens/inventory/inventory_product_detail_screen.dart +++ b/lib/screens/inventory/inventory_product_detail_screen.dart @@ -96,7 +96,8 @@ class _InventoryProductDetailScreenState child: ClipRRect( borderRadius: BorderRadius.circular(10), child: Image.asset( - 'assets/images/product.png', + "assets/images/new_product.jpeg", + // 'assets/images/product.png', fit: BoxFit.cover, ), ), diff --git a/lib/screens/inventory/update_stock_screen.dart b/lib/screens/inventory/update_stock_screen.dart index 6fdb9c1..6200620 100644 --- a/lib/screens/inventory/update_stock_screen.dart +++ b/lib/screens/inventory/update_stock_screen.dart @@ -96,7 +96,8 @@ class _UpdateStockScreenState extends State { child: ClipRRect( borderRadius: BorderRadius.circular(10), child: Image.asset( - 'assets/images/product.png', + "assets/images/new_product.jpeg", + // 'assets/images/product.png', fit: BoxFit.cover, ), ), diff --git a/lib/screens/order_management/order_management_detail_screen.dart b/lib/screens/order_management/order_management_detail_screen.dart index 2ae87b3..05c7c3d 100644 --- a/lib/screens/order_management/order_management_detail_screen.dart +++ b/lib/screens/order_management/order_management_detail_screen.dart @@ -226,7 +226,8 @@ Future adduni()async { child: Row( children: [ Image.asset( - "assets/images/product.png", // Add the image URL here + "assets/images/new_product.jpeg", + // "assets/images/product.png", // Add the image URL here height: 50, width: 50, fit: BoxFit.cover, diff --git a/lib/screens/product/cart_screen.dart b/lib/screens/product/cart_screen.dart index dbe670f..6db27e2 100644 --- a/lib/screens/product/cart_screen.dart +++ b/lib/screens/product/cart_screen.dart @@ -145,159 +145,161 @@ class _CartScreenState extends State { } // If there are items in the cart, show the cart list and summary. - return Column( - children: [ - SizedBox( - height: Get.height * 0.02, - ), - - // Card widget for displaying the cart details and selection options. - Card( - margin: const EdgeInsets.symmetric(horizontal: 18), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(19), - side: const BorderSide(color: Color(0xFFFDFDFD)), + return SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: Get.height * 0.02, ), - color: const Color(0xFFB4D1E5).withOpacity(0.9), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - // Row for "Select All" checkbox and label. - Row( - children: [ - Checkbox( - value: _selectAll, // Checkbox value linked to _selectAll flag. - onChanged: _toggleSelectAll, // Toggle all selections when changed. - ), - Text( - "Select All", // Label for the select all checkbox. - style: GoogleFonts.roboto( - fontSize: 16, - fontWeight: FontWeight.w500, - ), - ), - ], - ), - - // List of products in the cart. - SizedBox( - height: Get.height * 0.6, - child: ListView.builder( - padding: EdgeInsets.zero, - itemCount: _cartController.cartList.length, // Number of items in the cart. - itemBuilder: (context, index) { - return Row( - children: [ - // Checkbox for individual product selection. - Checkbox( - value: _cartController.selectedProducts.contains( - _cartController.cartList[index]), - onChanged: (value) { - _cartController.toggleProductSelection( - _cartController.cartList[index], - value!, // Toggle product selection. - ); - _checkIfAllSelected(); // Recheck if all products are selected. - }, - ), - - // ProductCard displaying product details in the cart. - Expanded( - child: ProductCard( - productModel: _cartController.cartList[index], - isInCart: true, // Indicates this product is in the cart. - placedOrder: widget.placedOrder, + + // Card widget for displaying the cart details and selection options. + Card( + margin: const EdgeInsets.symmetric(horizontal: 18), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(19), + side: const BorderSide(color: Color(0xFFFDFDFD)), + ), + color: const Color(0xFFB4D1E5).withOpacity(0.9), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Row for "Select All" checkbox and label. + // Row( + // children: [ + // Checkbox( + // value: _selectAll, // Checkbox value linked to _selectAll flag. + // onChanged: _toggleSelectAll, // Toggle all selections when changed. + // ), + // Text( + // "Select All", // Label for the select all checkbox. + // style: GoogleFonts.roboto( + // fontSize: 16, + // fontWeight: FontWeight.w500, + // ), + // ), + // ], + // ), + + // List of products in the cart. + SizedBox( + height: Get.height * 0.6, + child: ListView.builder( + padding: EdgeInsets.zero, + itemCount: _cartController.cartList.length, // Number of items in the cart. + itemBuilder: (context, index) { + return Row( + children: [ + // Checkbox for individual product selection. + // Checkbox( + // value: _cartController.selectedProducts.contains( + // _cartController.cartList[index]), + // onChanged: (value) { + // _cartController.toggleProductSelection( + // _cartController.cartList[index], + // value!, // Toggle product selection. + // ); + // _checkIfAllSelected(); // Recheck if all products are selected. + // }, + // ), + + // ProductCard displaying product details in the cart. + Expanded( + child: ProductCard( + productModel: _cartController.cartList[index], + isInCart: true, // Indicates this product is in the cart. + placedOrder: widget.placedOrder, + ), ), - ), - ], - ); - }, + ], + ); + }, + ), ), - ), - const SizedBox(height: 10), - - // Row displaying the subtotal amount. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Subtotal ", - style: GoogleFonts.roboto( - fontSize: 15, - color: Colors.black, - fontWeight: FontWeight.bold, + const SizedBox(height: 10), + + // Row displaying the subtotal amount. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Subtotal ", + style: GoogleFonts.roboto( + fontSize: 15, + color: Colors.black, + fontWeight: FontWeight.bold, + ), ), - ), - // Display the subtotal using an Obx to update automatically. - Obx(() => Text("₹ ${_cartController.subtotal.value.toStringAsFixed(2)}")), - ], - ), - - // Row displaying the GST amount. - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "GST ", - style: GoogleFonts.roboto( - fontSize: 15, - color: Colors.black, - fontWeight: FontWeight.bold, + // Display the subtotal using an Obx to update automatically. + Obx(() => Text("₹ ${_cartController.subtotal.value.toStringAsFixed(2)}")), + ], + ), + + // Row displaying the GST amount. + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "GST ", + style: GoogleFonts.roboto( + fontSize: 15, + color: Colors.black, + fontWeight: FontWeight.bold, + ), ), - ), - Obx(() => Text("₹ ${_cartController.gstTotal.value.toStringAsFixed(2)}")), - ], - ), - - // Row displaying the total amount (subtotal + GST). - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Total Amount ", - style: GoogleFonts.roboto( - fontSize: 15, - color: Colors.black, - fontWeight: FontWeight.bold, + Obx(() => Text("₹ ${_cartController.gstTotal.value.toStringAsFixed(2)}")), + ], + ), + + // Row displaying the total amount (subtotal + GST). + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Total Amount ", + style: GoogleFonts.roboto( + fontSize: 15, + color: Colors.black, + fontWeight: FontWeight.bold, + ), ), - ), - Obx(() => Text("₹ ${_cartController.grandTotal.value.toStringAsFixed(2)}")), - ], - ), - ], - ), - ), - ), - - SizedBox(height: Get.height * 0.020), - - // Button to proceed to the checkout screen. - SizedBox( - width: Get.width * 0.9, - height: Get.height * 0.06, - child: ElevatedButton( - onPressed: () => Get.to(() => CheckoutScreen( - selectedProducts: _cartController.selectedProducts, // Pass selected products to CheckoutScreen. - )), - style: ElevatedButton.styleFrom( - foregroundColor: Colors.white, - backgroundColor: const Color(0xFF00784C), // Green button for checkout. - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - ), - child: Text( - "Proceed to Checkout", - style: GoogleFonts.roboto( - fontSize: 16, - fontWeight: FontWeight.w600, + Obx(() => Text("₹ ${_cartController.grandTotal.value.toStringAsFixed(2)}")), + ], + ), + ], ), ), ), - ), - ], + + SizedBox(height: Get.height * 0.020), + + // Button to proceed to the checkout screen. + SizedBox( + width: Get.width * 0.9, + height: Get.height * 0.06, + child: ElevatedButton( + onPressed: () => Get.to(() => CheckoutScreen( + selectedProducts: _cartController.selectedProducts, // Pass selected products to CheckoutScreen. + )), + style: ElevatedButton.styleFrom( + foregroundColor: Colors.white, + backgroundColor: const Color(0xFF00784C), // Green button for checkout. + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + ), + child: Text( + "Proceed to Checkout", + style: GoogleFonts.roboto( + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + ), + ), + ], + ), ); }), ), diff --git a/lib/screens/product/product_detail_screen.dart b/lib/screens/product/product_detail_screen.dart index 6e98494..1e14612 100644 --- a/lib/screens/product/product_detail_screen.dart +++ b/lib/screens/product/product_detail_screen.dart @@ -109,7 +109,8 @@ class _ProductDetailScreenState extends State { child: ClipRRect( borderRadius: BorderRadius.circular(10), // Clip the corners of the image. child: Image.asset( - "assets/images/product.png", // Product image. + "assets/images/new_product.jpeg", + //"assets/images/product.png", // Product image. fit: BoxFit.cover, // Cover the container. ), ), diff --git a/lib/screens/retail/retail_distributer_detail_screen.dart b/lib/screens/retail/retail_distributer_detail_screen.dart index 908a1aa..5f78d67 100644 --- a/lib/screens/retail/retail_distributer_detail_screen.dart +++ b/lib/screens/retail/retail_distributer_detail_screen.dart @@ -43,7 +43,7 @@ class _RetailDistributerDetailScreenState ), ], title: const Text( - "Retail Distributer Detail", + "Retailer Detail", ), ), body: Stack( diff --git a/lib/widgets/inventory_product_card.dart b/lib/widgets/inventory_product_card.dart index 5369f10..2c9373c 100644 --- a/lib/widgets/inventory_product_card.dart +++ b/lib/widgets/inventory_product_card.dart @@ -28,7 +28,10 @@ class InventoryProductCard extends StatelessWidget { width: Get.width * 0.30, decoration: BoxDecoration( image: DecorationImage( - image: Image.asset('assets/images/product.png').image, + image: Image.asset( + "assets/images/new_product.jpeg", + //'assets/images/product.png' + ).image, fit: BoxFit.cover, ), ), diff --git a/lib/widgets/my_drawer.dart b/lib/widgets/my_drawer.dart index 9279760..809a14c 100644 --- a/lib/widgets/my_drawer.dart +++ b/lib/widgets/my_drawer.dart @@ -1,9 +1,115 @@ +// import 'package:cheminova/controller/home_controller.dart'; +// import 'package:cheminova/screens/authentication/change_password_screen.dart'; +// import 'package:cheminova/screens/authentication/login_screen.dart'; +// import 'package:cheminova/screens/home_screen.dart'; +// import 'package:flutter/material.dart'; +// import 'package:get/get.dart'; +// +// import '../screens/authentication/Profile.dart'; +// +// class MyDrawer extends StatefulWidget { +// const MyDrawer({super.key}); +// +// @override +// State createState() => _MyDrawerState(); +// } +// +// class _MyDrawerState extends State { +// final HomeController _homeController = Get.find(); +// +// @override +// Widget build(BuildContext context) { +// return Drawer( +// child: ListView( +// padding: EdgeInsets.zero, +// children: [ +// SizedBox( +// height: 150, +// child: Obx(() { +// if (_homeController.isLoading.value) { +// return const Center(child: CircularProgressIndicator()); +// } else if (_homeController.error.value.isNotEmpty) { +// return Center(child: Text(_homeController.error.value)); +// } else { +// final user = _homeController.userProfile.value; +// return user == null ?const SizedBox(): DrawerHeader( +// decoration: const BoxDecoration( +// color: Colors.black87, +// ), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Text( +// user!.myData!.name ?? "username", +// style: const TextStyle( +// color: Colors.white, +// fontSize: 18, +// ), +// ), +// Text( +// user!.myData!.uniqueId ?? 'Employee ID', +// style: const TextStyle( +// color: Colors.white, +// fontSize: 20, +// ), +// ), +// ], +// ), +// ); +// } +// }), +// ), +// ListTile( +// leading: const Icon(Icons.home), +// title: const Text('Home'), +// onTap: () => Get.offAll(() => const HomeScreen()), +// ), +// ListTile( +// leading: const Icon(Icons.account_circle), +// title: const Text('Profile'), +// onTap: () => Get.to(() => const ProfileScreen()), +// ), +// ListTile( +// leading: const Icon(Icons.settings), +// title: const Text('Change Password'), +// onTap: () { +// Get.to(const ChangePasswordScreen()); +// }, +// ), +// ListTile( +// leading: const Icon(Icons.exit_to_app), +// title: const Text('Logout'), +// onTap: () => Get.offAll(() => const LoginScreen()), +// ), +// SizedBox( +// height: 700, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Center( +// child: Text( +// 'App Version 2.0.0', +// style: TextStyle(color: Colors.grey[600], fontSize: 12), +// ), +// ), +// ), +// ), +// ], +// ), +// ); +// } +// } + + + + import 'package:cheminova/controller/home_controller.dart'; import 'package:cheminova/screens/authentication/change_password_screen.dart'; import 'package:cheminova/screens/authentication/login_screen.dart'; import 'package:cheminova/screens/home_screen.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import '../screens/authentication/Profile.dart'; @@ -17,14 +123,30 @@ class MyDrawer extends StatefulWidget { class _MyDrawerState extends State { final HomeController _homeController = Get.find(); + String _appVersion = ''; + + @override + void initState() { + super.initState(); + _getAppVersion(); + } + + Future _getAppVersion() async { + PackageInfo packageInfo = await PackageInfo.fromPlatform( + + ); + setState(() { + _appVersion = packageInfo.version; // 1.0.0 + }); + } @override Widget build(BuildContext context) { return Drawer( - child: ListView( - padding: EdgeInsets.zero, - children: [ + child: Column( + children: [ SizedBox( height: 150, + width: double.infinity, child: Obx(() { if (_homeController.isLoading.value) { return const Center(child: CircularProgressIndicator()); @@ -32,7 +154,9 @@ class _MyDrawerState extends State { return Center(child: Text(_homeController.error.value)); } else { final user = _homeController.userProfile.value; - return user == null ?const SizedBox(): DrawerHeader( + return user == null + ? const SizedBox() + : DrawerHeader( decoration: const BoxDecoration( color: Colors.black87, ), @@ -41,14 +165,14 @@ class _MyDrawerState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - user!.myData!.name ?? "username", + user.myData!.name ?? "username", style: const TextStyle( color: Colors.white, fontSize: 18, ), ), Text( - user!.myData!.uniqueId ?? 'Employee ID', + user.myData!.uniqueId ?? 'Employee ID', style: const TextStyle( color: Colors.white, fontSize: 20, @@ -82,6 +206,16 @@ class _MyDrawerState extends State { title: const Text('Logout'), onTap: () => Get.offAll(() => const LoginScreen()), ), + const Spacer(), + Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Text( + 'Version: $_appVersion', + style: TextStyle(color: Colors.grey[600], fontSize: 12), + ), + ), + ), ], ), ); diff --git a/lib/widgets/product_card.dart b/lib/widgets/product_card.dart index 6a58ac5..4eade2f 100644 --- a/lib/widgets/product_card.dart +++ b/lib/widgets/product_card.dart @@ -48,13 +48,15 @@ class _ProductCardState extends State { @override Widget build(BuildContext context) { final CartController _cartController = Get.put(CartController()); + bool showQuantity = widget.isInCart || widget.isCheckout || widget.isConfirmation; bool isProductInCart = _cartController.cartList.any((p) => p.id == widget.productModel!.id); int currentQuantity = isProductInCart ? _cartController.cartList.firstWhere((p) => p.id == widget.productModel!.id).quantity : widget.productModel!.quantity; - + TextEditingController quantityController = + TextEditingController(text: currentQuantity.toString()); return GestureDetector( onTap: () => widget.isInCart || widget.isCheckout ? null @@ -67,11 +69,14 @@ class _ProductCardState extends State { child: ClipRRect( borderRadius: BorderRadius.circular(15.0), child: Container( - height: Get.height * 0.15, - width: Get.width * 0.31, + height: Get.height * 0.19, + width: Get.width * 0.32, decoration: BoxDecoration( image: DecorationImage( - image: AssetImage("assets/images/product.png"), + image: AssetImage( + "assets/images/new_product.jpeg", + // "assets/images/product.png" + ), fit: BoxFit.cover, ), ), @@ -98,19 +103,44 @@ class _ProductCardState extends State { fontWeight: FontWeight.w400, ), ), - Text( - "₹ ${widget.productModel!.price.toString()}", - style: GoogleFonts.roboto( - fontSize: 22, - fontWeight: FontWeight.w700, - ), - ), + if (!widget.isCheckout) + widget.isInCart + ? + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "₹ ${widget.productModel!.price.toString()}", + style: GoogleFonts.roboto( + fontSize: 22, + fontWeight: FontWeight.w700, + ), + ), + IconButton( + onPressed: () { + _cartController.removeFromCart(widget.productModel!); + showSnackbar("Product has been removed successfully!"); + setState(() { + currentQuantity = 1; + }); + }, + icon: const Icon( + Icons.delete_outline_rounded, + color: Colors.red, + ), + ), + ], + ) :SizedBox(), if (showQuantity) - Text( - "Quantity: ${currentQuantity}", - style: GoogleFonts.roboto( - fontSize: 15, - fontWeight: FontWeight.w700, + SizedBox( + height: Get.height * 0.04, + child: Text( + "Quantity: ${currentQuantity}", + style: GoogleFonts.roboto( + color: Color(0xFF004791), + fontSize: 15, + fontWeight: FontWeight.w700, + ), ), ), if (!widget.isCheckout) @@ -119,8 +149,8 @@ class _ProductCardState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - height: Get.height * 0.04, - width: Get.width * 0.21, + height: Get.height * 0.05, + width: Get.width * 0.40, decoration: BoxDecoration( color: const Color(0xFF004791), borderRadius: BorderRadius.circular(10), @@ -129,8 +159,8 @@ class _ProductCardState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ SizedBox( - height: 24, - width: 24, + height: 25, + width: 25, child: ElevatedButton( onPressed: () { _cartController.decreaseQuantity(widget.productModel!); @@ -143,6 +173,7 @@ class _ProductCardState extends State { }, style: ElevatedButton.styleFrom( padding: EdgeInsets.zero, + backgroundColor:Color(0xFF004791), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), ), @@ -150,22 +181,93 @@ class _ProductCardState extends State { child: Text( '-', style: GoogleFonts.roboto( - fontSize: 16, - fontWeight: FontWeight.w800, + color: Colors.white, + fontSize: 18, + fontWeight: FontWeight.bold, ), ), ), ), - Text( - "${currentQuantity}", - style: const TextStyle( - color: Colors.white, - fontSize: 16, + // Text( + // "${currentQuantity}", + // style: const TextStyle( + // color: Colors.white, + // fontSize: 16, + // ), + // ), + SizedBox(width: 5,), + Expanded( + child: TextFormField( + controller: quantityController, + style: const TextStyle( + color: Color(0xFF004791), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + keyboardType: TextInputType.number, + textAlign: TextAlign.center, + onFieldSubmitted: (value) { + int enteredQuantity = int.tryParse(value) ?? currentQuantity; + if (enteredQuantity <= 0) { + showSnackbar("Quantity must be at least 1"); + enteredQuantity = 1; + } + setState(() { + currentQuantity = enteredQuantity; + _cartController.updateQuantity(widget.productModel!, currentQuantity); + }); + }, + decoration: InputDecoration( + labelText: "Enter Quantity", + labelStyle: const TextStyle( + color: Color(0xFF004791), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + hintText: "", + hintStyle: const TextStyle( + color: Colors.grey, + fontWeight: FontWeight.w400, + fontSize: 14, + ), + filled: true, + fillColor: Colors.white, + contentPadding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide( + color: Color(0xFF004791), + width: 1.5, + ), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide( + color: Color(0xFF004791), + width: 2, + ), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide( + color: Colors.red, + width: 1.5, + ), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(12), + borderSide: const BorderSide( + color: Colors.red, + width: 2, + ), + ), + ), ), ), + SizedBox(width: 5,), SizedBox( - height: 22, - width: 22, + height: 25, + width: 25, child: ElevatedButton( onPressed: () { _cartController.increaseQuantity(widget.productModel!); @@ -178,6 +280,7 @@ class _ProductCardState extends State { }, style: ElevatedButton.styleFrom( padding: EdgeInsets.zero, + backgroundColor: Color(0xFF004791), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), ), @@ -185,8 +288,9 @@ class _ProductCardState extends State { child: Text( '+', style: GoogleFonts.roboto( - fontSize: 16, - fontWeight: FontWeight.w800, + color: Colors.white, + fontSize: 18, + fontWeight: FontWeight.bold, ), ), ), @@ -197,19 +301,19 @@ class _ProductCardState extends State { SizedBox( width: 2.0, ), - IconButton( - onPressed: () { - _cartController.removeFromCart(widget.productModel!); - showSnackbar("Product has been removed successfully!"); - setState(() { - currentQuantity = 1; - }); - }, - icon: const Icon( - Icons.delete_outline_rounded, - color: Colors.red, - ), - ), + // IconButton( + // onPressed: () { + // _cartController.removeFromCart(widget.productModel!); + // showSnackbar("Product has been removed successfully!"); + // setState(() { + // currentQuantity = 1; + // }); + // }, + // icon: const Icon( + // Icons.delete_outline_rounded, + // color: Colors.red, + // ), + // ), ], ) : ElevatedButton( diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 8c7a0b8..3c8a125 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,6 +12,7 @@ import firebase_core import firebase_crashlytics import firebase_messaging import flutter_local_notifications +import package_info_plus import path_provider_foundation import shared_preferences_foundation import syncfusion_pdfviewer_macos @@ -25,6 +26,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) + FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SyncfusionFlutterPdfViewerPlugin.register(with: registry.registrar(forPlugin: "SyncfusionFlutterPdfViewerPlugin")) diff --git a/pubspec.lock b/pubspec.lock index a979e44..af00f73 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -9,6 +9,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.42" + archive: + dependency: transitive + description: + name: archive + sha256: "6199c74e3db4fbfbd04f66d739e72fe11c8a8957d5f219f1f4482dbde6420b5a" + url: "https://pub.dev" + source: hosted + version: "4.0.2" args: dependency: transitive description: @@ -49,6 +57,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" clock: dependency: transitive description: @@ -302,14 +326,14 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_lints: + flutter_launcher_icons: dependency: "direct dev" description: - name: flutter_lints - sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + name: flutter_launcher_icons + sha256: bfa04787c85d80ecb3f8777bde5fc10c3de809240c48fa061a2c2bf15ea5211c url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "0.14.3" flutter_local_notifications: dependency: "direct main" description: @@ -416,6 +440,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + image: + dependency: transitive + description: + name: image + sha256: "8346ad4b5173924b5ddddab782fc7d8a6300178c8b1dc427775405a01701c4a6" + url: "https://pub.dev" + source: hosted + version: "4.5.2" image_picker: dependency: "direct main" description: @@ -496,6 +528,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.1" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" leak_tracker: dependency: transitive description: @@ -520,14 +560,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.1" - lints: - dependency: transitive - description: - name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 - url: "https://pub.dev" - source: hosted - version: "3.0.0" logger: dependency: "direct main" description: @@ -568,6 +600,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.6" + package_info_plus: + dependency: "direct main" + description: + name: package_info_plus + sha256: "739e0a5c3c4055152520fa321d0645ee98e932718b4c8efeeb51451968fe0790" + url: "https://pub.dev" + source: hosted + version: "8.1.3" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: a5ef9986efc7bf772f2696183a3992615baa76c1ffb1189318dd8803778fb05b + url: "https://pub.dev" + source: hosted + version: "3.0.2" path: dependency: transitive description: @@ -664,6 +712,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" + posix: + dependency: transitive + description: + name: posix + sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a + url: "https://pub.dev" + source: hosted + version: "6.0.1" pretty_dio_logger: dependency: "direct main" description: @@ -1021,6 +1077,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.5.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" sdks: dart: ">=3.4.1 <4.0.0" flutter: ">=3.22.0" diff --git a/pubspec.yaml b/pubspec.yaml index 4e6ca72..2996cc4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 +version: 2.0.0+1 environment: sdk: ">=3.4.1 <4.0.0" @@ -55,17 +55,25 @@ dependencies: firebase_crashlytics: ^4.0.4 firebase_analytics: ^11.2.1 pretty_dio_logger: ^1.3.1 + package_info_plus: ^8.1.3 dev_dependencies: flutter_test: sdk: flutter + flutter_launcher_icons: ^0.14.3 + + +flutter_launcher_icons: + android: "launcher_icon" + ios: true + image_path: "assets/images/app-icon-retailer.png" # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^3.0.0 +flutter_lints: ^3.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec