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;
/// 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)
double get w => (this * _screenWidth) / figmaDesignWidth;
@ -20,13 +29,6 @@ extension ResponsiveExtension on num {
//radius
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
static double get screenWidth => SizeUtils.width;
@ -91,10 +93,7 @@ class SizeUtils {
/// Device's Width
static double width = 375;
static void setScreenSize(
BoxConstraints constraints,
Orientation currentOrientation,
) {
static void setScreenSize(BoxConstraints constraints, Orientation currentOrientation) {
boxConstraints = constraints;
orientation = currentOrientation;

@ -413,7 +413,7 @@ class _LandingPageState extends State<LandingPage> {
height: 127.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24,
borderRadius: 24.r,
),
child: Column(
children: [
@ -464,15 +464,12 @@ class _LandingPageState extends State<LandingPage> {
],
).paddingSymmetrical(24.h, 0.h),
SizedBox(
height: 325.h,
child: Column(
children: [
Expanded(
height: 350.h,
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: LandingPageData.getServiceCardsList.length,
shrinkWrap: true,
padding: EdgeInsets.only(left: 24.h, right: 24.h),
padding: EdgeInsets.only(left: 24.w, right: 24.w),
itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList(
position: index,
@ -490,10 +487,7 @@ class _LandingPageState extends State<LandingPage> {
),
);
},
separatorBuilder: (BuildContext cxt, int index) => 8.width,
),
),
],
separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 8.w),
),
),
appState.isAuthenticated ? HabibWalletCard() : SizedBox(),

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

Loading…
Cancel
Save