diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 34a1df6..3dfc402 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,12 +1,12 @@ - - + + android:icon="@mipmap/launcher_icon"> CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) + com.example.cheminova CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/lib/controller/cart_controller.dart b/lib/controller/cart_controller.dart index 0225567..abeb23c 100644 --- a/lib/controller/cart_controller.dart +++ b/lib/controller/cart_controller.dart @@ -49,7 +49,7 @@ class CartController extends GetxController { } // Update observable values subtotal.value = subTotal; - gstTotal.value = gstTotalAmount; + gstTotal.value = double.parse(gstTotalAmount.toStringAsFixed(2)); grandTotal.value = subtotal.value + gstTotal.value; } // Function to increase the quantity of a product in the cart @@ -76,6 +76,15 @@ class CartController extends GetxController { } } } + + + void updateQuantity(Product product, int quantity) { + final existingProduct = cartList.firstWhereOrNull((p) => p.id == product.id); + if (existingProduct != null) { + existingProduct.quantity = quantity; + updateTotalPrice();// Notify listeners + } + } // Function to remove a product from the cart void removeFromCart(Product product) { // Remove the product from the cart list diff --git a/lib/controller/home_service.dart b/lib/controller/home_service.dart index 4b127e0..c394906 100644 --- a/lib/controller/home_service.dart +++ b/lib/controller/home_service.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:cheminova/models/user_model.dart'; import 'package:cheminova/utils/api_urls.dart'; import 'package:cheminova/utils/common_api_service.dart'; @@ -33,35 +35,26 @@ class HomeService { } // Function to send FCM token to the server - Future?> fcmToken(Map data, - String? token) async { + Future?> fcmToken(Map data, String? token) async { try { - final response = await commonApiService( - // Making a POST request to send the FCM token + final response = await commonApiService>( url: ApiUrls.fcmUrl, method: 'POST', body: data, - // Body data to be sent in the request - fromJson: (json) => json as String, - // Just return the string response + fromJson: (json) => json as Map, // Parse JSON response additionalHeaders: { - // Pass the token here 'Authorization': 'Bearer $token', - // Bearer token for authenticated requests }, ); - if (response != null) { - // Since the response is a string, wrap it in a Map to avoid type issues - return { - 'message': response - }; // Return the response in a map with 'message' as the key + return response; // Return parsed response } return null; } catch (e) { - showSnackbar(e.toString()); // Handle any errors + showSnackbar(e.toString()); return null; } } + } diff --git a/lib/models/brand_model.dart b/lib/models/brand_model.dart index f377412..e7e45f1 100644 --- a/lib/models/brand_model.dart +++ b/lib/models/brand_model.dart @@ -1,27 +1,69 @@ class Brand { final String id; final String brandName; + List images; Brand({ required this.id, required this.brandName, + required this.images, }); factory Brand.fromJson(Map json) { return Brand( id: json['_id'], brandName: json['brandName'], + images: json["image"] != null + ? (json["image"] as List).map((e) => BrandImage.fromJson(e)).toList() + : [], + ); } Map toJson() { return { '_id': id, 'brandName': brandName, + "image": images.map((e) => e.toJson()).toList(), }; } @override String toString() { - return 'Brand(id: $id, brandName: $brandName,)'; + return 'Brand(id: $id, brandName: $brandName,images: $images)'; + } +} + + + +class BrandImage { + String publicId; + String url; + String imageId; + + BrandImage({ + required this.publicId, + required this.url, + required this.imageId, + }); + + factory BrandImage.fromJson(Map json) { + return BrandImage( + publicId: json["public_id"] ?? "", + url: json["url"] ?? "", + imageId: json["_id"] ?? "", + ); + } + + Map toJson() { + return { + "public_id": publicId, + "url": url, + "_id": imageId, + }; + } + + @override + String toString() { + return "BrandImage(publicId: $publicId, url: $url, imageId: $imageId)"; } } \ No newline at end of file diff --git a/lib/screens/annauncement/annauncement.dart b/lib/screens/annauncement/annauncement.dart index 4cfb502..dcbbf19 100644 --- a/lib/screens/annauncement/annauncement.dart +++ b/lib/screens/annauncement/annauncement.dart @@ -1,3 +1,121 @@ +// import 'package:cheminova/widgets/my_drawer.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter_svg/svg.dart'; +// import 'package:get/get.dart'; +// import 'package:intl/intl.dart'; +// +// import '../../controller/annaucement_controller.dart'; +// import '../../widgets/comman_background.dart'; +// import '../../widgets/common_appbar.dart'; +// +// class AnnouncementScreen extends StatefulWidget { +// AnnouncementScreen({super.key}); +// +// @override +// State createState() => _AnnouncementScreenState(); +// } +// +// class _AnnouncementScreenState extends State { +// // Initialize the controller +// final AnnouncementController _announcementController = Get.put(AnnouncementController()); +// +// +// String formatDate(String apiDate) { +// // Parse the API date string into a DateTime object +// DateTime parsedDate = DateTime.parse(apiDate).toLocal(); // Convert to local time +// +// // Format the date and time according to your specified format +// String formattedDate = DateFormat('EEE MMM dd yyyy').format(parsedDate); +// +// return formattedDate; // Return the formatted date string +// } +// +// +// @override +// Widget build(BuildContext context) { +// // Fetch announcements when the screen is built +// _announcementController.fetchAnnouncements(); +// +// return CommonBackground( +// child: Scaffold( +// backgroundColor: Colors.transparent, +// appBar: CommonAppBar( +// actions: [ +// IconButton( +// onPressed: () { +// Navigator.pop(context); +// }, +// icon: SvgPicture.asset('assets/svg/back_arrow.svg'), +// padding: const EdgeInsets.only(right: 20), +// ), +// ], +// title: const Text( +// 'Announcement', +// style: TextStyle( +// fontSize: 20, +// color: Colors.black, +// fontWeight: FontWeight.w400, +// fontFamily: 'Anek', +// ), +// ), +// backgroundColor: Colors.transparent, +// elevation: 0, +// ), +// drawer: MyDrawer(), +// body: Obx(() { +// // Show loading indicator while fetching announcements +// if (_announcementController.isLoading.value) { +// return Center(child: CircularProgressIndicator()); +// } +// // Show error message if there was an error +// if (_announcementController.errorMessage.isNotEmpty) { +// return Center( +// child: Text('Error: ${_announcementController.errorMessage}'), +// ); +// } +// // Display the list of announcements +// return ListView.builder( +// itemCount: _announcementController.announcements.length, +// itemBuilder: (context, index) { +// final announcementList = _announcementController.announcements[index]; +// print("asdf,${announcementList}"); +// return Column( +// children: [ +// Card( +// child: ListTile( +// //leading:Text(_announcementController.announcements[index].id), +// title: Row( +// +// children: [ +// Text("Message :",style: TextStyle(fontWeight: FontWeight.bold,fontSize: 14),), +// Text(announcementList.message.toString(),style: TextStyle(fontSize: 12),), +// +// ], +// ), +// subtitle: Row( +// children: [ +// Text("UniqueID :" , style: TextStyle(fontWeight: FontWeight.bold),), +// Text(announcementList.uniqueId.toString()), +// ], +// ), +// trailing: Text(formatDate(announcementList.createdAt.toString()),style: TextStyle(fontSize: 10),), +// ), +// +// ), +// +// ], +// ); +// }, +// ); +// }), +// ), +// ); +// } +// } + + + + import 'package:cheminova/widgets/my_drawer.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; @@ -16,24 +134,15 @@ class AnnouncementScreen extends StatefulWidget { } class _AnnouncementScreenState extends State { - // Initialize the controller final AnnouncementController _announcementController = Get.put(AnnouncementController()); - String formatDate(String apiDate) { - // Parse the API date string into a DateTime object - DateTime parsedDate = DateTime.parse(apiDate).toLocal(); // Convert to local time - - // Format the date and time according to your specified format - String formattedDate = DateFormat('EEE MMM dd yyyy').format(parsedDate); - - return formattedDate; // Return the formatted date string + DateTime parsedDate = DateTime.parse(apiDate).toLocal(); + return DateFormat('EEE MMM dd yyyy').format(parsedDate); } - @override Widget build(BuildContext context) { - // Fetch announcements when the screen is built _announcementController.fetchAnnouncements(); return CommonBackground( @@ -63,47 +172,61 @@ class _AnnouncementScreenState extends State { ), drawer: MyDrawer(), body: Obx(() { - // Show loading indicator while fetching announcements if (_announcementController.isLoading.value) { return Center(child: CircularProgressIndicator()); } - // Show error message if there was an error if (_announcementController.errorMessage.isNotEmpty) { return Center( child: Text('Error: ${_announcementController.errorMessage}'), ); } - // Display the list of announcements return ListView.builder( itemCount: _announcementController.announcements.length, itemBuilder: (context, index) { - final announcementList = _announcementController.announcements[index]; - print("asdf,${announcementList}"); - return Column( - children: [ - Card( - child: ListTile( - //leading:Text(_announcementController.announcements[index].id), - title: Row( - - children: [ - Text("Message :",style: TextStyle(fontWeight: FontWeight.bold,fontSize: 14),), - Text(announcementList.message.toString(),style: TextStyle(fontSize: 12),), - - ], + final announcementList = _announcementController.announcements[index]; + return Card( + margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 5), + child: ListTile( + // leading: CircleAvatar( + // backgroundColor: Colors.blue, + // child: Text( + // announcementList.uniqueId.toString().toUpperCase(), + // style: TextStyle(color: Colors.white), + // ), + // ), + title: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Message:", + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14), ), - subtitle: Row( - children: [ - Text("UniqueID :" , style: TextStyle(fontWeight: FontWeight.bold),), - Text(announcementList.uniqueId.toString()), - ], + Text( + announcementList.message.toString(), + style: TextStyle(fontSize: 12), + overflow: TextOverflow.ellipsis, ), - trailing: Text(formatDate(announcementList.createdAt.toString()),style: TextStyle(fontSize: 10),), - ), - + ], ), - - ], + subtitle: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "UniqueID:", + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text( + announcementList.uniqueId.toString(), + style: TextStyle(fontSize: 12), + overflow: TextOverflow.ellipsis, + ), + ], + ), + trailing: Text( + formatDate(announcementList.createdAt.toString()), + style: TextStyle(fontSize: 10), + ), + ), ); }, ); diff --git a/lib/screens/authentication/controller/auth_controller.dart b/lib/screens/authentication/controller/auth_controller.dart index edae0e2..81a0b4e 100644 --- a/lib/screens/authentication/controller/auth_controller.dart +++ b/lib/screens/authentication/controller/auth_controller.dart @@ -1,9 +1,12 @@ import 'dart:convert'; import 'package:cheminova/controller/home_controller.dart'; +import 'package:cheminova/controller/home_service.dart'; import 'package:cheminova/screens/authentication/controller/auth_service.dart'; +import 'package:cheminova/screens/authentication/login_screen.dart'; import 'package:cheminova/screens/home_screen.dart'; import 'package:cheminova/utils/show_snackbar.dart'; +import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -15,7 +18,7 @@ import '../../../utils/secure__storage_service.dart'; class AuthController extends GetxController { final authService = AuthService(); - + final Dio _dio = Dio(); final _storageService = SecureStorageService(); @@ -28,6 +31,7 @@ class AuthController extends GetxController { final HomeController _homeController = Get.put(HomeController()); RxBool isLoading = false.obs; + @override void onInit(){ super.onInit(); @@ -35,26 +39,106 @@ class AuthController extends GetxController { NotificationServices().requestNotificationPermission(); } // Function to handle user login + // Future login() async { + // isLoading.value = true; + // // Call the login service with email and password + // final response = await authService.login({ + // 'email': emailController.text, + // 'password': passwordController.text, + // }); + // isLoading.value = false; + // update(); + // if (response != null) { + // _homeController.fcmToken(); + // showSnackbar("Your Successfully logged In!"); + // + // Get.offAll(() => const HomeScreen()); + // } + // else if(response == null){ + // showSnackbar("Please Enter Valid Email or Password"); + // } + // } + + + Future login() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); isLoading.value = true; - // Call the login service with email and password + + // Perform login API request final response = await authService.login({ 'email': emailController.text, 'password': passwordController.text, }); + isLoading.value = false; update(); - if (response != null) { - _homeController.fcmToken(); - showSnackbar("Your Successfully logged In!"); + if (response != null && response['token'] != null) { + // Save the JWT token to SharedPreferences + String token = response['token']; + await prefs.setString('token', token); + + // Fetch the FCM token and send it to the server + final fcmToken = await NotificationServices().getDeviceToken(); + print('fcmToken: $fcmToken'); + await HomeService().fcmToken({'fcmToken': fcmToken}, token); + + showSnackbar("You successfully logged in!"); + + // Proceed to the HomeScreen after successful login + checkToken(); // Ensure the token is valid and the user is authenticated Get.offAll(() => const HomeScreen()); - } - else if(response == null){ - showSnackbar("Please Enter Valid Email or Password"); + } else { + showSnackbar("Please enter a valid email or password"); } } + + + + Future checkToken() async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + String? token = prefs.getString('token'); + + if (token != null) { + // Token exists, proceed with the flow (maybe fetch user data or navigate to the home screen) + print('Token found: $token'); + // You can also fetch the FCM token if necessary + final fcmToken = await NotificationServices().getDeviceToken(); + print('fcmToken: $fcmToken'); + + // Optionally send the FCM token to the server if needed + // This might be where you're getting the error + await _homeController.fcmToken(); + + + // Navigate to HomeScreen or perform other operations + Get.offAll(() => const HomeScreen()); + } else { + // No token found, redirect to login screen + Get.offAll(() => const LoginScreen()); + } + } + + +// Function to validate the token +// Future isTokenValid(String token) async { +// try { +// final response = await authService.validateToken(token); +// return response['isValid'] ?? false; // Adjust based on your API response +// } catch (e) { +// print("Token validation failed: $e"); +// return false; +// } +// } + + + + + + + // Future<(bool, String)> login() async { // isLoading(true); // try { diff --git a/lib/screens/authentication/controller/auth_service.dart b/lib/screens/authentication/controller/auth_service.dart index 85c3e43..b414cd2 100644 --- a/lib/screens/authentication/controller/auth_service.dart +++ b/lib/screens/authentication/controller/auth_service.dart @@ -1,10 +1,18 @@ import 'package:cheminova/utils/api_urls.dart'; import 'package:cheminova/utils/common_api_service.dart'; import 'package:cheminova/utils/show_snackbar.dart'; +import 'package:dio/dio.dart'; +import 'package:pretty_dio_logger/pretty_dio_logger.dart'; + +import '../../../utils/app_interceptor.dart'; class AuthService { - + final Dio _dio; + AuthService() : _dio = Dio(BaseOptions(baseUrl: 'https://api.cnapp.co.in')) { + _dio.interceptors.add(AuthInterceptor()); + _dio.interceptors.add(PrettyDioLogger()); + } // Function to handle user login Future?> login(Map data) async { try { diff --git a/lib/screens/authentication/profile_screen.dart b/lib/screens/authentication/profile_screen.dart index b9af1ef..a91df0c 100644 --- a/lib/screens/authentication/profile_screen.dart +++ b/lib/screens/authentication/profile_screen.dart @@ -26,7 +26,7 @@ class _ProfileScreenState extends State { @override Widget build(BuildContext context) { // Accessing the user details from the HomeController - final user = homecontroller!.user; + final user = homecontroller.user; return Stack( children: [ CommonBackground( diff --git a/lib/screens/inventory/inventory_management_screen.dart b/lib/screens/inventory/inventory_management_screen.dart index 6dca3af..ea86cae 100644 --- a/lib/screens/inventory/inventory_management_screen.dart +++ b/lib/screens/inventory/inventory_management_screen.dart @@ -23,7 +23,8 @@ class _InventoryManagementScreenState extends State { quantity: 100, description: 'Description 1', category: ProductCategory.food, - image: 'assets/images/product.png', + image: "assets/images/new_product.jpeg", + //'assets/images/product.png', ) ]; final List _filterList = [ diff --git a/lib/screens/kyc/kyc_screen.dart b/lib/screens/kyc/kyc_screen.dart new file mode 100644 index 0000000..37b73c5 --- /dev/null +++ b/lib/screens/kyc/kyc_screen.dart @@ -0,0 +1,213 @@ +// import 'dart:io'; +// +// import 'package:cheminova/screens/kyc/retailer_screen.dart'; +// import 'package:cheminova/screens/kyc/upload_document_screen.dart'; +// import 'package:cheminova/screens/kyc/verify_document_screen.dart'; +// import 'package:cheminova/widgets/my_drawer.dart'; +// import 'package:flutter_svg/flutter_svg.dart'; +// import 'package:image_picker/image_picker.dart'; +// import 'package:flutter/material.dart'; +// +// import '../../widgets/comman_background.dart'; +// import '../../widgets/common_appbar.dart'; +// +// +// class CollectKycScreen extends StatefulWidget { +// const CollectKycScreen({super.key}); +// +// @override +// State createState() => CollectKycScreenState(); +// } +// +// class CollectKycScreenState extends State +// with SingleTickerProviderStateMixin { +// late TabController _tabController; +// bool isLoading = false; +// +// final _pages = [ +// // RetailerDetailsScreen(), +// const UploadDocumentScreen(), +// const VerifyDocumentsScreen() +// ]; +// +// @override +// void initState() { +// _tabController = TabController(length: 3, vsync: this); +// super.initState(); +// } +// +// final locationController = TextEditingController(); +// final notesController = TextEditingController(); +// final dealerController = TextEditingController(); +// final productController = TextEditingController(); +// final qualityController = TextEditingController(); +// final marketNameController = TextEditingController(); +// final districtController = TextEditingController(); +// final stateController = TextEditingController(); +// final pincodeController = TextEditingController(); +// final aadharcardController = TextEditingController(); +// final pancardController = TextEditingController(); +// +// File? _selfieImage; +// File? _pesticideLicenseImage; +// File? _fertilizerLicenseImage; +// +// final ImagePicker _picker = ImagePicker(); +// +// Future _pickImage(ImageSource source, bool isSelfie) async { +// final pickedFile = await _picker.pickImage(source: source); +// +// setState(() { +// if (pickedFile != null) { +// if (isSelfie) { +// _selfieImage = File(pickedFile.path); +// } +// } +// }); +// } +// +// Future _pickLicenseImage(ImageSource source, bool isPesticide) async { +// final pickedFile = await _picker.pickImage(source: source); +// +// setState(() { +// if (pickedFile != null) { +// if (isPesticide) { +// _pesticideLicenseImage = File(pickedFile.path); +// } else { +// _fertilizerLicenseImage = File(pickedFile.path); +// } +// } +// }); +// } +// +// void _showPicker(BuildContext context, bool isSelfie) { +// showModalBottomSheet( +// context: context, +// builder: (BuildContext bc) { +// return SafeArea( +// child: Wrap( +// children: [ +// ListTile( +// leading: const Icon(Icons.photo_library), +// title: const Text('Photo Library'), +// onTap: () { +// _pickImage(ImageSource.gallery, isSelfie); +// Navigator.of(context).pop(); +// }, +// ), +// ListTile( +// leading: const Icon(Icons.photo_camera), +// title: const Text('Camera'), +// onTap: () { +// _pickImage(ImageSource.camera, isSelfie); +// Navigator.of(context).pop(); +// }, +// ), +// ], +// ), +// ); +// }, +// ); +// } +// +// void _showLicensePicker(BuildContext context, bool isPesticide) { +// showModalBottomSheet( +// context: context, +// builder: (BuildContext bc) { +// return SafeArea( +// child: Wrap( +// children: [ +// ListTile( +// leading: const Icon(Icons.photo_library), +// title: const Text('Photo Library'), +// onTap: () { +// _pickLicenseImage(ImageSource.gallery, isPesticide); +// Navigator.of(context).pop(); +// }, +// ), +// ListTile( +// leading: const Icon(Icons.photo_camera), +// title: const Text('Camera'), +// onTap: () { +// _pickLicenseImage(ImageSource.camera, isPesticide); +// Navigator.of(context).pop(); +// }, +// ), +// ], +// ), +// ); +// }, +// ); +// } +// +// @override +// Widget build(BuildContext context) { +// return Stack( +// children: [ +// CommonBackground( +// child: DefaultTabController( +// length: 3, +// child: Scaffold( +// backgroundColor: Colors.transparent, +// appBar: PreferredSize( +// preferredSize: const Size.fromHeight(100), +// child: CommonAppBar( +// actions: [ +// IconButton( +// onPressed: () { +// Navigator.pop(context); +// }, +// icon: SvgPicture.asset("assets/svg/back_arrow.svg"), +// //Image.asset('assets/Back_attendance.png'), +// padding: const EdgeInsets.only(right: 20), +// ), +// ], +// title: const Text( +// 'Collect KYC Data', +// style: TextStyle( +// fontSize: 20, +// color: Colors.black, +// fontWeight: FontWeight.w400, +// fontFamily: 'Anek', +// ), +// ), +// backgroundColor: Colors.transparent, +// elevation: 0, +// bottom: TabBar( +// controller: _tabController, +// padding: const EdgeInsets.symmetric(horizontal: 10), +// dividerColor: Colors.transparent, +// indicatorColor: Colors.yellow, +// labelColor: Colors.white, +// unselectedLabelColor: Colors.black, +// indicatorSize: TabBarIndicatorSize.tab, +// indicator: BoxDecoration( +// color: Colors.blue, +// borderRadius: BorderRadius.circular(10), +// ), +// tabs: const [ +// Tab(text: 'Details'), +// Tab(text: 'Documents'), +// Tab(text: 'Verify'), +// ], +// ), +// ), +// ), +// drawer: const MyDrawer(), +// body: TabBarView( +// controller: _tabController, +// physics: const NeverScrollableScrollPhysics(), +// children: _pages, +// ), +// ), +// ), +// ), +// if (isLoading) +// Container( +// color: Colors.black.withOpacity(0.5), +// child: const Center(child: CircularProgressIndicator()), +// ), +// ], +// ); +// } +// } diff --git a/lib/screens/order/checkout_screen.dart b/lib/screens/order/checkout_screen.dart index e5ff327..3c4ebed 100644 --- a/lib/screens/order/checkout_screen.dart +++ b/lib/screens/order/checkout_screen.dart @@ -146,7 +146,7 @@ class _CheckoutScreenState extends State { //category:product.category, category:Category(id: product.category.id, categoryName: product.category.categoryName), // brand:product.brand, - brand:Brand(id: product.brand.id, brandName: product.brand.brandName), + brand:Brand(id: product.brand.id, brandName: product.brand.brandName,images: product.brand.images), v: 0, addedBy: product.addedBy, ); }).toList(); diff --git a/lib/screens/order_management/order_management_detail_screen.dart b/lib/screens/order_management/order_management_detail_screen.dart index 5f9f23f..574bde5 100644 --- a/lib/screens/order_management/order_management_detail_screen.dart +++ b/lib/screens/order_management/order_management_detail_screen.dart @@ -234,7 +234,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 078026b..b1e47ce 100644 --- a/lib/screens/product/cart_screen.dart +++ b/lib/screens/product/cart_screen.dart @@ -123,146 +123,148 @@ class _CartScreenState extends State { ), ); } - return Column( - children: [ - SizedBox( - height: Get.height * 0.02, - ), - 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: [ - // "Select All" Checkbox - Row( - children: [ - Checkbox( - value: _selectAll, - onChanged: _toggleSelectAll, - ), - Text( - "Select All", // Label for the select all checkbox - style: GoogleFonts.roboto( - fontSize: 16, - fontWeight: FontWeight.w500, - ), - ), - ], - ), - SizedBox( - height: Get.height * 0.6, - child: ListView.builder( - padding: EdgeInsets.zero, - itemCount: _cartController.cartList.length, - itemBuilder: (context, index) { - return Row( - children: [ - Checkbox( - value: _cartController.selectedProducts.contains( - _cartController.cartList[index]), // Checkbox for individual product selection - onChanged: (value) { - _cartController.toggleProductSelection( + 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: [ + // "Select All" Checkbox + // Row( + // children: [ + // Checkbox( + // value: _selectAll, + // onChanged: _toggleSelectAll, + // ), + // Text( + // "Select All", // Label for the select all checkbox + // style: GoogleFonts.roboto( + // fontSize: 16, + // fontWeight: FontWeight.w500, + // ), + // ), + // ], + // ), + SizedBox( + height: Get.height * 0.6, + child: ListView.builder( + padding: EdgeInsets.zero, + itemCount: _cartController.cartList.length, + itemBuilder: (context, index) { + return Row( + children: [ + // Checkbox( + // value: _cartController.selectedProducts.contains( + // _cartController.cartList[index]), // Checkbox for individual product selection + // onChanged: (value) { + // _cartController.toggleProductSelection( + // _cartController.cartList[index], + // value!, + // ); + // _checkIfAllSelected(); // Check if all are selected after each toggle + // }, + // ), + Expanded( + child: ProductCard( + productModel: _cartController.cartList[index], - value!, - ); - _checkIfAllSelected(); // Check if all are selected after each toggle - }, - ), - Expanded( - child: ProductCard( - productModel: - _cartController.cartList[index], - isInCart: true, - placedOrder: widget.placedOrder, + isInCart: true, + placedOrder: widget.placedOrder, + ), ), - ), - ], - ); - }, + ], + ); + }, + ), ), - ), - const SizedBox(height: 10), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Subtotal ", - style: GoogleFonts.roboto( - fontSize: 15, - color: Colors.black, - fontWeight: FontWeight.bold, + const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Subtotal ", + style: GoogleFonts.roboto( + fontSize: 15, + color: Colors.black, + fontWeight: FontWeight.bold, + ), ), - ), - Obx(() => - Text("₹ ${_cartController.subtotal.value}")), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "GST ", - style: GoogleFonts.roboto( - fontSize: 15, - color: Colors.black, - fontWeight: FontWeight.bold, + Obx(() => + Text("₹ ${_cartController.subtotal.value}")), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "GST ", + style: GoogleFonts.roboto( + fontSize: 15, + color: Colors.black, + fontWeight: FontWeight.bold, + ), ), - ), - Obx(() => - Text("₹ ${_cartController.gstTotal.value}")), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Total Amount ", - style: GoogleFonts.roboto( - fontSize: 15, - color: Colors.black, - fontWeight: FontWeight.bold, + Obx(() => + Text("₹ ${_cartController.gstTotal.value}")), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Total Amount ", + style: GoogleFonts.roboto( + fontSize: 15, + color: Colors.black, + fontWeight: FontWeight.bold, + ), ), - ), - Obx(() => Text( - "₹ ${_cartController.grandTotal.value}")), - ], - ), - ], - ), - ), - ), - SizedBox(height: Get.height * 0.020), - SizedBox( - width: Get.width * 0.9, - height: Get.height * 0.06, - child: ElevatedButton( - onPressed: () => Get.to(() => CheckoutScreen( - selectedProducts: _cartController.selectedProducts, // Pass selected products to checkout - )), - style: ElevatedButton.styleFrom( - foregroundColor: Colors.white, - backgroundColor: const Color(0xFF00784C), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - ), - child: Text( - "Proceed to Checkout", - style: GoogleFonts.roboto( - fontSize: 16, - fontWeight: FontWeight.w600, + Obx(() => Text( + "₹ ${_cartController.grandTotal.value}")), + ], + ), + ], ), ), ), - ), - ], + SizedBox(height: Get.height * 0.020), + SizedBox( + width: Get.width * 0.9, + height: Get.height * 0.06, + child: ElevatedButton( + onPressed: () => Get.to(() => CheckoutScreen( + selectedProducts: _cartController.selectedProducts, // Pass selected products to checkout + )), + style: ElevatedButton.styleFrom( + foregroundColor: Colors.white, + backgroundColor: const Color(0xFF00784C), + 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 290eb96..60fe2f1 100644 --- a/lib/screens/product/product_detail_screen.dart +++ b/lib/screens/product/product_detail_screen.dart @@ -107,7 +107,10 @@ class _ProductDetailScreenState extends State { ), child: ClipRRect( borderRadius: BorderRadius.circular(10), - child: Image.asset("assets/images/product.png", fit: BoxFit.cover,), + child: Image.asset( + "assets/images/new_product.jpeg", + // "assets/images/product.png", + fit: BoxFit.cover,), // Image.asset( // widget.product.image, // fit: BoxFit.cover, diff --git a/lib/screens/rd orders/partial_pending_dialog.dart b/lib/screens/rd orders/partial_pending_dialog.dart index ab66edd..a3648ae 100644 --- a/lib/screens/rd orders/partial_pending_dialog.dart +++ b/lib/screens/rd orders/partial_pending_dialog.dart @@ -224,7 +224,7 @@ class _PartialPendingDialogScreenState extends State fontWeight: FontWeight.bold, ), ), - Text("₹ ${GstTotalAmounProcessItem}"), + Text("₹ ${GstTotalAmounProcessItem.toStringAsFixed(2)}"), ], ), Row( diff --git a/lib/screens/rd orders/partial_processing_dialog_screen.dart b/lib/screens/rd orders/partial_processing_dialog_screen.dart index eb0c595..d4cc809 100644 --- a/lib/screens/rd orders/partial_processing_dialog_screen.dart +++ b/lib/screens/rd orders/partial_processing_dialog_screen.dart @@ -486,7 +486,7 @@ class _PartialProcessingDialogScreenState extends State { @override void initState() { super.initState(); - Timer(const Duration(seconds: 2), () { - Get.offAll(() => const LoginScreen()); + Future.delayed(Duration(seconds: 2), () { + final authController = Get.put(AuthController()); + authController.checkToken(); }); } diff --git a/lib/utils/app_interceptor.dart b/lib/utils/app_interceptor.dart new file mode 100644 index 0000000..6fdb21a --- /dev/null +++ b/lib/utils/app_interceptor.dart @@ -0,0 +1,31 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class AuthInterceptor extends Interceptor { + @override + void onRequest( + RequestOptions options, RequestInterceptorHandler handler) async { + final prefs = await SharedPreferences.getInstance(); + final token = prefs.getString('token'); + + if (token != null) { + debugPrint('token-->\n $token\n'); + options.headers['Authorization'] = 'Bearer $token'; + } + + handler.next(options); + } + + @override + void onResponse(Response response, ResponseInterceptorHandler handler) { + // Handle the response if needed + handler.next(response); + } + + @override + void onError(DioException err, ErrorInterceptorHandler handler) async { + if (err.response?.statusCode == 401) {} + return handler.next(err); + } +} diff --git a/lib/widgets/my_drawer.dart b/lib/widgets/my_drawer.dart index 8f7cf91..4f6b161 100644 --- a/lib/widgets/my_drawer.dart +++ b/lib/widgets/my_drawer.dart @@ -1,3 +1,212 @@ +// import 'package:cheminova/controller/home_controller.dart'; +// import 'package:cheminova/models/user_model.dart'; +// import 'package:cheminova/screens/authentication/change_password_screen.dart'; +// import 'package:cheminova/screens/authentication/login_screen.dart'; +// import 'package:cheminova/screens/authentication/profile_screen.dart'; +// import 'package:cheminova/screens/home_screen.dart'; +// import 'package:flutter/material.dart'; +// import 'package:get/get.dart'; +// +// class MyDrawer extends StatefulWidget { +// final UserModel? userModel; +// +// MyDrawer({super.key, this.userModel}); +// +// @override +// State createState() => _MyDrawerState(); +// } +// +// class _MyDrawerState extends State { +// final homecontroller = Get.put(HomeController()); // Initialize HomeController +// @override +// Widget build(BuildContext context) { +// final user = homecontroller.user; // Get the current user from HomeController +// return Drawer( +// child: ListView( +// padding: EdgeInsets.zero, +// children: [ +// SizedBox( +// height: 150, +// // Drawer header displaying user information +// child: DrawerHeader( +// decoration: const BoxDecoration( +// color: Colors.black87, +// ), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Text( +// user?.name ?? "username", +// style: const TextStyle( +// color: Colors.white, +// fontSize: 18, +// ), +// ), +// Text( +// user?.uniqueId ?? 'Employee ID', +// style: const TextStyle( +// color: Colors.white, +// fontSize: 20, +// ), +// ), +// ], +// ), +// ), +// ), +// // Navigation tile for Home +// ListTile( +// leading: const Icon(Icons.home), +// title: const Text('Home'), +// onTap: () { +// Navigator.pushAndRemoveUntil( +// context, +// MaterialPageRoute(builder: (context) => const HomeScreen()), +// (route) => false, // Remove all previous routes +// ); +// }, +// ), +// // Navigation tile for Profile +// ListTile( +// leading: const Icon(Icons.account_circle), +// title: const Text('Profile'), +// onTap: () { +// Navigator.push( +// context, +// MaterialPageRoute(builder: (context) => ProfileScreen()), +// ); +// }, +// ), +// // Navigation tile for Change Password +// ListTile( +// leading: const Icon(Icons.settings), +// title: const Text('Change Password'), +// onTap: () { +// Navigator.push( +// context, +// MaterialPageRoute(builder: (context) => ChangePasswordScreen()), +// ); +// }, +// ), +// // Navigation tile for Logout +// ListTile( +// leading: const Icon(Icons.exit_to_app), +// title: const Text('Logout'), +// onTap: () { +// logoutBox(context); +// }, +// ), +// +// +// +// +// SizedBox( +// height: 700, +// child: Padding( +// padding: const EdgeInsets.all(8.0), +// child: Center( +// child: Text( +// 'Version 2.0.0', +// style: TextStyle(color: Colors.grey[600], fontSize: 12), +// ), +// ), +// ), +// ), +// ], +// ), +// ); +// } +// } +// // Function to display logout confirmation dialog +// Future logoutBox(BuildContext context) { +// Size size = MediaQuery.of(context).size; +// return showDialog( +// context: context, +// builder: (BuildContext context) { +// return AlertDialog( +// shape: RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(6.0), +// ), +// backgroundColor: Colors.white, +// alignment: Alignment.center, +// title: const Text('Are you sure you want to log out?'), +// titleTextStyle: const TextStyle( +// fontSize: 20, fontWeight: FontWeight.w400, color: Colors.black), +// actionsAlignment: MainAxisAlignment.center, +// actionsPadding: const EdgeInsets.only(left: 10, right: 10, bottom: 20), +// actions: [ +// Row( +// children: [ +// Expanded( +// child: SizedBox( +// height: (size.height / 50.52) * 2, +// child: ElevatedButton( +// style: ButtonStyle( +// elevation: MaterialStateProperty.all(0), +// backgroundColor: MaterialStateProperty.all( +// Colors.black), +// shape: MaterialStateProperty.all( +// RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(6.0), +// )), +// ), +// onPressed: () async { +// Navigator.pop(context); +// }, +// child: const Text( +// "No", +// style: TextStyle( +// fontSize: 17, +// color: Colors.white, +// fontWeight: FontWeight.w500), +// ), +// ), +// ), +// ), +// const SizedBox(width: 5), +// Expanded( +// child: SizedBox( +// height: (size.height / 50.52) * 2, +// child: ElevatedButton( +// style: ButtonStyle( +// elevation: MaterialStateProperty.all(0), +// backgroundColor: +// MaterialStateProperty.all(Colors.white), +// shape: +// MaterialStateProperty.all( +// RoundedRectangleBorder( +// borderRadius: BorderRadius.circular(6.0), +// side: const BorderSide( +// color: Colors.purple, width: 1))), +// ), +// onPressed: () async { +// Navigator.pushAndRemoveUntil( +// context, +// MaterialPageRoute( +// builder: (context) => LoginScreen()), +// (route) => false, +// ); +// }, +// child: const Text( +// "Yes", +// style: TextStyle( +// fontSize: 17, +// color: Colors.purple, +// fontWeight: FontWeight.w500), +// ), +// ), +// ), +// ), +// ], +// ) +// ], +// ); +// }, +// ); +// } + + + import 'package:cheminova/controller/home_controller.dart'; import 'package:cheminova/models/user_model.dart'; import 'package:cheminova/screens/authentication/change_password_screen.dart'; @@ -6,6 +215,7 @@ import 'package:cheminova/screens/authentication/profile_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'; class MyDrawer extends StatefulWidget { final UserModel? userModel; @@ -18,17 +228,34 @@ class MyDrawer extends StatefulWidget { class _MyDrawerState extends State { final homecontroller = Get.put(HomeController()); // Initialize HomeController + 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) { final user = homecontroller.user; // Get the current user from HomeController return Drawer( - child: ListView( - padding: EdgeInsets.zero, + child: Column( children: [ SizedBox( height: 150, + width: double.infinity, // Drawer header displaying user information child: DrawerHeader( + //padding: EdgeInsets.zero, decoration: const BoxDecoration( color: Colors.black87, ), @@ -36,6 +263,7 @@ class _MyDrawerState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ + Text( user?.name ?? "username", style: const TextStyle( @@ -96,11 +324,23 @@ class _MyDrawerState extends State { logoutBox(context); }, ), + // Spacer to push the version text to the bottom + const Spacer(), + Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Text( + 'Version: $_appVersion', + style: TextStyle(color: Colors.grey[600], fontSize: 12), + ), + ), + ), ], ), ); } } + // Function to display logout confirmation dialog Future logoutBox(BuildContext context) { Size size = MediaQuery.of(context).size; @@ -188,3 +428,4 @@ Future logoutBox(BuildContext context) { }, ); } + diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 8c7a0b8..387a08b 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,8 +12,10 @@ 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 sqflite import syncfusion_pdfviewer_macos import url_launcher_macos @@ -25,8 +27,10 @@ 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")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SyncfusionFlutterPdfViewerPlugin.register(with: registry.registrar(forPlugin: "SyncfusionFlutterPdfViewerPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 5250f60..7a828f7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -9,6 +9,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.44" + archive: + dependency: transitive + description: + name: archive + sha256: "6199c74e3db4fbfbd04f66d739e72fe11c8a8957d5f219f1f4482dbde6420b5a" + url: "https://pub.dev" + source: hosted + version: "4.0.2" args: dependency: transitive description: @@ -41,6 +49,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + sha256: "7c1183e361e5c8b0a0f21a28401eecdbde252441106a9816400dd4c2b2424916" + url: "https://pub.dev" + source: hosted + version: "3.4.1" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + sha256: "35814b016e37fbdc91f7ae18c8caf49ba5c88501813f73ce8a07027a395e2829" + url: "https://pub.dev" + source: hosted + version: "4.1.1" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + sha256: "980842f4e8e2535b8dbd3d5ca0b1f0ba66bf61d14cc3a17a9b4788a3685ba062" + url: "https://pub.dev" + source: hosted + version: "1.3.1" characters: dependency: transitive description: @@ -49,6 +81,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 +350,22 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_lints: - dependency: "direct dev" + flutter_cache_manager: + dependency: transitive description: - name: flutter_lints - sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + name: flutter_cache_manager + sha256: "400b6592f16a4409a7f2bb929a9a7e38c72cceb8ffb99ee57bbf2cb2cecf8386" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.4.1" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + sha256: bfa04787c85d80ecb3f8777bde5fc10c3de809240c48fa061a2c2bf15ea5211c + url: "https://pub.dev" + source: hosted + version: "0.14.3" flutter_local_notifications: dependency: "direct main" description: @@ -424,6 +480,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: @@ -504,6 +568,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: @@ -528,14 +600,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: @@ -576,6 +640,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.6" + octo_image: + dependency: transitive + description: + name: octo_image + sha256: "34faa6639a78c7e3cbe79be6f9f96535867e879748ade7d17c9b1ae7536293bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + 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: @@ -672,6 +760,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: @@ -680,6 +776,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" shared_preferences: dependency: "direct main" description: @@ -757,6 +861,22 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" + sqflite: + dependency: transitive + description: + name: sqflite + sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d + url: "https://pub.dev" + source: hosted + version: "2.3.3+1" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + url: "https://pub.dev" + source: hosted + version: "2.5.4" stack_trace: dependency: transitive description: @@ -845,6 +965,14 @@ packages: url: "https://pub.dev" source: hosted version: "26.2.14" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + url: "https://pub.dev" + source: hosted + version: "3.1.0+1" term_glyph: dependency: transitive description: @@ -1029,6 +1157,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 6c71145..96dc2ac 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.1+1 environment: sdk: ">=3.4.1 <4.0.0" @@ -56,17 +56,28 @@ dependencies: firebase_analytics: ^11.2.1 flutter_secure_storage: ^4.2.1 pretty_dio_logger: ^1.4.0 + package_info_plus: ^8.1.3 + cached_network_image: ^3.4.1 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-principal-distributor.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