From f0cde5d8273a9c59fe51b382195974fc9dce6afa Mon Sep 17 00:00:00 2001 From: Vinayakkadge04 Date: Wed, 15 Oct 2025 12:21:55 +0530 Subject: [PATCH] Updated Home & Profile Screens by using screen_util package --- lib/common_packages/app_bar.dart | 5 +- lib/common_packages/custom_bottom_navbar.dart | 28 +-- lib/common_packages/custom_text.dart | 1 + lib/common_packages/custom_textfield.dart | 32 ++-- .../language_selection_bottomsheet.dart | 40 ++--- lib/contact_us/contact_us_view.dart | 110 ++++++------ lib/edit_profile/edit_profile_view.dart | 86 +++++----- lib/faq/faq_view.dart | 43 ++--- lib/home/views/explore_cities_card.dart | 61 +++---- lib/home/views/first_time_user_home_page.dart | 159 ++++++++---------- lib/main.dart | 40 +++-- lib/privacy/privacy_view.dart | 24 ++- lib/profile/profile_page_view.dart | 71 ++++---- .../terms_and_condition_view.dart | 24 ++- pubspec.lock | 8 + pubspec.yaml | 1 + 16 files changed, 359 insertions(+), 374 deletions(-) diff --git a/lib/common_packages/app_bar.dart b/lib/common_packages/app_bar.dart index 3407327..3744d41 100644 --- a/lib/common_packages/app_bar.dart +++ b/lib/common_packages/app_bar.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../core/route_constants.dart'; @@ -26,10 +27,10 @@ class CommonAppBar extends StatelessWidget { ), child: Image.asset( "assets/icons/shopping_cart.png", - height: 20, + height: 20.h, ), ), - const SizedBox(width: 8), + SizedBox(width: 8.w), if(!isProfilePage) GestureDetector( onTap: (){ diff --git a/lib/common_packages/custom_bottom_navbar.dart b/lib/common_packages/custom_bottom_navbar.dart index 06b1865..912ca61 100644 --- a/lib/common_packages/custom_bottom_navbar.dart +++ b/lib/common_packages/custom_bottom_navbar.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../common_bloc/bottom_navigation_bloc.dart'; class CustomBottomNavBar extends StatelessWidget { @@ -20,12 +21,12 @@ class CustomBottomNavBar extends StatelessWidget { boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.1), - blurRadius: 8, + blurRadius: 8.r, offset: const Offset(0, -2), ), ], ), - padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16), + padding: EdgeInsets.symmetric(vertical: 14.h, horizontal: 16.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, @@ -65,13 +66,16 @@ class CustomBottomNavBar extends StatelessWidget { ); } - Widget _buildNavItem(BuildContext context, { + Widget _buildNavItem( + BuildContext context, { required int index, required String iconPath, required String label, required bool isActive, }) { - final color = isActive ? const Color(0xFFBB474A) : Color(0xFFBB474A).withOpacity(0.6); + final color = isActive + ? const Color(0xFFBB474A) + : Color(0xFFBB474A).withOpacity(0.6); return GestureDetector( onTap: () => context.read().add(NavigationTabChanged(index)), @@ -80,23 +84,23 @@ class CustomBottomNavBar extends StatelessWidget { children: [ if (isActive) Container( - margin: const EdgeInsets.only(bottom: 4), - height: 4, - width: 50, + margin: EdgeInsets.only(bottom: 4.h), + height: 4.h, + width: 50.w, decoration: BoxDecoration( color: color, - borderRadius: BorderRadius.circular(2), + borderRadius: BorderRadius.circular(2.r), ), ) else - const SizedBox(height: 7), + SizedBox(height: 7.h), Image.asset(iconPath, scale: 4, color: color), - const SizedBox(height: 4), + SizedBox(height: 4.h), Text( label, style: TextStyle( color: color, - fontSize: 12, + fontSize: 12.sp, fontWeight: isActive ? FontWeight.w500 : FontWeight.w500, ), ), @@ -104,4 +108,4 @@ class CustomBottomNavBar extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/common_packages/custom_text.dart b/lib/common_packages/custom_text.dart index 6602eea..9bdbdce 100644 --- a/lib/common_packages/custom_text.dart +++ b/lib/common_packages/custom_text.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class CustomText extends StatelessWidget { final FontWeight? weight; diff --git a/lib/common_packages/custom_textfield.dart b/lib/common_packages/custom_textfield.dart index c8c358c..7cf0843 100644 --- a/lib/common_packages/custom_textfield.dart +++ b/lib/common_packages/custom_textfield.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:citycards_customer/common_packages/custom_text.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class CustomTextField extends StatelessWidget { final String label; @@ -12,46 +13,41 @@ class CustomTextField extends StatelessWidget { required this.label, required this.hint, required this.controller, - this.maxLines =1 + this.maxLines = 1, }); @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.only(bottom: 12), + return Padding( + padding: EdgeInsets.only(bottom: 12.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CustomText(text: label, size: 14), - const SizedBox(height: 6), + CustomText(text: label, size: 14.sp), + SizedBox(height: 6.h), SizedBox( - height: maxLines == 1 ? 42 : null, + height: maxLines == 1 ? 42.h : null, child: TextField( controller: controller, maxLines: maxLines, decoration: InputDecoration( hintText: hint, - hintStyle: const TextStyle( - fontSize: 12, - color: Color(0xFF8E8E8E), - ), + hintStyle: TextStyle(fontSize: 12.sp, color: Color(0xFF8E8E8E)), filled: true, fillColor: const Color(0xFFFFF5F5), - contentPadding: const EdgeInsets.symmetric( - horizontal: 24, - ), + contentPadding: EdgeInsets.symmetric(horizontal: 24.w), enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(8.r), borderSide: BorderSide( color: Color(0xBBC83B61).withOpacity(0.4), - width: .4, + width: .4.w, ), ), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: const BorderSide( + borderRadius: BorderRadius.circular(8.r), + borderSide: BorderSide( color: Color(0xFFF95F62), - width: 1, + width: 1.w, ), ), ), diff --git a/lib/common_packages/language_selection_bottomsheet.dart b/lib/common_packages/language_selection_bottomsheet.dart index 40c79f8..a31f758 100644 --- a/lib/common_packages/language_selection_bottomsheet.dart +++ b/lib/common_packages/language_selection_bottomsheet.dart @@ -2,6 +2,7 @@ import 'package:citycards_customer/common_bloc/language_selection_bloc.dart'; import 'package:citycards_customer/common_packages/custom_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class LanguageSelectionBottomsheet extends StatelessWidget { LanguageSelectionBottomsheet({super.key}); @@ -19,54 +20,51 @@ class LanguageSelectionBottomsheet extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16), + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 16.h), child: Column( mainAxisSize: MainAxisSize.min, children: [ Container( - width: 40, - height: 4, + width: 40.w, + height: 4.h, decoration: BoxDecoration( color: Color(0xFF2D3134), - borderRadius: BorderRadius.circular(4), + borderRadius: BorderRadius.circular(4.r), ), ), - const SizedBox(height: 20), + SizedBox(height: 20.h), Align( alignment: Alignment.topLeft, - child: const Text( + child: Text( "Change Language", - style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 18.sp, fontWeight: FontWeight.w500), ), ), - const SizedBox(height: 22), + SizedBox(height: 22.h), TextField( controller: searchController, decoration: InputDecoration( hintText: "Search Languages", hintStyle: TextStyle( - fontSize: 14, + fontSize: 14.sp, color: Color(0xBBC83B61).withOpacity(0.4), ), suffixIcon: Image.asset("assets/icons/search.png", scale: 4), - contentPadding: const EdgeInsets.symmetric(horizontal: 24), + contentPadding: EdgeInsets.symmetric(horizontal: 24.w), enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(10.r), borderSide: BorderSide( color: Color(0xBBC83B61).withOpacity(0.4), - width: .4, + width: .4.w, ), ), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(10), - borderSide: const BorderSide( - color: Color(0xFFF95F62), - width: 1, - ), + borderRadius: BorderRadius.circular(10.r), + borderSide: BorderSide(color: Color(0xFFF95F62), width: 1.w), ), ), ), - const SizedBox(height: 12), + SizedBox(height: 12.h), BlocBuilder( builder: (context, state) { @@ -97,8 +95,10 @@ class LanguageSelectionBottomsheet extends StatelessWidget { ), title: CustomText( text: item, - size: 16, - color: state.selectedLanguage == item ? Color(0xFFF95F62) : Color(0xFF000000).withOpacity(.6), + size: 16.sp, + color: state.selectedLanguage == item + ? Color(0xFFF95F62) + : Color(0xFF000000).withOpacity(.6), ), ); }, diff --git a/lib/contact_us/contact_us_view.dart b/lib/contact_us/contact_us_view.dart index fc5d4f6..ef83351 100644 --- a/lib/contact_us/contact_us_view.dart +++ b/lib/contact_us/contact_us_view.dart @@ -2,6 +2,7 @@ import 'package:citycards_customer/common_packages/app_bar.dart'; import 'package:flutter/material.dart'; import 'package:citycards_customer/common_packages/custom_text.dart'; import 'package:citycards_customer/common_packages/custom_textfield.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class ContactUsPage extends StatelessWidget { const ContactUsPage({super.key}); @@ -18,20 +19,15 @@ class ContactUsPage extends StatelessWidget { backgroundColor: Colors.white, body: SafeArea( child: SingleChildScrollView( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ // Header bar CommonAppBar(isWhiteLogo: false, isProfilePage: true), - SizedBox( - height: 12, - ), - Divider( - height: 1, - color: Color(0xFFD9D9D9), - ), - const SizedBox(height: 22), + SizedBox(height: 12.h), + Divider(height: 1.h, color: Color(0xFFD9D9D9)), + SizedBox(height: 22.h), // Back + Title Row( @@ -40,58 +36,58 @@ class ContactUsPage extends StatelessWidget { onTap: () { Navigator.pop(context); }, - child: Icon(Icons.arrow_back, size: 24), + child: Icon(Icons.arrow_back, size: 24.sp), ), - SizedBox(width: 8), + SizedBox(width: 8.w), Text( "Contact Us", - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500), + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w500, + ), ), ], ), - const SizedBox(height: 22), + SizedBox(height: 22.h), CustomText( text: "You can get in touch with us through the below platforms. Our team will contact you shortly", - size: 14, + size: 14.sp, color: Colors.black.withOpacity(.6), ), - const SizedBox(height: 20), + SizedBox(height: 20.h), // Customer Support Section Container( - padding: const EdgeInsets.symmetric( - horizontal: 10, - vertical: 16, - ), + padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 16.h), decoration: BoxDecoration( color: Color(0x00000005).withOpacity(.02), - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(12.r), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const CustomText( + CustomText( text: "Customer Support", - size: 18, + size: 18.sp, weight: FontWeight.w500, ), - const SizedBox(height: 16), + SizedBox(height: 16.h), _supportBox( icon: Icons.phone, title: "Contact Number", subtitle: "+1012 3456 789", action: "Tap to call", ), - const SizedBox(height: 12), + SizedBox(height: 12.h), _supportBox( icon: Icons.email_rounded, title: "Email", subtitle: "citycards24@gmail.com", action: "Tap to email", ), - const SizedBox(height: 12), + SizedBox(height: 12.h), _supportBox( icon: Icons.location_on, title: "Location", @@ -102,7 +98,7 @@ class ContactUsPage extends StatelessWidget { ], ), ), - const SizedBox(height: 24), + SizedBox(height: 24.h), // Text fields CustomTextField( @@ -133,10 +129,8 @@ class ContactUsPage extends StatelessWidget { controller: messageController, ), - // _descriptionField(messageController), - - const SizedBox(height: 24), + SizedBox(height: 24.h), // Submit Button SizedBox( @@ -145,20 +139,20 @@ class ContactUsPage extends StatelessWidget { style: ElevatedButton.styleFrom( backgroundColor: const Color(0xFFF95F62), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(38), + borderRadius: BorderRadius.circular(38.r), ), - padding: const EdgeInsets.symmetric(vertical: 6), + padding: EdgeInsets.symmetric(vertical: 6.h), ), onPressed: () {}, - child: const CustomText( + child: CustomText( text: "Submit Ticket", - size: 16, + size: 16.sp, weight: FontWeight.w500, color: Colors.white, ), ), ), - const SizedBox(height: 20), + SizedBox(height: 20.h), ], ), ), @@ -175,41 +169,41 @@ class ContactUsPage extends StatelessWidget { }) { return Container( width: double.infinity, - padding: const EdgeInsets.all(12), + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 12.h), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(8.r), border: Border.all(color: const Color(0xFFF95F62), width: 0.8), color: Colors.white, ), child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Icon(icon, color: const Color(0xFFF95F62), size: 32), - const SizedBox(width: 12), + Icon(icon, color: const Color(0xFFF95F62), size: 32.sp), + SizedBox(width: 12.w), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ CustomText( text: title, - size: 11, + size: 11.sp, weight: FontWeight.w600, color: Color(0x00000000).withOpacity(.6), ), - const SizedBox(height: 6), + SizedBox(height: 6.h), Text( subtitle, - style: const TextStyle( - fontSize: 14, + style: TextStyle( + fontSize: 14.sp, fontWeight: FontWeight.w400, color: Colors.black, ), ), - const SizedBox(height: 2), + SizedBox(height: 2.h), Text( action, style: TextStyle( - fontSize: 11, + fontSize: 11.sp, color: Color(0xFF000000).withOpacity(.4), fontWeight: FontWeight.w400, ), @@ -225,40 +219,34 @@ class ContactUsPage extends StatelessWidget { // --- Description Field --- Widget _descriptionField(TextEditingController controller) { return Padding( - padding: const EdgeInsets.only(bottom: 12, left: 12, right: 12), + padding: EdgeInsets.only(bottom: 12.h, left: 12.w, right: 12.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const CustomText(text: "Description", size: 14), - const SizedBox(height: 6), + CustomText(text: "Description", size: 14.sp), + SizedBox(height: 6.h), TextField( controller: controller, maxLines: 4, decoration: InputDecoration( hintText: "Write your message here", - hintStyle: const TextStyle( - fontSize: 12, - color: Color(0xFF8E8E8E), - ), + hintStyle: TextStyle(fontSize: 12.sp, color: Color(0xFF8E8E8E)), filled: true, fillColor: const Color(0xFFFFF5F5), - contentPadding: const EdgeInsets.symmetric( - horizontal: 24, - vertical: 12, + contentPadding: EdgeInsets.symmetric( + horizontal: 24.w, + vertical: 12.h, ), enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), + borderRadius: BorderRadius.circular(8.r), borderSide: BorderSide( color: const Color(0xBBC83B61).withOpacity(0.4), - width: .4, + width: .4.w, ), ), focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), - borderSide: const BorderSide( - color: Color(0xFFF95F62), - width: 1, - ), + borderRadius: BorderRadius.circular(8.r), + borderSide: BorderSide(color: Color(0xFFF95F62), width: 1.w), ), ), ), diff --git a/lib/edit_profile/edit_profile_view.dart b/lib/edit_profile/edit_profile_view.dart index e052655..0c692cc 100644 --- a/lib/edit_profile/edit_profile_view.dart +++ b/lib/edit_profile/edit_profile_view.dart @@ -2,6 +2,7 @@ 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_packages/custom_text.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class EditProfilePage extends StatelessWidget { const EditProfilePage({super.key}); @@ -18,67 +19,66 @@ class EditProfilePage extends StatelessWidget { backgroundColor: Colors.white, body: SafeArea( child: SingleChildScrollView( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ // Header CommonAppBar(isWhiteLogo: false, isProfilePage: true), - SizedBox( - height: 12, - ), - Divider( - height: 1, - color: Color(0xFFD9D9D9), - ), - const SizedBox(height: 22), + SizedBox(height: 12.h), + Divider(height: 1.h, color: Color(0xFFD9D9D9)), + SizedBox(height: 22.h), // Back + title Row( children: [ GestureDetector( - onTap: (){ - Navigator.pop(context); - }, - child: Icon(Icons.arrow_back, size: 24)), - SizedBox(width: 8), + onTap: () { + Navigator.pop(context); + }, + child: Icon(Icons.arrow_back, size: 24.sp), + ), + SizedBox(width: 8.w), Text( "Edit Profile", - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w500), + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w500, + ), ), ], ), - const SizedBox(height: 33), + SizedBox(height: 33.h), // Profile Image - const CircleAvatar( - radius: 38, + CircleAvatar( + radius: 38.r, backgroundImage: AssetImage("assets/images/profile_img.png"), ), - const SizedBox(height: 18), - const Text( + SizedBox(height: 18.h), + Text( "Change Profile Picture", style: TextStyle( - fontSize: 12, + fontSize: 12.sp, color: Color(0xFFF95F62), fontWeight: FontWeight.w400, ), ), - const SizedBox(height: 40), + SizedBox(height: 40.h), // Personal Information Align( alignment: Alignment.centerLeft, child: CustomText( text: "Personal Information", - size: 18, + size: 18.sp, weight: FontWeight.w500, ), ), - const SizedBox(height: 12), + SizedBox(height: 12.h), Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), + padding: EdgeInsets.symmetric(horizontal: 12.w), child: CustomTextField( label: "First Name", hint: "Enter your first name", @@ -86,7 +86,7 @@ class EditProfilePage extends StatelessWidget { ), ), Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), + padding: EdgeInsets.symmetric(horizontal: 12.w), child: CustomTextField( label: "Last Name", hint: "Enter your last name", @@ -94,7 +94,7 @@ class EditProfilePage extends StatelessWidget { ), ), Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), + padding: EdgeInsets.symmetric(horizontal: 12.w), child: CustomTextField( label: "Email", hint: "Enter your email address", @@ -102,7 +102,7 @@ class EditProfilePage extends StatelessWidget { ), ), Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), + padding: EdgeInsets.symmetric(horizontal: 12.w), child: CustomTextField( label: "Phone Number", hint: "Enter your phone number", @@ -110,21 +110,21 @@ class EditProfilePage extends StatelessWidget { ), ), - const SizedBox(height: 2), + SizedBox(height: 2.h), // Location Details Align( alignment: Alignment.centerLeft, child: CustomText( text: "Location Details", - size: 18, + size: 18.sp, weight: FontWeight.w500, ), ), - const SizedBox(height: 16), + SizedBox(height: 16.h), Padding( - padding: const EdgeInsets.symmetric(horizontal: 12.0), + padding: EdgeInsets.symmetric(horizontal: 12.0.w), child: CustomTextField( label: "Address 1", hint: "Enter address manually or tap to search", @@ -132,7 +132,7 @@ class EditProfilePage extends StatelessWidget { ), ), - const SizedBox(height: 26), + SizedBox(height: 26.h), // Buttons Row( @@ -144,35 +144,35 @@ class EditProfilePage extends StatelessWidget { foregroundColor: const Color(0xFFF95F62), side: const BorderSide(color: Colors.transparent), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(38), + borderRadius: BorderRadius.circular(38.r), ), - padding: const EdgeInsets.symmetric(vertical: 12), + padding: EdgeInsets.symmetric(vertical: 12.h), ), onPressed: () {}, - child: const Text( + child: Text( "Cancel", style: TextStyle( - fontSize: 16, + fontSize: 16.sp, fontWeight: FontWeight.w500, ), ), ), ), - const SizedBox(width: 16), + SizedBox(width: 16.w), Expanded( child: ElevatedButton( style: ElevatedButton.styleFrom( backgroundColor: const Color(0xFFF95F62), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(38), + borderRadius: BorderRadius.circular(38.r), ), - padding: const EdgeInsets.symmetric(vertical: 6), + padding: EdgeInsets.symmetric(vertical: 6.h), ), onPressed: () {}, - child: const Text( + child: Text( "Save", style: TextStyle( - fontSize: 16, + fontSize: 16.sp, fontWeight: FontWeight.w500, color: Colors.white, ), @@ -181,7 +181,7 @@ class EditProfilePage extends StatelessWidget { ), ], ), - const SizedBox(height: 20), + SizedBox(height: 20.h), ], ), ), diff --git a/lib/faq/faq_view.dart b/lib/faq/faq_view.dart index 274c31f..d8174e0 100644 --- a/lib/faq/faq_view.dart +++ b/lib/faq/faq_view.dart @@ -2,6 +2,7 @@ import 'package:citycards_customer/common_packages/app_bar.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'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class FaqPage extends StatelessWidget { const FaqPage({super.key}); @@ -13,19 +14,19 @@ class FaqPage extends StatelessWidget { body: SafeArea( child: SingleChildScrollView( child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ CommonAppBar(isWhiteLogo: false, isProfilePage: true), SizedBox( - height: 12, + height: 12.h, ), Divider( - height: 1, + height: 1.h, color: Color(0xFFD9D9D9), ), - const SizedBox(height: 22), + SizedBox(height: 22.h), // Back + Title Row( @@ -34,23 +35,23 @@ class FaqPage extends StatelessWidget { onTap: (){ Navigator.pop(context); }, - child: Icon(Icons.arrow_back, size: 24)), - SizedBox(width: 8), + child: Icon(Icons.arrow_back, size: 24.sp)), + SizedBox(width: 8.w), Text( "FAQ", style: TextStyle( - fontSize: 12, + fontSize: 12.sp, fontWeight: FontWeight.w500, ), ), ], ), - const SizedBox(height: 34), + SizedBox(height: 34.h), FAQSection(title: "🧭 General FAQs", faqs: generalFAQs), - SizedBox(height: 20), + SizedBox(height: 20.h), FAQSection(title: "✈️ Booking & Planning", faqs: bookingFaq), - SizedBox(height: 20), + SizedBox(height: 20.h), FAQSection(title: "🌍 Discover & Explore", faqs: discoverFAQs), ], ), @@ -127,10 +128,10 @@ final List bookingFaq = [ // Widget for FAQ section Widget FAQSection({required String title, required List faqs}) { return Container( - padding: EdgeInsets.symmetric(vertical: 12, horizontal: 8), + padding: EdgeInsets.symmetric(vertical: 12.h, horizontal: 8.w), decoration: BoxDecoration( border: Border.all(color: Color(0xFFF95F62)), - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(10.r), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -138,11 +139,11 @@ Widget FAQSection({required String title, required List faqs}) { // Section heading CustomText( text: title, - size: 16, + size: 16.sp, weight: FontWeight.w500, color: Color(0xFF212121), ), - SizedBox(height: 12), + SizedBox(height: 12.h), // Dynamic list of questions Column( @@ -151,24 +152,24 @@ Widget FAQSection({required String title, required List faqs}) { return Column( children: [ CustomExpansionTile( - minTileHeight: 42, - borderRadius: BorderRadius.circular(5), + minTileHeight: 42.h, + borderRadius: BorderRadius.circular(5.r), backgroundColor: Color(0xFFFEE7E7), collapsedBackgroundColor: Color(0xFFFEE7E7), tilePadding: EdgeInsets.symmetric( - horizontal: 14, + horizontal: 14.w, vertical: 0, ), - childrenPadding: EdgeInsets.all(12), - title: Text(faq.question, style: TextStyle(fontSize: 14)), + childrenPadding: EdgeInsets.only(left: 12.w,right: 12.w, bottom: 12.h), + title: Text(faq.question, style: TextStyle(fontSize: 14.sp)), children: [ Text( faq.answer, - style: TextStyle(color: Color(0xFF5C5C5C), fontSize: 14), + style: TextStyle(color: Color(0xFF5C5C5C), fontSize: 14.sp), ), ], ), - if (index != faqs.length - 1) SizedBox(height: 8), // spacing + if (index != faqs.length - 1) SizedBox(height: 8.h), // spacing ], ); }).toList(), diff --git a/lib/home/views/explore_cities_card.dart b/lib/home/views/explore_cities_card.dart index e80d0ee..3832f35 100644 --- a/lib/home/views/explore_cities_card.dart +++ b/lib/home/views/explore_cities_card.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:google_fonts/google_fonts.dart'; class ExploreCitiesCard extends StatelessWidget { @@ -22,46 +23,40 @@ class ExploreCitiesCard extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 220, - margin: const EdgeInsets.only(right: 16), + width: 220.w, + margin: EdgeInsets.only(right: 16.w), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16), - image: DecorationImage( - image: AssetImage(imageUrl), - fit: BoxFit.cover, - ), + borderRadius: BorderRadius.circular(16.r), + image: DecorationImage(image: AssetImage(imageUrl), fit: BoxFit.cover), ), child: Stack( children: [ Container( decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16), + borderRadius: BorderRadius.circular(16.r), gradient: LinearGradient( begin: Alignment.bottomCenter, end: Alignment.topCenter, - colors: [ - Colors.black.withOpacity(0.2), - Colors.transparent, - ], + colors: [Colors.black.withOpacity(0.2), Colors.transparent], ), ), ), Positioned( - top: 10, - right: 10, + top: 10.h, + right: 10.w, child: Container( - padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10), + padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 10.w), decoration: BoxDecoration( color: const Color(0xffDBFCE7), - borderRadius: BorderRadius.circular(20), + borderRadius: BorderRadius.circular(20.r), ), child: Text( savingsText, style: GoogleFonts.poppins( color: const Color(0xFF2C8354), fontWeight: FontWeight.w600, - fontSize: 12, + fontSize: 12.sp, ), ), ), @@ -69,9 +64,9 @@ class ExploreCitiesCard extends StatelessWidget { // Bottom text Positioned( - bottom: 10, - left: 10, - right: 10, + bottom: 10.h, + left: 10.w, + right: 10.w, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -80,21 +75,21 @@ class ExploreCitiesCard extends StatelessWidget { style: TextStyle( color: Colors.white, fontWeight: FontWeight.w500, - fontSize: 16, + fontSize: 16.sp, ), ), - const SizedBox(height: 4), + SizedBox(height: 4.h), Text( description, style: GoogleFonts.poppins( color: Colors.white, fontWeight: FontWeight.w400, - fontSize: 11, + fontSize: 11.sp, ), maxLines: 2, overflow: TextOverflow.ellipsis, ), - const SizedBox(height: 8), + SizedBox(height: 8.h), // Prices Row( @@ -104,16 +99,16 @@ class ExploreCitiesCard extends StatelessWidget { "Individual tickets :", style: TextStyle( color: Color(0xffFDCDCE), - fontSize: 12 + fontSize: 12.sp, ), ), Text( individualPrice, - style: TextStyle( - color: Color(0xffFDCDCE), - fontSize: 12, + style: TextStyle( + color: Color(0xffFDCDCE), + fontSize: 12.sp, decoration: TextDecoration.lineThrough, - decorationColor: Color(0xffFDCDCE) + decorationColor: Color(0xffFDCDCE), ), ), ], @@ -124,15 +119,15 @@ class ExploreCitiesCard extends StatelessWidget { Text( "City Card :", style: TextStyle( - color: Color(0xffFDCDCE), - fontSize: 12 + color: Color(0xffFDCDCE), + fontSize: 12.sp, ), ), Text( cityCardPrice, style: TextStyle( - color: Color(0xffFDCDCE), - fontSize: 12 + color: Color(0xffFDCDCE), + fontSize: 12.sp, ), ), ], diff --git a/lib/home/views/first_time_user_home_page.dart b/lib/home/views/first_time_user_home_page.dart index 454e807..286844d 100644 --- a/lib/home/views/first_time_user_home_page.dart +++ b/lib/home/views/first_time_user_home_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import '../../common_packages/app_bar.dart'; import 'explore_cities_card.dart'; @@ -11,7 +12,6 @@ class FirstTimeUserHomePage extends StatefulWidget { } class _FirstTimeUserHomePageState extends State { - final ScrollController _scrollController = ScrollController(); double _scrollProgress = 0.0; @@ -23,8 +23,7 @@ class _FirstTimeUserHomePageState extends State { "individualTicket": "\$350+", "cityCard": "\$199", "savings": "Save \$151+", - "image": - "assets/images/city_sydney.png" + "image": "assets/images/city_sydney.png", }, { "name": "Sydney", @@ -32,8 +31,7 @@ class _FirstTimeUserHomePageState extends State { "individualTicket": "\$400+", "cityCard": "\$249", "savings": "Save \$151+", - "image": - "assets/images/city_sydney.png" + "image": "assets/images/city_sydney.png", }, { "name": "Sydney", @@ -41,44 +39,19 @@ class _FirstTimeUserHomePageState extends State { "individualTicket": "\$400+", "cityCard": "\$249", "savings": "Save \$151+", - "image": - "assets/images/city_sydney.png" - } + "image": "assets/images/city_sydney.png", + }, ]; final List> upcomingCities = [ - { - "image": "assets/images/city_turkey.jpg", - "name": "Turkey", - }, - { - "image":"assets/images/city_germany.jpg", - "name": "Germany" - }, - { - "image":"assets/images/city_switz.jpg", - "name" : "Switzerland" - }, - { - "image":"assets/images/city_maldives.jpg", - "name": "Maldives" - }, - { - "image" : "assets/images/city_turkey.jpg", - "name": "Turkey" - }, - { - "image":"assets/images/city_germany.jpg", - "name": "Germany" - }, - { - "image":"assets/images/city_switz.jpg", - "name" : "Switzerland" - }, - { - "image":"assets/images/city_maldives.jpg", - "name": "Maldives" - }, + {"image": "assets/images/city_turkey.jpg", "name": "Turkey"}, + {"image": "assets/images/city_germany.jpg", "name": "Germany"}, + {"image": "assets/images/city_switz.jpg", "name": "Switzerland"}, + {"image": "assets/images/city_maldives.jpg", "name": "Maldives"}, + {"image": "assets/images/city_turkey.jpg", "name": "Turkey"}, + {"image": "assets/images/city_germany.jpg", "name": "Germany"}, + {"image": "assets/images/city_switz.jpg", "name": "Switzerland"}, + {"image": "assets/images/city_maldives.jpg", "name": "Maldives"}, ]; @override @@ -89,11 +62,13 @@ class _FirstTimeUserHomePageState extends State { void _updateScrollProgress() { if (!_scrollController.hasClients || - _scrollController.position.maxScrollExtent == 0) return; + _scrollController.position.maxScrollExtent == 0) + return; setState(() { - _scrollProgress = (_scrollController.offset / - _scrollController.position.maxScrollExtent) - .clamp(0.0, 1.0); + _scrollProgress = + (_scrollController.offset / + _scrollController.position.maxScrollExtent) + .clamp(0.0, 1.0); }); } @@ -111,76 +86,84 @@ class _FirstTimeUserHomePageState extends State { children: [ Image.asset("assets/images/home_bg.png"), Padding( - padding: const EdgeInsets.all(16.0), + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CommonAppBar(isWhiteLogo: false , isProfilePage: false), - const SizedBox(height: 140), - const Text( + CommonAppBar(isWhiteLogo: false, isProfilePage: false), + SizedBox(height: 140.h), + Text( "CityCards.\nSee More,\nSpend Less.", style: TextStyle( - fontSize: 44, + fontSize: 44.sp, fontWeight: FontWeight.bold, color: Colors.white, ), ), - const SizedBox(height: 8), + SizedBox(height: 8.h), const Text( "Instant QR access to 40+ attractions,\nexclusive perks, and savings up to 30%", style: TextStyle(color: Colors.white), ), - const SizedBox(height: 20), + SizedBox(height: 20.h), ElevatedButton( style: ElevatedButton.styleFrom( fixedSize: const Size(200, 50), - padding: const EdgeInsets.all(15), + padding: EdgeInsets.symmetric( + horizontal: 15.w, + vertical: 15.h, + ), backgroundColor: const Color(0xffF95F62), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(25), + borderRadius: BorderRadius.circular(25.r), ), ), onPressed: () {}, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - const Text("Get You'r CityCard", - style: TextStyle(color: Colors.white)), - const SizedBox(width: 10), - Image.asset("assets/icons/arrow.png", height: 13), + const Text( + "Get You'r CityCard", + style: TextStyle(color: Colors.white), + ), + SizedBox(width: 10.w), + Image.asset("assets/icons/arrow.png", height: 13.h), ], ), ), - const SizedBox(height: 80), + SizedBox(height: 80.h), Text.rich( TextSpan( - children: const [ + children: [ TextSpan( text: "Explore ", style: TextStyle( - fontSize: 24, + fontSize: 24.sp, fontWeight: FontWeight.w500, color: Color(0xffF95F62), ), ), TextSpan( text: "Cities", - style: - TextStyle(fontSize: 24, color: Colors.black, fontWeight: FontWeight.w500,), + style: TextStyle( + fontSize: 24, + color: Colors.black, + fontWeight: FontWeight.w500, + ), ), ], ), ), - const SizedBox(height: 8), + SizedBox(height: 8.h), const Text( "Explore your dream destination and experience various attractions.", style: TextStyle(color: Color(0xff676D75)), ), - const SizedBox(height: 16), + SizedBox(height: 16.sp), // Horizontal cards SizedBox( - height: 270, + height: 270.h, child: ListView.builder( controller: _scrollController, scrollDirection: Axis.horizontal, @@ -199,17 +182,17 @@ class _FirstTimeUserHomePageState extends State { ), ), - const SizedBox(height: 10), - const SizedBox(height: 10), + SizedBox(height: 10.h), + SizedBox(height: 10.h), Align( alignment: Alignment.center, child: SizedBox( - width: 200, + width: 200.w, child: ClipRRect( - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(10.r), child: LinearProgressIndicator( value: _scrollProgress, - minHeight: 6, + minHeight: 6.h, backgroundColor: Color(0xffFEE7E7), color: const Color(0xffF95F62), ), @@ -217,49 +200,55 @@ class _FirstTimeUserHomePageState extends State { ), ), - - const SizedBox(height: 40), + SizedBox(height: 40.h), Text.rich( TextSpan( - children: const [ + children: [ TextSpan( text: "Upcoming ", style: TextStyle( - fontSize: 24, + fontSize: 24.sp, fontWeight: FontWeight.w500, color: Color(0xffF95F62), ), ), TextSpan( text: "Cities", - style: - TextStyle(fontSize: 24, color: Colors.black, fontWeight: FontWeight.w500), + style: TextStyle( + fontSize: 24.sp, + color: Colors.black, + fontWeight: FontWeight.w500, + ), ), ], ), ), - const SizedBox(height: 8), + SizedBox(height: 8.h), Text( "Explore your dream destination and experience various attractions.", style: TextStyle(color: Colors.grey[600]), ), - const SizedBox(height: 16), + SizedBox(height: 16.h), SizedBox( - height: 80, + height: 80.h, child: ListView.separated( scrollDirection: Axis.horizontal, itemCount: upcomingCities.length, - separatorBuilder: (_, __) => const SizedBox(width: 16), + separatorBuilder: (_, __) => SizedBox(width: 16.w), itemBuilder: (context, index) { return Column( children: [ CircleAvatar( - radius: 28, - backgroundImage: AssetImage(upcomingCities[index]["image"] ?? ""), + radius: 28.r, + backgroundImage: AssetImage( + upcomingCities[index]["image"] ?? "", + ), + ), + SizedBox(height: 4.h), + Text( + upcomingCities[index]["name"] ?? "", + style: TextStyle(fontSize: 12.sp), ), - const SizedBox(height: 4), - Text(upcomingCities[index]["name"] ?? "", - style: const TextStyle(fontSize: 12)), ], ); }, diff --git a/lib/main.dart b/lib/main.dart index e068a09..2f2b1c8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,36 +1,44 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:google_fonts/google_fonts.dart'; import 'core/app_router.dart'; import 'core/route_constants.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); - SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( - statusBarColor: Colors.white, - statusBarIconBrightness: Brightness.dark, - statusBarBrightness: Brightness.light, - )); + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle( + statusBarColor: Colors.white, + statusBarIconBrightness: Brightness.dark, + statusBarBrightness: Brightness.light, + ), + ); runApp(MyApp()); } class MyApp extends StatelessWidget { - MyApp({super.key}); + MyApp({super.key}); final AppRouter _appRouter = AppRouter(); @override Widget build(BuildContext context) { - return MaterialApp( - onGenerateRoute: _appRouter.onGenerateRoute, - initialRoute: RouteConstants.home, - debugShowCheckedModeBanner: false, - title: 'City Cards', - theme: ThemeData( - textTheme: GoogleFonts.poppinsTextTheme( - Theme.of(context).textTheme, - ) - ), + return ScreenUtilInit( + designSize: const Size(390, 844), + builder: (context, child) { + return MaterialApp( + onGenerateRoute: _appRouter.onGenerateRoute, + initialRoute: RouteConstants.home, + debugShowCheckedModeBanner: false, + title: 'City Cards', + theme: ThemeData( + textTheme: GoogleFonts.poppinsTextTheme( + Theme.of(context).textTheme, + ), + ), + ); + }, ); } } diff --git a/lib/privacy/privacy_view.dart b/lib/privacy/privacy_view.dart index e871f2f..b3b4dfb 100644 --- a/lib/privacy/privacy_view.dart +++ b/lib/privacy/privacy_view.dart @@ -1,6 +1,7 @@ import 'package:citycards_customer/common_packages/app_bar.dart'; import 'package:citycards_customer/common_packages/custom_text.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class PrivacyPolicyPage extends StatelessWidget { const PrivacyPolicyPage({super.key}); @@ -11,18 +12,13 @@ class PrivacyPolicyPage extends StatelessWidget { body: SafeArea( child: SingleChildScrollView( child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h), child: Column( children: [ CommonAppBar(isWhiteLogo: false, isProfilePage: true), - SizedBox( - height: 12, - ), - Divider( - height: 1, - color: Color(0xFFD9D9D9), - ), - const SizedBox(height: 22), + SizedBox(height: 12.h), + Divider(height: 1.h, color: Color(0xFFD9D9D9)), + SizedBox(height: 22.h), // Back + Title Row( @@ -31,25 +27,25 @@ class PrivacyPolicyPage extends StatelessWidget { onTap: () { Navigator.pop(context); }, - child: Icon(Icons.arrow_back, size: 24), + child: Icon(Icons.arrow_back, size: 24.sp), ), - SizedBox(width: 8), + SizedBox(width: 8.w), Text( "Privacy Policy", style: TextStyle( - fontSize: 12, + fontSize: 12.sp, fontWeight: FontWeight.w500, ), ), ], ), - SizedBox(height: 32), + SizedBox(height: 32.h), CustomText( text: "Your use of our website is governed by the following terms and conditions (“Terms of Use”), as well as the CARDONE CAPITAL Privacy Policy and other operating rules, minimum qualifications and cautions posted throughout the website or presented to you individually during the course of your use of the website (collectively, the “Terms”). \n\n" "The Terms govern your use of the website and CARDONE CAPITAL reserves the right to update or replace the Terms any time without notice. You are advised to review the Terms for any changes when you visit the website even if you have not received a notification of changes as you are bound by them even if you have not reviewed them. \n\n" "Your viewing and use of the website after such change constitutes your acceptance of the Terms and any changes to such terms. If at any time you do not want to be bound by the Terms you should logout, exit and cease using the website immediately.", - size: 14, + size: 14.sp, weight: FontWeight.w400, color: Color(0xFF000000).withOpacity(.6), ), diff --git a/lib/profile/profile_page_view.dart b/lib/profile/profile_page_view.dart index eef124b..7dee061 100644 --- a/lib/profile/profile_page_view.dart +++ b/lib/profile/profile_page_view.dart @@ -5,6 +5,7 @@ import 'package:citycards_customer/common_packages/language_selection_bottomshee import 'package:citycards_customer/core/route_constants.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class ProfilePage extends StatelessWidget { const ProfilePage({super.key}); @@ -15,44 +16,44 @@ class ProfilePage extends StatelessWidget { backgroundColor: Colors.white, body: SafeArea( child: SingleChildScrollView( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ CommonAppBar(isWhiteLogo: false, isProfilePage: true), - SizedBox(height: 12), - Divider(height: 1, color: Color(0xFFD9D9D9)), - SizedBox(height: 22), + SizedBox(height: 12.h), + Divider(height: 1.h, color: Color(0xFFD9D9D9)), + SizedBox(height: 22.h), Row( children: [ GestureDetector( onTap: () { Navigator.pop(context); }, - child: Icon(Icons.arrow_back, size: 24), + child: Icon(Icons.arrow_back, size: 24.sp), ), - SizedBox(width: 8), - Text("My profile", style: TextStyle(fontSize: 12)), + SizedBox(width: 8.w), + Text("My profile", style: TextStyle(fontSize: 12.sp)), ], ), - SizedBox(height: 29), + SizedBox(height: 29.h), // Profile Image and Name Row( children: [ - const CircleAvatar( - radius: 38, + CircleAvatar( + radius: 38.r, backgroundImage: AssetImage( "assets/images/profile_img.png", ), ), - SizedBox(width: 16), + SizedBox(width: 16.w), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text( + Text( 'Laysha Adams', style: TextStyle( - fontSize: 16, + fontSize: 16.sp, fontWeight: FontWeight.w500, ), ), @@ -62,13 +63,13 @@ class ProfilePage extends StatelessWidget { Icon( Icons.location_on_sharp, color: Color(0xFF8E8E8E), - size: 14, + size: 14.sp, ), - SizedBox(width: 4), - const Text( + SizedBox(width: 4.w), + Text( 'Louisiana, United States', style: TextStyle( - fontSize: 12, + fontSize: 12.sp, color: Color(0xFF8E8E8E), ), ), @@ -79,7 +80,7 @@ class ProfilePage extends StatelessWidget { ], ), - const SizedBox(height: 30), + SizedBox(height: 30.h), // Account Settings Section Align( @@ -87,10 +88,10 @@ class ProfilePage extends StatelessWidget { child: CustomText( text: "Account Settings", weight: FontWeight.w500, - size: 18, + size: 18.sp, ), ), - const SizedBox(height: 10), + SizedBox(height: 10.h), _buildListTile( icon: "assets/icons/user_profile.png", @@ -105,9 +106,9 @@ class ProfilePage extends StatelessWidget { onTap: () { showModalBottomSheet( context: context, - shape: const RoundedRectangleBorder( + shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical( - top: Radius.circular(12), + top: Radius.circular(12.r), ), ), builder: (context) => BlocProvider( @@ -116,7 +117,7 @@ class ProfilePage extends StatelessWidget { ); }, ), - const SizedBox(height: 24), + SizedBox(height: 24.h), // Support & Legal Section Align( @@ -124,10 +125,10 @@ class ProfilePage extends StatelessWidget { child: CustomText( text: "Support & Legal", weight: FontWeight.w500, - size: 18, + size: 18.sp, ), ), - const SizedBox(height: 10), + SizedBox(height: 10.h), _buildListTile( icon: "assets/icons/contact_us.png", @@ -161,7 +162,7 @@ class ProfilePage extends StatelessWidget { }, ), - const SizedBox(height: 22), + SizedBox(height: 22.h), // Logout Button SizedBox( @@ -171,14 +172,14 @@ class ProfilePage extends StatelessWidget { foregroundColor: Color(0xFFF95F62), side: const BorderSide(color: Color(0xFFF95F62)), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(38), + borderRadius: BorderRadius.circular(38.r), ), - padding: const EdgeInsets.symmetric(vertical: 6), + padding: EdgeInsets.symmetric(vertical: 6.h), ), onPressed: () {}, - child: const Text( + child: Text( 'Log out', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w600), ), ), ), @@ -195,19 +196,19 @@ class ProfilePage extends StatelessWidget { required VoidCallback onTap, }) { return Container( - height: 64, + height: 64.h, decoration: BoxDecoration( border: Border.all(color: Colors.black.withOpacity(.10)), - borderRadius: BorderRadius.circular(15), + borderRadius: BorderRadius.circular(15.r), ), - margin: const EdgeInsets.symmetric(vertical: 6, horizontal: 12), + margin: EdgeInsets.symmetric(vertical: 6.h, horizontal: 12.w), child: ListTile( leading: Image.asset(icon, scale: 4), title: Text( title, - style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w500), + style: TextStyle(fontSize: 15.sp, fontWeight: FontWeight.w500), ), - trailing: const Icon(Icons.arrow_forward_ios, size: 16), + trailing: Icon(Icons.arrow_forward_ios, size: 16.sp), onTap: onTap, ), ); diff --git a/lib/terms_and_condition/terms_and_condition_view.dart b/lib/terms_and_condition/terms_and_condition_view.dart index 5a6b75d..c4af61c 100644 --- a/lib/terms_and_condition/terms_and_condition_view.dart +++ b/lib/terms_and_condition/terms_and_condition_view.dart @@ -1,6 +1,7 @@ import 'package:citycards_customer/common_packages/app_bar.dart'; import 'package:citycards_customer/common_packages/custom_text.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class TermsAndCondition extends StatelessWidget { const TermsAndCondition({super.key}); @@ -11,18 +12,13 @@ class TermsAndCondition extends StatelessWidget { body: SafeArea( child: SingleChildScrollView( child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 10.h), child: Column( children: [ CommonAppBar(isWhiteLogo: false, isProfilePage: true), - SizedBox( - height: 12, - ), - Divider( - height: 1, - color: Color(0xFFD9D9D9), - ), - const SizedBox(height: 22), + SizedBox(height: 12.h), + Divider(height: 1.h, color: Color(0xFFD9D9D9)), + SizedBox(height: 22.h), // Back + Title Row( @@ -31,25 +27,25 @@ class TermsAndCondition extends StatelessWidget { onTap: () { Navigator.pop(context); }, - child: Icon(Icons.arrow_back, size: 24), + child: Icon(Icons.arrow_back, size: 24.sp), ), - SizedBox(width: 8), + SizedBox(width: 8.w), Text( "Terms and Conditons", style: TextStyle( - fontSize: 12, + fontSize: 12.sp, fontWeight: FontWeight.w500, ), ), ], ), - SizedBox(height: 32), + SizedBox(height: 32.h), CustomText( text: "Your use of our website is governed by the following terms and conditions (“Terms of Use”), as well as the CARDONE CAPITAL Privacy Policy and other operating rules, minimum qualifications and cautions posted throughout the website or presented to you individually during the course of your use of the website (collectively, the “Terms”). \n\n" "The Terms govern your use of the website and CARDONE CAPITAL reserves the right to update or replace the Terms any time without notice. You are advised to review the Terms for any changes when you visit the website even if you have not received a notification of changes as you are bound by them even if you have not reviewed them. \n\n" "Your viewing and use of the website after such change constitutes your acceptance of the Terms and any changes to such terms. If at any time you do not want to be bound by the Terms you should logout, exit and cease using the website immediately.", - size: 14, + size: 14.sp, weight: FontWeight.w400, color: Color(0xFF000000).withOpacity(.6), ), diff --git a/pubspec.lock b/pubspec.lock index a9c288f..d1431d7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -102,6 +102,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.0" + flutter_screenutil: + dependency: "direct main" + description: + name: flutter_screenutil + sha256: "8239210dd68bee6b0577aa4a090890342d04a136ce1c81f98ee513fc0ce891de" + url: "https://pub.dev" + source: hosted + version: "5.9.3" flutter_test: dependency: "direct dev" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index ad07b1a..aa5877d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,6 +36,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 + flutter_screenutil: ^5.9.3 dev_dependencies: flutter_test: