Merge remote-tracking branch 'origin/faiz_dev' into dev_aamir

dev_aamir
aamir-csol 2 weeks ago
commit 6f01f92dd0

@ -11,6 +11,15 @@ extension ResponsiveExtension on num {
double get _screenHeight => SizeUtils.height; double get _screenHeight => SizeUtils.height;
/// Scale text size
double get f {
double aspectRatio = _screenWidth / _screenHeight;
double scale = (_screenWidth < _screenHeight ? _screenWidth : _screenHeight) / figmaDesignWidth;
double clamp = (aspectRatio > 1.3 || aspectRatio < 0.77) ? 1.6 : 1.2;
if (scale > clamp) scale = clamp;
return this * scale;
}
/// Scale horizontally (width-based) /// Scale horizontally (width-based)
double get w => (this * _screenWidth) / figmaDesignWidth; double get w => (this * _screenWidth) / figmaDesignWidth;
@ -20,13 +29,6 @@ extension ResponsiveExtension on num {
//radius //radius
double get r => (this * _screenWidth) / figmaDesignWidth; double get r => (this * _screenWidth) / figmaDesignWidth;
/// Scale text size
double get f {
double scale = _screenWidth / figmaDesignWidth;
if (scale > 1.6) scale = 1.6; // optional clamp for tablets
return this * scale;
}
/// Optional: direct accessors for full width/height /// Optional: direct accessors for full width/height
static double get screenWidth => SizeUtils.width; static double get screenWidth => SizeUtils.width;
@ -91,10 +93,7 @@ class SizeUtils {
/// Device's Width /// Device's Width
static double width = 375; static double width = 375;
static void setScreenSize( static void setScreenSize(BoxConstraints constraints, Orientation currentOrientation) {
BoxConstraints constraints,
Orientation currentOrientation,
) {
boxConstraints = constraints; boxConstraints = constraints;
orientation = currentOrientation; orientation = currentOrientation;

@ -413,7 +413,7 @@ class _LandingPageState extends State<LandingPage> {
height: 127.h, height: 127.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 24, borderRadius: 24.r,
), ),
child: Column( child: Column(
children: [ children: [
@ -464,36 +464,30 @@ class _LandingPageState extends State<LandingPage> {
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.h, 0.h),
SizedBox( SizedBox(
height: 325.h, height: 350.h,
child: Column( child: ListView.separated(
children: [ scrollDirection: Axis.horizontal,
Expanded( itemCount: LandingPageData.getServiceCardsList.length,
child: ListView.separated( shrinkWrap: true,
scrollDirection: Axis.horizontal, padding: EdgeInsets.only(left: 24.w, right: 24.w),
itemCount: LandingPageData.getServiceCardsList.length, itemBuilder: (context, index) {
shrinkWrap: true, return AnimationConfiguration.staggeredList(
padding: EdgeInsets.only(left: 24.h, right: 24.h), position: index,
itemBuilder: (context, index) { duration: const Duration(milliseconds: 1000),
return AnimationConfiguration.staggeredList( child: SlideAnimation(
position: index, horizontalOffset: 100.0,
duration: const Duration(milliseconds: 1000), child: FadeInAnimation(
child: SlideAnimation( child: LargeServiceCard(
horizontalOffset: 100.0, image: LandingPageData.getServiceCardsList[index].icon,
child: FadeInAnimation( title: LandingPageData.getServiceCardsList[index].title,
child: LargeServiceCard( subtitle: LandingPageData.getServiceCardsList[index].subtitle,
image: LandingPageData.getServiceCardsList[index].icon, icon: LandingPageData.getServiceCardsList[index].largeCardIcon,
title: LandingPageData.getServiceCardsList[index].title, ),
subtitle: LandingPageData.getServiceCardsList[index].subtitle, ),
icon: LandingPageData.getServiceCardsList[index].largeCardIcon,
),
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => 8.width,
), ),
), );
], },
separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 8.w),
), ),
), ),
appState.isAuthenticated ? HabibWalletCard() : SizedBox(), appState.isAuthenticated ? HabibWalletCard() : SizedBox(),

@ -16,7 +16,7 @@ class LargeServiceCard extends StatelessWidget {
final String title; final String title;
final String subtitle; final String subtitle;
LargeServiceCard({ const LargeServiceCard({
super.key, super.key,
this.image = "", this.image = "",
this.icon = "", this.icon = "",
@ -27,49 +27,38 @@ class LargeServiceCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
padding: EdgeInsets.symmetric(horizontal: 3.h), padding: EdgeInsets.symmetric(horizontal: 3.w),
child: Container( child: Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( width: 150.w,
color: Colors.transparent, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: Colors.transparent, borderRadius: 16.r),
borderRadius: 16, child: Column(
), mainAxisAlignment: MainAxisAlignment.start,
child: Padding( crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.symmetric(horizontal: 0.h), children: [
child: Column( Image.asset(AppAssets.livecare_service, width: 220.w, height: 220.h, fit: BoxFit.contain),
mainAxisAlignment: MainAxisAlignment.center, SizedBox(height: 3.h),
crossAxisAlignment: CrossAxisAlignment.start, Row(
children: [ children: [
Image.asset(AppAssets.livecare_service, width: 220.h, height: 220.h, fit: BoxFit.contain), Utils.buildSvgWithAssets(icon: icon, width: 24.w, height: 24.h),
SizedBox(height: 3.h), title.toText14(color: AppColors.blackColor, isBold: true),
Row( ],
children: [ ),
Utils.buildSvgWithAssets(icon: icon, width: 24.h, height: 24.h), subtitle.toText11(color: AppColors.blackColor),
title.toText14(color: AppColors.blackColor, isBold: true), SizedBox(height: 10.h),
], CustomButton(
), width: 150.w,
SizedBox(width: 220.h, child: subtitle.toText11(color: AppColors.blackColor)), text: LocaleKeys.bookNow.tr(context: context),
SizedBox(height: 6.h), onPressed: () {},
SizedBox( backgroundColor: AppColors.borderOnlyColor,
width: 220.h, borderColor: AppColors.borderOnlyColor,
child: CustomButton( textColor: AppColors.whiteColor,
text: LocaleKeys.bookNow.tr(context: context), fontSize: 14.f,
onPressed: () { fontWeight: FontWeight.bold,
// Navigator.of(context).pushReplacement( borderRadius: 12.r,
// MaterialPageRoute(builder: (BuildContext context) => LandingPage()), padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0),
// ); height: 40.h,
}, ),
backgroundColor: AppColors.borderOnlyColor, ],
borderColor: AppColors.borderOnlyColor,
textColor: AppColors.whiteColor,
fontSize: 14,
fontWeight: FontWeight.bold,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h,
),
),
],
),
), ),
), ),
); );

Loading…
Cancel
Save