From 71d0991366ac24227eaf6958e686fc51cdba135a Mon Sep 17 00:00:00 2001 From: bestonemitRam Date: Mon, 24 Feb 2025 18:54:00 +0530 Subject: [PATCH] home page --- .DS_Store | Bin 10244 -> 10244 bytes .dart_tool/package_config.json | 8 +- .dart_tool/package_config_subset | 4 + .flutter-plugins-dependencies | 2 +- android/app/src/main/AndroidManifest.xml | 2 +- lib/src/core/routes/routes.dart | 30 ++-- lib/src/ui/bestdeal/bestdeal_screen.dart | 28 +-- lib/src/ui/cart/cartview_screen.dart | 31 ++-- lib/src/ui/data_notfound.dart | 12 +- .../fruitvegidetail/fruit_veggie_detail.dart | 28 +-- lib/src/ui/home/home_screen.dart | 52 +++--- lib/src/ui/myOrder/my_order.dart | 10 +- lib/src/ui/profilepage/profile_screen.dart | 170 ++++++++++++++++-- lib/src/ui/static_page/privacyandpolicy.dart | 137 ++++++++++++++ .../ui/static_page/static_page_screen.dart | 44 ----- lib/src/ui/static_page/tersandconditions.dart | 137 ++++++++++++++ lib/src/ui/widgets/custom_text_field.dart | 155 ++++++++++++++++ pubspec.lock | 8 + pubspec.yaml | 1 + 19 files changed, 716 insertions(+), 143 deletions(-) create mode 100644 lib/src/ui/static_page/privacyandpolicy.dart delete mode 100644 lib/src/ui/static_page/static_page_screen.dart create mode 100644 lib/src/ui/static_page/tersandconditions.dart create mode 100644 lib/src/ui/widgets/custom_text_field.dart diff --git a/.DS_Store b/.DS_Store index dcd313c2cf546f6a4ed979a908fc1c91e817aa0c..35f6687ea2e9491cb6bfd7f65cddc77e555c3b75 100644 GIT binary patch delta 48 zcmZn(XbISGNRWk*`}OY0#{{#O8F?;jHWu2##I)w| - + diff --git a/lib/src/core/routes/routes.dart b/lib/src/core/routes/routes.dart index 782500a..9e679ba 100644 --- a/lib/src/core/routes/routes.dart +++ b/lib/src/core/routes/routes.dart @@ -22,6 +22,8 @@ import 'package:grocery_app/src/ui/payment/payment_failure_screen.dart'; import 'package:grocery_app/src/ui/payment/payment_success_screen.dart'; import 'package:grocery_app/src/ui/productdetails/product_details.dart'; import 'package:grocery_app/src/ui/splash/splash_screen.dart'; +import 'package:grocery_app/src/ui/static_page/privacyandpolicy.dart'; +import 'package:grocery_app/src/ui/static_page/tersandconditions.dart'; import 'package:grocery_app/utils/constants/globle_variable.dart'; /// Route names as constants @@ -99,12 +101,11 @@ class MyRoutes { animatedGoRoute( path: PRODUCTDETAILS, name: PRODUCTDETAILS, - pageBuilder: (context, state) - { + pageBuilder: (context, state) { // final id = state.extra as String; // Get the extra object // return ProductDetails(id: id); - - final args = state.extra as Map; + + final args = state.extra as Map; return ProductDetails( id: args["id"], @@ -114,11 +115,17 @@ class MyRoutes { }, ), - // animatedGoRoute( - // path: SELECTPAYMENTSCREEN, - // name: SELECTPAYMENTSCREEN, - // pageBuilder: (context, state) => const CardCheckoutScreen(), - // ), + animatedGoRoute( + path: TERMANDCONDITIONS, + name: TERMANDCONDITIONS, + pageBuilder: (context, state) => const TermsAndConditionsScreen(), + ), + + animatedGoRoute( + path: PRIVACY, + name: PRIVACY, + pageBuilder: (context, state) => const PrivacyPolicy(), + ), animatedGoRoute( path: SUCCESSPAYMENT, @@ -268,7 +275,10 @@ class MyRoutes { static const ORDERDETAILS = "/OrderDetailsScreen"; - // static const TERMANDCONDITIONS = "/termsandcondition"; + static const TERMANDCONDITIONS = "/termsandcondition"; + + static const PRIVACY = "/privacyandpolicy"; + // static const SETUPBUSSINESS = "/setupbussiness"; // static const CREATESTORE = "/createStore"; // static const SUBMITSCREEN = "/submitscreen"; diff --git a/lib/src/ui/bestdeal/bestdeal_screen.dart b/lib/src/ui/bestdeal/bestdeal_screen.dart index f464158..d367bd3 100644 --- a/lib/src/ui/bestdeal/bestdeal_screen.dart +++ b/lib/src/ui/bestdeal/bestdeal_screen.dart @@ -8,6 +8,7 @@ import 'package:grocery_app/src/core/routes/routes.dart'; import 'package:grocery_app/src/data/all_cart_items.dart'; import 'package:grocery_app/src/logic/provider/bottom_navbar_provider.dart'; import 'package:grocery_app/src/logic/provider/home_provider.dart'; +import 'package:grocery_app/src/ui/data_notfound.dart'; import 'package:grocery_app/utils/constants/assets_constant.dart'; import 'package:grocery_app/utils/constants/color_constant.dart'; import 'package:grocery_app/utils/constants/shared_pref_utils.dart'; @@ -281,7 +282,13 @@ class _BestDealScreenState extends State { ), ); } else if (provider.bestdeal.isEmpty) { - return Center(child: Text('No products available')); + return Center( + child: DataNotFound( + imagePath: 'assets/images/cart.jpg', + message: "Sorry! Don't have a product", + width: 300.w, + height: 300.h, + )); } else { return Padding( padding: const EdgeInsets.all(15), @@ -298,17 +305,14 @@ class _BestDealScreenState extends State { var bestdealproduct = provider.bestdeal[index]; return InkWell( onTap: () { - context.push(MyRoutes.PRODUCTDETAILS, - - - extra: { - "id": bestdealproduct.id, - "quantity": 0, - "price": '0', - }, - - - ); + context.push( + MyRoutes.PRODUCTDETAILS, + extra: { + "id": bestdealproduct.id, + "quantity": 0, + "price": '0', + }, + ); }, child: Container( decoration: BoxDecoration( diff --git a/lib/src/ui/cart/cartview_screen.dart b/lib/src/ui/cart/cartview_screen.dart index deb20d8..4ba5e6a 100644 --- a/lib/src/ui/cart/cartview_screen.dart +++ b/lib/src/ui/cart/cartview_screen.dart @@ -98,7 +98,7 @@ class _MycartState extends State { if (provider.isBestdealingloading) { return Center(child: CircularProgressIndicator()); } else if (provider.bestdeal.isEmpty) { - return Center(child: Text('No products available')); + return Center(child: Text('')); } else { return SizedBox( height: MediaQuery.of(context).size.height * 0.28, @@ -112,16 +112,14 @@ class _MycartState extends State { return InkWell( onTap: () { - context.push(MyRoutes.PRODUCTDETAILS, - - - extra: { - "id":bestdealproduct.id, - "quantity": 0, - "price": "0", - }, - - ); + context.push( + MyRoutes.PRODUCTDETAILS, + extra: { + "id": bestdealproduct.id, + "quantity": 0, + "price": "0", + }, + ); }, child: Padding( padding: const EdgeInsets.only(right: 5, bottom: 5, top: 5), @@ -434,8 +432,8 @@ class _MycartState extends State { return DataNotFound( imagePath: 'assets/images/cartempty.jpg', message: "", - width: 250.w, - height: 200.h, + width: 100.w, + height: 100.h, ); } else { return ListView.separated( @@ -450,17 +448,16 @@ class _MycartState extends State { var items = provider.allitem.items![index]; return InkWell( - onTap: () - { + onTap: () { context.push( MyRoutes.PRODUCTDETAILS, extra: { "id": items.product!.id, "quantity": items.quantity, - "price": items.product!.discountPrice, + "price": items.product!.discountPrice, }, ); - }, + }, child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.w), child: Row( diff --git a/lib/src/ui/data_notfound.dart b/lib/src/ui/data_notfound.dart index d001fa0..92ea112 100644 --- a/lib/src/ui/data_notfound.dart +++ b/lib/src/ui/data_notfound.dart @@ -20,11 +20,13 @@ class DataNotFound extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Image.asset( - imagePath, - width: width, - height: height, - fit: BoxFit.contain, + Center( + child: Image.asset( + imagePath, + width: width, + height: height, + fit: BoxFit.contain, + ), ), const SizedBox(height: 20), Text( diff --git a/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart b/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart index cb48cf3..b083f8e 100644 --- a/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart +++ b/lib/src/ui/fruitvegidetail/fruit_veggie_detail.dart @@ -122,13 +122,15 @@ class _FruitVeggieDetailState extends State { )), ); } else if (provider.products.isEmpty) { - return Padding( - padding: const EdgeInsets.only(left: 40), - child: DataNotFound( - imagePath: 'assets/images/cart.jpg', - message: "Product not abailable ", - width: 200.w, - height: 250.h, + return Center( + child: Padding( + padding: const EdgeInsets.only(left: 40), + child: DataNotFound( + imagePath: 'assets/images/cart.jpg', + message: "Product not abailable ", + width: 200.w, + height: 250.h, + ), ), ); } else { @@ -179,16 +181,16 @@ class _FruitVeggieDetailState extends State { var product = provider.products[index]; return InkWell( onTap: () { - context.push(MyRoutes.PRODUCTDETAILS, - // extra: product.id + context.push( + MyRoutes.PRODUCTDETAILS, + // extra: product.id - extra: { + extra: { "id": product.id, "quantity": 0, "price": "0", }, - - ); + ); }, child: Container( height: itemHeight, @@ -474,7 +476,7 @@ class _FruitVeggieDetailState extends State { ), )); } else if (provider.categoryList.isEmpty) { - return Center(child: Text('No products available')); + return SizedBox.shrink(); } else { return Container( decoration: const BoxDecoration(color: Colors.white), diff --git a/lib/src/ui/home/home_screen.dart b/lib/src/ui/home/home_screen.dart index 1dd4050..2f05503 100644 --- a/lib/src/ui/home/home_screen.dart +++ b/lib/src/ui/home/home_screen.dart @@ -1,11 +1,13 @@ import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:go_router/go_router.dart'; import 'package:grocery_app/src/common_widget/network_image.dart'; import 'package:grocery_app/src/core/routes/routes.dart'; import 'package:grocery_app/src/logic/provider/home_provider.dart'; import 'package:grocery_app/src/ui/bestdeal/bestdeal_screen.dart'; +import 'package:grocery_app/src/ui/data_notfound.dart'; import 'package:grocery_app/src/ui/fruitvegidetail/fruit_veggie_detail.dart'; import 'package:grocery_app/src/ui/header.dart'; import 'package:grocery_app/utils/constants/color_constant.dart'; @@ -33,14 +35,13 @@ class _HomeScreenState extends State { WidgetsBinding.instance.addPostFrameCallback((_) { final productProvider = Provider.of(context, listen: false); - productProvider .determinePosition(); + productProvider.determinePosition(); productProvider.getBanners(context); productProvider.getHomeProduct(context, "", '', '', '', ''); productProvider.getBestDealProduct(context, ''); productProvider.getAllcategory(context); - getUserDetails(); }); } @@ -71,8 +72,7 @@ class _HomeScreenState extends State { Row( children: [ Consumer( - builder: (context, provider, child) - { + builder: (context, provider, child) { return Expanded( child: Container( height: 50, @@ -286,7 +286,13 @@ class _HomeScreenState extends State { ), ) : provider.bestdeal.isEmpty - ? Center(child: Text('No products available')) + ? Center( + child: DataNotFound( + imagePath: 'assets/images/cart.jpg', + message: "", + width: 300.w, + height: 300.h, + )) : SizedBox( height: MediaQuery.of(context).size.height * 0.28, child: ListView.builder( @@ -299,17 +305,16 @@ class _HomeScreenState extends State { return InkWell( onTap: () { - context.push(MyRoutes.PRODUCTDETAILS, + context.push( + MyRoutes.PRODUCTDETAILS, // extra: bestdealproduct.id - extra: { - "id":bestdealproduct.id, - "quantity": 0, - "price": "0", - }, - - - ); + extra: { + "id": bestdealproduct.id, + "quantity": 0, + "price": "0", + }, + ); }, child: Padding( padding: const EdgeInsets.only( @@ -687,15 +692,16 @@ class _HomeScreenState extends State { var product = provider.homeproducts[index]; return InkWell( onTap: () { - context.push(MyRoutes.PRODUCTDETAILS, - // extra: product.id - - extra: { - "id":product.id, - "quantity": 0, - "price": "0", - }, - ); + context.push( + MyRoutes.PRODUCTDETAILS, + // extra: product.id + + extra: { + "id": product.id, + "quantity": 0, + "price": "0", + }, + ); }, child: SizedBox( child: Column( diff --git a/lib/src/ui/myOrder/my_order.dart b/lib/src/ui/myOrder/my_order.dart index f41333c..565af21 100644 --- a/lib/src/ui/myOrder/my_order.dart +++ b/lib/src/ui/myOrder/my_order.dart @@ -1,9 +1,11 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/svg.dart'; import 'package:go_router/go_router.dart'; import 'package:grocery_app/src/common_widget/network_image.dart'; import 'package:grocery_app/src/core/routes/routes.dart'; import 'package:grocery_app/src/logic/provider/order_provider.dart'; +import 'package:grocery_app/src/ui/data_notfound.dart'; import 'package:grocery_app/utils/constants/assets_constant.dart'; import 'package:grocery_app/utils/constants/color_constant.dart'; import 'package:grocery_app/utils/extensions/extensions.dart'; @@ -73,7 +75,13 @@ class _MyOrderScreenState extends State { } if (orderProvider.orderList.isEmpty) { - return Center(child: Text('No orders found!')); + return Center( + child: DataNotFound( + imagePath: 'assets/images/wishlist.jpg', + message: "No Order Available! ", + // width: 200.w, + // height: 200.h, + )); } return Column( diff --git a/lib/src/ui/profilepage/profile_screen.dart b/lib/src/ui/profilepage/profile_screen.dart index 45eb98a..abdd1cc 100644 --- a/lib/src/ui/profilepage/profile_screen.dart +++ b/lib/src/ui/profilepage/profile_screen.dart @@ -1,4 +1,7 @@ +import 'package:art_sweetalert/art_sweetalert.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:gap/gap.dart'; import 'package:go_router/go_router.dart'; import 'package:grocery_app/src/common_widget/network_image.dart'; import 'package:grocery_app/src/core/routes/routes.dart'; @@ -12,10 +15,13 @@ import 'package:grocery_app/src/ui/mapscreen/map_screen.dart'; import 'package:grocery_app/src/ui/message/message_screen.dart'; import 'package:grocery_app/src/ui/notification/notification_screen.dart'; import 'package:grocery_app/src/ui/rating_review/rating_review_screen.dart'; -import 'package:grocery_app/src/ui/static_page/static_page_screen.dart'; +import 'package:grocery_app/src/ui/static_page/tersandconditions.dart'; +import 'package:grocery_app/src/ui/widgets/custom_text_field.dart'; +import 'package:grocery_app/src/ui/widgets/elevated_button.dart'; import 'package:grocery_app/utils/constants/color_constant.dart'; import 'package:grocery_app/utils/constants/shared_pref_utils.dart'; import 'package:grocery_app/utils/constants/string_constant.dart'; +import 'package:grocery_app/utils/extensions/extensions.dart'; import 'package:grocery_app/utils/extensions/uicontext.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:provider/provider.dart'; @@ -45,6 +51,21 @@ class _ProfileScreenState extends State { APPSTRING.userLastName = (await SharedPrefUtils.getLastName())!; } + final _formKey = GlobalKey(); + final TextEditingController _passwordController = TextEditingController(); + final TextEditingController _confirmPasswordController = + TextEditingController(); + + bool _isPasswordVisible = false; + bool _isConfirmPasswordVisible = false; + + @override + void dispose() { + _passwordController.dispose(); + _confirmPasswordController.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { print("jdfgkjhgjh ${APPSTRING.userProfile}"); @@ -181,6 +202,9 @@ class _ProfileScreenState extends State { trailing: Icon(MdiIcons.chevronRight), ), ListTile( + onTap: () { + _showBottomSheet(context); + }, leading: Icon(MdiIcons.lockOutline), title: const Text('Change Password'), trailing: Icon(MdiIcons.chevronRight), @@ -244,13 +268,7 @@ class _ProfileScreenState extends State { ListTile( onTap: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) { - return const StaticPage( - title: "Privacy Policy", - ); - }, - )); + context.push(MyRoutes.PRIVACY); }, leading: Icon(MdiIcons.shieldCheckOutline), title: const Text('Privacy Policy'), @@ -258,13 +276,7 @@ class _ProfileScreenState extends State { ), ListTile( onTap: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) { - return const StaticPage( - title: "Terms & Conditions", - ); - }, - )); + context.push(MyRoutes.TERMANDCONDITIONS); }, leading: Icon(MdiIcons.noteTextOutline), title: const Text('Term & Conditions'), @@ -317,4 +329,132 @@ class _ProfileScreenState extends State { ), ); } + + // Function to show the Bottom Sheet + void _showBottomSheet(BuildContext context) { + showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return Container( + decoration: BoxDecoration( + border: Border.all(color: context.appColor.greyColor400), + color: context.appColor.whiteColor, + borderRadius: BorderRadius.all(Radius.circular(5.0)), + ), + padding: EdgeInsets.all(20.w), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Centered App Logo + + Align( + alignment: Alignment.center, + child: Text('Change Password', style: context.subTitleStyle), + ), + + Align( + alignment: Alignment.center, + child: Container( + width: 300, + child: Text('Enter your new password', + textAlign: TextAlign.center, + style: + context.subTitleTextStyle.copyWith(fontSize: 13.sp)), + ), + ), + Form( + key: _formKey, + child: Column( + children: [ + // Password Field + CustomTextField( + controller: _passwordController, + obscureText: !_isPasswordVisible, + validator: (val) { + if (val == null || val.isEmpty) { + return "Please enter a password"; + } else if (val.length < 6) { + return "Password must be at least 6 characters long"; + } + return null; + }, + maxLength: 64, + counterWidget: const Offstage(), + hintText: "Enter password", + fillColor: context.appColor.greyColor100, + suffix: IconButton( + icon: Icon( + _isPasswordVisible + ? Icons.visibility + : Icons.visibility_off, + ), + onPressed: () { + setState(() { + _isPasswordVisible = !_isPasswordVisible; + }); + }, + ), + ), + Gap(10.h), + + // Confirm Password Field + CustomTextField( + controller: _confirmPasswordController, + obscureText: !_isConfirmPasswordVisible, + validator: (val) { + if (val == null || val.isEmpty) { + return "Please confirm your password"; + } else if (val != _passwordController.text) { + return "Passwords do not match"; + } + return null; + }, + maxLength: 64, + counterWidget: const Offstage(), + hintText: "Confirm password", + fillColor: context.appColor.greyColor100, + suffix: IconButton( + icon: Icon( + _isConfirmPasswordVisible + ? Icons.visibility + : Icons.visibility_off, + ), + onPressed: () { + setState(() { + _isConfirmPasswordVisible = + !_isConfirmPasswordVisible; + }); + }, + ), + ), + ], + ), + ), + Gap(20.h), + Center( + child: SizedBox( + child: SizedBox( + width: double.infinity, + child: ButtonElevated( + text: 'Change Password', + onPressed: () { + Navigator.pop(context); + ArtSweetAlert.show( + context: context, + artDialogArgs: ArtDialogArgs( + type: ArtSweetAlertType.success, + title: "Password Reset Successful", + text: "")); + }, + backgroundColor: context.appColor.primarycolor), + ), + ), + ), + Gap(10.h), + ], + ), + ); + }, + ); + } } diff --git a/lib/src/ui/static_page/privacyandpolicy.dart b/lib/src/ui/static_page/privacyandpolicy.dart new file mode 100644 index 0000000..e9d33e0 --- /dev/null +++ b/lib/src/ui/static_page/privacyandpolicy.dart @@ -0,0 +1,137 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:grocery_app/utils/extensions/extensions.dart'; +import 'package:provider/provider.dart'; +import 'package:gap/gap.dart'; + +class PrivacyPolicy extends StatelessWidget { + const PrivacyPolicy({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios_rounded), + onPressed: () { + Navigator.pop(context); // Handle back button functionality + }, + ), + title: Text( + 'Privacy & Policy', + style: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + body: Padding( + padding: EdgeInsets.all(16.w), + child: ListView( + children: [ + _buildSectionTitle('1. General Terms'), + _buildSectionContent( + 'Welcome to Frontshop Emporium! We’re delighted to have you here. By accessing or using our platform, ' + 'we kindly ask that you review and agree to our terms and conditions. These ensure a safe and seamless ' + 'experience for everyone. If you have any concerns or do not agree with these terms, we respect your ' + 'choice to refrain from using our platform. Thank you for understanding!', + ), + _buildSectionTitle('2. User Terms'), + _buildSubSectionTitle('Eligibility'), + _buildSectionContent( + '• Users must provide accurate and complete information during registration.', + ), + _buildSubSectionTitle('User Responsibilities'), + _buildSectionContent( + '• Ensure your account details are secure. You are responsible for all activities under your account.\n' + '• Use the platform in compliance with all applicable laws and regulations.\n' + '• Do not engage in fraudulent, abusive, or harmful activities, including posting inappropriate content ' + 'or exploiting platform features.', + ), + _buildSubSectionTitle('Order and Payment'), + _buildSectionContent( + '• Orders are confirmed only upon payment.\n' + '• Prices, discounts, and offers are subject to change without notice.', + ), + _buildSectionTitle('3. Vendor Terms'), + _buildSubSectionTitle('Registration and Eligibility'), + _buildSectionContent( + '• Vendors must provide valid business details and adhere to local commerce regulations.\n' + '• Vendors must be legally registered businesses and provide necessary documentation (e.g., business ' + 'licenses, tax identification). The Company reserves the right to approve or deny vendor applications.\n' + '• Both parties agree to keep proprietary information confidential. Vendor information will not be shared ' + 'without consent, except as required by law.', + ), + _buildSubSectionTitle('Vendor Responsibilities'), + _buildSectionContent( + '• Maintain accurate product descriptions, prices, and inventory levels.\n' + '• Ensure timely dispatch and delivery of products. Resolve user complaints promptly.\n' + '• Vendors must ensure that all products meet quality and safety standards.', + ), + _buildSectionTitle('4. Delivery Partner Terms'), + _buildSubSectionTitle('Eligibility'), + _buildSectionContent( + '• Delivery Partners must provide valid identification. Delivery Partners must be legally registered entities ' + 'or individuals with appropriate licenses and follow all traffic rules and regulations.', + ), + _buildSectionTitle('5. Privacy Policy'), + _buildSectionContent( + 'Frontshop Emporium is committed to protecting your privacy.\n' + '• We do not sell your data to third parties.\n' + '• Data may be shared with service providers, delivery partners, and legal authorities as necessary.', + ), + _buildSectionTitle('6. Refund Policy'), + _buildSectionContent( + '• Products are eligible for a refund if they are defective, damaged during delivery, or not as described.\n' + '• Requests must be initiated within 7 days of receiving the product.', + ), + _buildSectionTitle('7. Support Policy'), + _buildSectionContent( + '• For assistance, contact our support team via email or live chat available on the platform.\n' + '• Support hours: Monday to Friday, 9 AM – 6 PM (local time).', + ), + SizedBox(height: 20), + + Gap(20.h), + + // Continue Button + Gap(20.h), + ], + ), + ), + ); + } +} + +Widget _buildSectionTitle(String title) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Text( + title, + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + ); +} + +Widget _buildSubSectionTitle(String title) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4.0), + child: Text( + title, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), + ), + ); +} + +Widget _buildSectionContent(String content) { + return Padding( + padding: const EdgeInsets.only(bottom: 8.0), + child: Text( + content, + style: TextStyle(fontSize: 14, height: 1.5), + ), + ); +} diff --git a/lib/src/ui/static_page/static_page_screen.dart b/lib/src/ui/static_page/static_page_screen.dart deleted file mode 100644 index ad6b998..0000000 --- a/lib/src/ui/static_page/static_page_screen.dart +++ /dev/null @@ -1,44 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:grocery_app/utils/constants/assets_constant.dart'; - -class StaticPage extends StatefulWidget { - final String title; - const StaticPage({super.key, required this.title}); - - @override - State createState() => _StaticPageState(); -} - -class _StaticPageState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - centerTitle: true, - leading: Center( - child: SizedBox( - height: 20, - width: 20, - child: InkWell( - onTap: () { - Navigator.of(context).pop(); - }, - child: SvgPicture.asset( - APPASSETS.back, - height: 20, - width: 20, - )), - ), - ), - title: Text( - widget.title, - style: const TextStyle( - fontSize: 20, - fontWeight: FontWeight.w700, - ), - ), - ), - ); - } -} diff --git a/lib/src/ui/static_page/tersandconditions.dart b/lib/src/ui/static_page/tersandconditions.dart new file mode 100644 index 0000000..bfe2136 --- /dev/null +++ b/lib/src/ui/static_page/tersandconditions.dart @@ -0,0 +1,137 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:grocery_app/utils/extensions/extensions.dart'; +import 'package:provider/provider.dart'; +import 'package:gap/gap.dart'; + +class TermsAndConditionsScreen extends StatelessWidget { + const TermsAndConditionsScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios_rounded), + onPressed: () { + Navigator.pop(context); // Handle back button functionality + }, + ), + title: Text( + 'Terms & Conditions', + style: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.bold, + ), + ), + ), + body: Padding( + padding: EdgeInsets.all(16.w), + child: ListView( + children: [ + _buildSectionTitle('1. General Terms'), + _buildSectionContent( + 'Welcome to Frontshop Emporium! We’re delighted to have you here. By accessing or using our platform, ' + 'we kindly ask that you review and agree to our terms and conditions. These ensure a safe and seamless ' + 'experience for everyone. If you have any concerns or do not agree with these terms, we respect your ' + 'choice to refrain from using our platform. Thank you for understanding!', + ), + _buildSectionTitle('2. User Terms'), + _buildSubSectionTitle('Eligibility'), + _buildSectionContent( + '• Users must provide accurate and complete information during registration.', + ), + _buildSubSectionTitle('User Responsibilities'), + _buildSectionContent( + '• Ensure your account details are secure. You are responsible for all activities under your account.\n' + '• Use the platform in compliance with all applicable laws and regulations.\n' + '• Do not engage in fraudulent, abusive, or harmful activities, including posting inappropriate content ' + 'or exploiting platform features.', + ), + _buildSubSectionTitle('Order and Payment'), + _buildSectionContent( + '• Orders are confirmed only upon payment.\n' + '• Prices, discounts, and offers are subject to change without notice.', + ), + _buildSectionTitle('3. Vendor Terms'), + _buildSubSectionTitle('Registration and Eligibility'), + _buildSectionContent( + '• Vendors must provide valid business details and adhere to local commerce regulations.\n' + '• Vendors must be legally registered businesses and provide necessary documentation (e.g., business ' + 'licenses, tax identification). The Company reserves the right to approve or deny vendor applications.\n' + '• Both parties agree to keep proprietary information confidential. Vendor information will not be shared ' + 'without consent, except as required by law.', + ), + _buildSubSectionTitle('Vendor Responsibilities'), + _buildSectionContent( + '• Maintain accurate product descriptions, prices, and inventory levels.\n' + '• Ensure timely dispatch and delivery of products. Resolve user complaints promptly.\n' + '• Vendors must ensure that all products meet quality and safety standards.', + ), + _buildSectionTitle('4. Delivery Partner Terms'), + _buildSubSectionTitle('Eligibility'), + _buildSectionContent( + '• Delivery Partners must provide valid identification. Delivery Partners must be legally registered entities ' + 'or individuals with appropriate licenses and follow all traffic rules and regulations.', + ), + _buildSectionTitle('5. Privacy Policy'), + _buildSectionContent( + 'Frontshop Emporium is committed to protecting your privacy.\n' + '• We do not sell your data to third parties.\n' + '• Data may be shared with service providers, delivery partners, and legal authorities as necessary.', + ), + _buildSectionTitle('6. Refund Policy'), + _buildSectionContent( + '• Products are eligible for a refund if they are defective, damaged during delivery, or not as described.\n' + '• Requests must be initiated within 7 days of receiving the product.', + ), + _buildSectionTitle('7. Support Policy'), + _buildSectionContent( + '• For assistance, contact our support team via email or live chat available on the platform.\n' + '• Support hours: Monday to Friday, 9 AM – 6 PM (local time).', + ), + SizedBox(height: 20), + + Gap(20.h), + + // Continue Button + Gap(20.h), + ], + ), + ), + ); + } +} + +Widget _buildSectionTitle(String title) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Text( + title, + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + ); +} + +Widget _buildSubSectionTitle(String title) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4.0), + child: Text( + title, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), + ), + ); +} + +Widget _buildSectionContent(String content) { + return Padding( + padding: const EdgeInsets.only(bottom: 8.0), + child: Text( + content, + style: TextStyle(fontSize: 14, height: 1.5), + ), + ); +} diff --git a/lib/src/ui/widgets/custom_text_field.dart b/lib/src/ui/widgets/custom_text_field.dart new file mode 100644 index 0000000..3c97262 --- /dev/null +++ b/lib/src/ui/widgets/custom_text_field.dart @@ -0,0 +1,155 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:grocery_app/utils/extensions/extensions.dart'; + +class CustomTextField extends StatelessWidget { + final TextEditingController? controller; + final double? height; + final double? width; + final Widget? prefix; + final Widget? suffix; + final String? hintText; + final String? labelText; + final TextInputType? keyBoardType; + final String? Function(String?)? validator; + final bool obscureText; + final TextInputAction? textInputAction; + final bool readOnly; + final bool isEnabledBorder; + final void Function(String)? onChanged; + final void Function(String)? onFieldSubmitted; + final void Function()? onTapOutside; + final void Function()? onTap; + final TextStyle? textStyle; + final TextStyle? hintStyle; + final double? borderRadius; + final Color? fillColor; + final Color? borderColor; + final InputBorder? enabledBorder; + final int? maxLines; + final int? maxLength; + final List? inputFormatters; + final TextAlign textAlign; + final double? horizontalContentPadding; + final double? verticalContentPadding; + final FocusNode? focusNode; + final Function()? functionCallOutsideOfTextfield; + final Widget? counterWidget; + + const CustomTextField({ + Key? key, + this.controller, + this.hintText, + this.height, + this.width, + this.prefix, + this.suffix, + this.validator, + this.labelText, + this.keyBoardType, + this.obscureText = false, + this.onTapOutside, + this.textInputAction = TextInputAction.next, + this.readOnly = false, + this.onChanged, + this.onFieldSubmitted, + this.onTap, + this.textStyle, + this.hintStyle, + this.borderRadius, + this.fillColor, + this.borderColor, + this.enabledBorder, + this.isEnabledBorder = false, + this.maxLines = 1, + this.maxLength, + this.inputFormatters, + this.textAlign = TextAlign.start, + this.horizontalContentPadding, + this.verticalContentPadding, + this.focusNode, + this.functionCallOutsideOfTextfield, + this.counterWidget, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return TextFormField( + focusNode: focusNode ?? FocusNode(), + textAlign: textAlign, + maxLines: maxLines, + maxLength: maxLength, + scrollPhysics: AlwaysScrollableScrollPhysics(), + scrollPadding: EdgeInsets.only( + bottom: MediaQuery.of(context).viewInsets.bottom + 180), + readOnly: readOnly, + inputFormatters: inputFormatters, + validator: validator, + controller: controller, + style: textStyle ?? context.bodyTxtStyle, + obscureText: obscureText, + keyboardType: keyBoardType, + decoration: InputDecoration( + counter: counterWidget, + hintStyle: hintStyle ?? + context.subTitleTxtStyleblack.copyWith( + color: context.appColor.lightBlackColor, + ), + labelStyle: context.subTitleTxtStyleblack + .copyWith(color: context.appColor.blackColor, fontSize: 16.sp), + contentPadding: EdgeInsets.symmetric( + horizontal: horizontalContentPadding ?? 10.w, + vertical: verticalContentPadding ?? 10.h, + ), + fillColor: fillColor ?? context.appColor.greyColor200, + filled: true, + labelText: labelText, + hintText: hintText, + prefixIcon: prefix, + suffixIcon: suffix, + border: isEnabledBorder + ? enabledBorder + : OutlineInputBorder( + borderSide: BorderSide( + color: borderColor ?? context.appColor.greyColor400, + ), + borderRadius: BorderRadius.circular(borderRadius ?? 4.r), + ), + enabledBorder: isEnabledBorder + ? enabledBorder ?? + UnderlineInputBorder( + borderSide: BorderSide( + color: borderColor ?? context.appColor.greyColor400, + ), + ) + : OutlineInputBorder( + borderSide: BorderSide( + color: borderColor ?? context.appColor.greyColor400, + ), + borderRadius: BorderRadius.circular(borderRadius ?? 4.r), + ), + focusedBorder: isEnabledBorder + ? UnderlineInputBorder( + borderSide: BorderSide( + color: borderColor ?? context.appColor.greyColor400, + ), + ) + : OutlineInputBorder( + borderSide: BorderSide( + color: borderColor ?? context.appColor.greyColor400, + ), + borderRadius: BorderRadius.circular(borderRadius ?? 4.r), + ), + ), + textInputAction: textInputAction, + onTapOutside: (value) { + onTapOutside ?? (); + FocusScope.of(context).unfocus(); + }, + onChanged: onChanged, + onFieldSubmitted: onFieldSubmitted, + onTap: onTap, + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index a814223..8f08b68 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -25,6 +25,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.6.0" + art_sweetalert: + dependency: "direct main" + description: + name: art_sweetalert + sha256: "64dd68fc8648197e2b8201b3d28e2e9ec41c0883a05e18be21386ec6435d2b54" + url: "https://pub.dev" + source: hosted + version: "0.0.5" async: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 7f10743..126585b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,6 +33,7 @@ dependencies: flutter_rating_stars: ^1.1.0 url_launcher: ^6.3.1 skeletonizer: ^1.4.3 + art_sweetalert: ^0.0.5