From ad5709e6bd66b0f41e23c705f7448352088d46ed Mon Sep 17 00:00:00 2001 From: "dinesh.patil" Date: Tue, 14 Oct 2025 17:58:35 +0530 Subject: [PATCH] added common app bar in edit_profile_view.dart and shifted every common packages to common_packages folder --- lib/common_packages/app_bar.dart | 23 ++++++++++++------- .../custom_expansion_tile.dart} | 0 .../custom_text.dart | 0 .../custom_textfield.dart | 2 +- lib/contact_us/contact_us_view.dart | 4 ++-- lib/edit_profile/edit_profile_view.dart | 21 ++++------------- lib/faq/faq_view.dart | 4 ++-- lib/home/views/home_page_view.dart | 2 +- lib/privacy/privacy_view.dart | 2 +- lib/profile/profile_page_view.dart | 21 +++-------------- .../terms_and_condition_view.dart | 2 +- 11 files changed, 30 insertions(+), 51 deletions(-) rename lib/{common_package/custom_expansiontile.dart => common_packages/custom_expansion_tile.dart} (100%) rename lib/{common_package => common_packages}/custom_text.dart (100%) rename lib/{common_package => common_packages}/custom_textfield.dart (96%) diff --git a/lib/common_packages/app_bar.dart b/lib/common_packages/app_bar.dart index 5a89d0f..3407327 100644 --- a/lib/common_packages/app_bar.dart +++ b/lib/common_packages/app_bar.dart @@ -1,9 +1,12 @@ import 'package:flutter/material.dart'; +import '../core/route_constants.dart'; + class CommonAppBar extends StatelessWidget { - const CommonAppBar({super.key, required this.isWhiteLogo}); + const CommonAppBar({super.key, required this.isWhiteLogo, required this.isProfilePage}); final bool isWhiteLogo; + final bool isProfilePage; @override Widget build(BuildContext context) { @@ -11,9 +14,8 @@ class CommonAppBar extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Image.asset( - isWhiteLogo ? "assets/logo/logo_city_cards_white.png" :"assets/logo/logo_city_cards.png", - height: 50), + scale: 4,), Row( children: [ Container( @@ -28,11 +30,16 @@ class CommonAppBar extends StatelessWidget { ), ), const SizedBox(width: 8), - const CircleAvatar( - backgroundColor: Color(0xffFFDFDF), - backgroundImage: - AssetImage("assets/images/profile_img.png"), - ), + if(!isProfilePage) + GestureDetector( + onTap: (){ + Navigator.pushNamed(context, RouteConstants.profile); + }, + child: CircleAvatar( + backgroundColor: Color(0xffFFDFDF), + backgroundImage: + AssetImage("assets/images/profile_img.png")), + ), ], ), ], diff --git a/lib/common_package/custom_expansiontile.dart b/lib/common_packages/custom_expansion_tile.dart similarity index 100% rename from lib/common_package/custom_expansiontile.dart rename to lib/common_packages/custom_expansion_tile.dart diff --git a/lib/common_package/custom_text.dart b/lib/common_packages/custom_text.dart similarity index 100% rename from lib/common_package/custom_text.dart rename to lib/common_packages/custom_text.dart diff --git a/lib/common_package/custom_textfield.dart b/lib/common_packages/custom_textfield.dart similarity index 96% rename from lib/common_package/custom_textfield.dart rename to lib/common_packages/custom_textfield.dart index c524008..c8c358c 100644 --- a/lib/common_package/custom_textfield.dart +++ b/lib/common_packages/custom_textfield.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:citycards_customer/common_package/custom_text.dart'; +import 'package:citycards_customer/common_packages/custom_text.dart'; class CustomTextField extends StatelessWidget { final String label; diff --git a/lib/contact_us/contact_us_view.dart b/lib/contact_us/contact_us_view.dart index 653c4a0..6e5f1c2 100644 --- a/lib/contact_us/contact_us_view.dart +++ b/lib/contact_us/contact_us_view.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:citycards_customer/common_package/custom_text.dart'; -import 'package:citycards_customer/common_package/custom_textfield.dart'; +import 'package:citycards_customer/common_packages/custom_text.dart'; +import 'package:citycards_customer/common_packages/custom_textfield.dart'; class ContactUsPage extends StatelessWidget { const ContactUsPage({super.key}); diff --git a/lib/edit_profile/edit_profile_view.dart b/lib/edit_profile/edit_profile_view.dart index 52c3910..048d382 100644 --- a/lib/edit_profile/edit_profile_view.dart +++ b/lib/edit_profile/edit_profile_view.dart @@ -1,6 +1,7 @@ -import 'package:citycards_customer/common_package/custom_textfield.dart'; +import 'package:citycards_customer/common_packages/app_bar.dart'; +import 'package:citycards_customer/common_packages/custom_textfield.dart'; import 'package:flutter/material.dart'; -import 'package:citycards_customer/common_package/custom_text.dart'; +import 'package:citycards_customer/common_packages/custom_text.dart'; class EditProfilePage extends StatelessWidget { const EditProfilePage({super.key}); @@ -22,21 +23,7 @@ class EditProfilePage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ // Header - Container( - padding: const EdgeInsets.only(bottom: 10), - decoration: const BoxDecoration( - border: Border( - bottom: BorderSide(color: Color(0xFFD9D9D9), width: 0.7), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Image.asset("assets/logo/logo_city_cards.png", scale: 4), - Image.asset("assets/icons/shopping_cart.png", scale: 4), - ], - ), - ), + CommonAppBar(isWhiteLogo: false, isProfilePage: true), const SizedBox(height: 22), // Back + title diff --git a/lib/faq/faq_view.dart b/lib/faq/faq_view.dart index 3462164..e649e87 100644 --- a/lib/faq/faq_view.dart +++ b/lib/faq/faq_view.dart @@ -1,5 +1,5 @@ -import 'package:citycards_customer/common_package/custom_expansiontile.dart'; -import 'package:citycards_customer/common_package/custom_text.dart'; +import 'package:citycards_customer/common_packages/custom_expansion_tile.dart'; +import 'package:citycards_customer/common_packages/custom_text.dart'; import 'package:flutter/material.dart'; class FaqPage extends StatelessWidget { diff --git a/lib/home/views/home_page_view.dart b/lib/home/views/home_page_view.dart index 4ab37ca..24d65c4 100644 --- a/lib/home/views/home_page_view.dart +++ b/lib/home/views/home_page_view.dart @@ -115,7 +115,7 @@ class _HomePageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CommonAppBar(isWhiteLogo: false), + CommonAppBar(isWhiteLogo: false , isProfilePage: false), const SizedBox(height: 140), const Text( "CityCards.\nSee More,\nSpend Less.", diff --git a/lib/privacy/privacy_view.dart b/lib/privacy/privacy_view.dart index 00f2332..b3bd19e 100644 --- a/lib/privacy/privacy_view.dart +++ b/lib/privacy/privacy_view.dart @@ -1,4 +1,4 @@ -import 'package:citycards_customer/common_package/custom_text.dart'; +import 'package:citycards_customer/common_packages/custom_text.dart'; import 'package:flutter/material.dart'; class PrivacyPolicyPage extends StatelessWidget { diff --git a/lib/profile/profile_page_view.dart b/lib/profile/profile_page_view.dart index cc72e69..8f60fce 100644 --- a/lib/profile/profile_page_view.dart +++ b/lib/profile/profile_page_view.dart @@ -1,4 +1,5 @@ -import 'package:citycards_customer/common_package/custom_text.dart'; +import 'package:citycards_customer/common_packages/app_bar.dart'; +import 'package:citycards_customer/common_packages/custom_text.dart'; import 'package:citycards_customer/core/route_constants.dart'; import 'package:flutter/material.dart'; @@ -15,24 +16,8 @@ class ProfilePage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( - padding: EdgeInsets.only(bottom: 10), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide(color: Color(0xFFD9D9D9), width: .7), - ), - ), - - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Image.asset("assets/logo/logo_city_cards.png", scale: 4), - Image.asset("assets/icons/shopping_cart.png", scale: 4), - ], - ), - ), + CommonAppBar(isWhiteLogo: false, isProfilePage: true), SizedBox(height: 22), - Row( children: [ GestureDetector( diff --git a/lib/terms_and_condition/terms_and_condition_view.dart b/lib/terms_and_condition/terms_and_condition_view.dart index b648e63..52264e8 100644 --- a/lib/terms_and_condition/terms_and_condition_view.dart +++ b/lib/terms_and_condition/terms_and_condition_view.dart @@ -1,4 +1,4 @@ -import 'package:citycards_customer/common_package/custom_text.dart'; +import 'package:citycards_customer/common_packages/custom_text.dart'; import 'package:flutter/material.dart'; class TermsAndCondition extends StatelessWidget {