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,15 +464,12 @@ 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(
children: [
Expanded(
child: ListView.separated( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: LandingPageData.getServiceCardsList.length, itemCount: LandingPageData.getServiceCardsList.length,
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.only(left: 24.h, right: 24.h), padding: EdgeInsets.only(left: 24.w, right: 24.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList( return AnimationConfiguration.staggeredList(
position: index, 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(), 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,51 +27,40 @@ 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: Padding(
padding: EdgeInsets.symmetric(horizontal: 0.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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), SizedBox(height: 3.h),
Row( Row(
children: [ 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), title.toText14(color: AppColors.blackColor, isBold: true),
], ],
), ),
SizedBox(width: 220.h, child: subtitle.toText11(color: AppColors.blackColor)), subtitle.toText11(color: AppColors.blackColor),
SizedBox(height: 6.h), SizedBox(height: 10.h),
SizedBox( CustomButton(
width: 220.h, width: 150.w,
child: CustomButton(
text: LocaleKeys.bookNow.tr(context: context), text: LocaleKeys.bookNow.tr(context: context),
onPressed: () { onPressed: () {},
// Navigator.of(context).pushReplacement(
// MaterialPageRoute(builder: (BuildContext context) => LandingPage()),
// );
},
backgroundColor: AppColors.borderOnlyColor, backgroundColor: AppColors.borderOnlyColor,
borderColor: AppColors.borderOnlyColor, borderColor: AppColors.borderOnlyColor,
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,
fontSize: 14, fontSize: 14.f,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
borderRadius: 12, borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0),
height: 40.h, height: 40.h,
), ),
),
], ],
), ),
), ),
),
); );
} }
} }

Loading…
Cancel
Save