Compare commits

...

6 Commits

Author SHA1 Message Date
tahaalam 57056e67f3 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	lib/extensions/string_extensions.dart
#	lib/widgets/buttons/custom_button.dart
2 weeks ago
Haroon6138 83eb57ed9f Merge pull request 'Design Updates (Faiz_Dev)' (#86) from faiz_dev into master
Reviewed-on: #86
3 weeks ago
faizatflutter 72d765e508 Design Updates 3 weeks ago
faizatflutter 21be3a2d06 Merge branch 'master' into faiz_dev
# Conflicts:
#	lib/core/utils/utils.dart
#	lib/presentation/book_appointment/laser/widgets/body_part_listing.dart
#	lib/widgets/buttons/custom_button.dart
#	lib/widgets/common_bottom_sheet.dart
#	lib/widgets/input_widget.dart
3 weeks ago
faizatflutter 462f4eba14 Design Updates 3 weeks ago
faizatflutter eabfaf8182 Design Updates 3 weeks ago

@ -15,7 +15,6 @@ import 'package:flutter_ios_voip_kit_karmm/flutter_ios_voip_kit.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:hmg_patient_app_new/core/utils/local_notifications.dart'; import 'package:hmg_patient_app_new/core/utils/local_notifications.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import '../cache_consts.dart'; import '../cache_consts.dart';
@ -355,7 +354,6 @@ class PushNotificationHandler {
} }
onToken(String token) async { onToken(String token) async {
print("Push Notification Token: " + token); print("Push Notification Token: " + token);
await Utils.saveStringFromPrefs(CacheConst.pushToken, token); await Utils.saveStringFromPrefs(CacheConst.pushToken, token);
} }
@ -370,7 +368,9 @@ class PushNotificationHandler {
Future<void> requestPermissions() async { Future<void> requestPermissions() async {
try { try {
if (Platform.isIOS) { if (Platform.isIOS) {
await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(alert: true, badge: true, sound: true); await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(alert: true, badge: true, sound: true);
} else if (Platform.isAndroid) { } else if (Platform.isAndroid) {
Map<Permission, PermissionStatus> statuses = await [ Map<Permission, PermissionStatus> statuses = await [
Permission.notification, Permission.notification,

@ -1,25 +1,41 @@
import 'dart:developer';
import 'package:flutter/material.dart'; // These are the Viewport values of your Figma Design. import 'package:flutter/material.dart'; // These are the Viewport values of your Figma Design.
// These are used in the code as a reference to create your UI Responsively. // These are used in the code as a reference to create your UI Responsively.
final num FIGMA_DESIGN_WIDTH = SizeUtils.width; const num figmaDesignWidth = 375; // iPhone X / 12 base width
final num FIGMA_DESIGN_HEIGHT = SizeUtils.height; const num figmaDesignHeight = 812; // iPhone X / 12 base height
const num FIGMA_DESIGN_STATUS_BAR = 0;
extension ResponsiveExtension on num { extension ResponsiveExtension on num {
double get _width => SizeUtils.width; double get _screenWidth => SizeUtils.width;
double get h => ((this * _width) / FIGMA_DESIGN_WIDTH); double get _screenHeight => SizeUtils.height;
double get fSize => ((this * _width) / FIGMA_DESIGN_WIDTH); /// Scale horizontally (width-based)
static double get screenHeight => SizeUtils.height; double get w => (this * _screenWidth) / figmaDesignWidth;
/// Scale vertically (height-based)
double get h => (this * _screenHeight) / figmaDesignHeight;
//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;
}
/// Full screen width /// Optional: direct accessors for full width/height
static double get screenWidth => SizeUtils.width; static double get screenWidth => SizeUtils.width;
static double get screenHeight => SizeUtils.height;
} }
extension FormatExtension on double { extension FormatExtension on double {
double toDoubleValue({int fractionDigits = 2}) { double toDoubleValue({int fractionDigits = 2}) {
return double.parse(this.toStringAsFixed(fractionDigits)); return double.parse(toStringAsFixed(fractionDigits));
} }
double isNonZero({num defaultValue = 0.0}) { double isNonZero({num defaultValue = 0.0}) {
@ -36,7 +52,7 @@ typedef ResponsiveBuild = Widget Function(
); );
class Sizer extends StatelessWidget { class Sizer extends StatelessWidget {
const Sizer({Key? key, required this.builder}) : super(key: key); const Sizer({super.key, required this.builder});
/// Builds the widget whenever the orientation changes. /// Builds the widget whenever the orientation changes.
final ResponsiveBuild builder; final ResponsiveBuild builder;
@ -81,17 +97,46 @@ class SizeUtils {
) { ) {
boxConstraints = constraints; boxConstraints = constraints;
orientation = currentOrientation; orientation = currentOrientation;
double screenWidth;
double screenHeight;
if (orientation == Orientation.portrait) { if (orientation == Orientation.portrait) {
width = boxConstraints.maxWidth.isNonZero( screenWidth = boxConstraints.maxWidth.isNonZero(
defaultValue: FIGMA_DESIGN_WIDTH, defaultValue: figmaDesignWidth,
); );
height = boxConstraints.maxHeight.isNonZero(); screenHeight = boxConstraints.maxHeight.isNonZero();
} else { } else {
width = boxConstraints.maxHeight.isNonZero( screenWidth = boxConstraints.maxHeight.isNonZero(
defaultValue: FIGMA_DESIGN_WIDTH, defaultValue: figmaDesignWidth,
); );
height = boxConstraints.maxWidth.isNonZero(); screenHeight = boxConstraints.maxWidth.isNonZero();
} }
deviceType = DeviceType.mobile;
width = screenWidth;
height = screenHeight;
// Fix device type detection
double longerSide = screenWidth > screenHeight ? screenWidth : screenHeight;
double shorterSide = screenWidth < screenHeight ? screenWidth : screenHeight;
if (longerSide >= 1200) {
deviceType = DeviceType.tablet;
} else if (shorterSide >= 700) {
// Use shorter side to distinguish tablets (iPads typically have 768+ width)
deviceType = DeviceType.tablet;
} else {
deviceType = DeviceType.mobile;
}
log("longerSide: $longerSide");
log("isTablet: $isTablet");
} }
} }
// Or create a helper method
bool get isTablet => SizeUtils.deviceType == DeviceType.tablet;
bool get isMobile => SizeUtils.deviceType == DeviceType.mobile;
bool get isDesktop => SizeUtils.deviceType == DeviceType.desktop;

@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:developer'; import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'dart:math' as dartMath;
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
@ -27,8 +28,6 @@ import 'package:lottie/lottie.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'dart:math' as dartMath;
class Utils { class Utils {
static AppState appState = getIt.get<AppState>(); static AppState appState = getIt.get<AppState>();
static NavigationService navigationService = getIt.get<NavigationService>(); static NavigationService navigationService = getIt.get<NavigationService>();
@ -67,8 +66,10 @@ class Utils {
// ), // ),
// )); // ));
return !isAddHours return !isAddHours
? DateFormat('hh:mm a', appState.isArabic() ? "ar_SA" : "en_US").format(DateTime.tryParse(startTime.contains("T") ? startTime : convertStringToDateTime(startTime))!.toLocal()) ? DateFormat('hh:mm a', appState.isArabic() ? "ar_SA" : "en_US")
: DateFormat('hh:mm a', appState.isArabic() ? "ar_SA" : "en_US").format(DateTime.tryParse(startTime.contains("T") ? startTime : convertStringToDateTime(startTime))!.add( .format(DateTime.tryParse(startTime.contains("T") ? startTime : convertStringToDateTime(startTime))!.toLocal())
: DateFormat('hh:mm a', appState.isArabic() ? "ar_SA" : "en_US")
.format(DateTime.tryParse(startTime.contains("T") ? startTime : convertStringToDateTime(startTime))!.add(
Duration( Duration(
hours: isAddHours ? 3 : 0, hours: isAddHours ? 3 : 0,
), ),
@ -301,7 +302,14 @@ class Utils {
return false; return false;
} }
static Widget getNoDataWidget(BuildContext context, {double width = 124, double height = 124, String? noDataText, Widget callToActionButton = const SizedBox.shrink(), bool isSmallWidget = false}) { static Widget getNoDataWidget(
BuildContext context, {
double width = 124,
double height = 124,
String? noDataText,
Widget callToActionButton = const SizedBox.shrink(),
bool isSmallWidget = false,
}) {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -309,7 +317,9 @@ class Utils {
SizedBox(height: isSmallWidget ? 0.h : 48.h), SizedBox(height: isSmallWidget ? 0.h : 48.h),
Lottie.asset(AppAnimations.noData, repeat: false, reverse: false, frameRate: FrameRate(60), width: width.h, height: height.h, fit: BoxFit.fill), Lottie.asset(AppAnimations.noData, repeat: false, reverse: false, frameRate: FrameRate(60), width: width.h, height: height.h, fit: BoxFit.fill),
SizedBox(height: 16.h), SizedBox(height: 16.h),
(noDataText ?? LocaleKeys.noDataAvailable.tr()).toText16(weight: FontWeight.w500, color: AppColors.greyTextColor, isCenter: true).paddingSymmetrical(64.h, 0.h), (noDataText ?? LocaleKeys.noDataAvailable.tr())
.toText16(weight: FontWeight.w500, color: AppColors.greyTextColor, isCenter: true)
.paddingSymmetrical(64.w, 0.h),
SizedBox(height: 16.h), SizedBox(height: 16.h),
callToActionButton callToActionButton
], ],
@ -461,8 +471,10 @@ class Utils {
} }
// Replace HTML line breaks with newlines // Replace HTML line breaks with newlines
var withLineBreaks = var withLineBreaks = htmlString
htmlString.replaceAll(RegExp(r'<br\s*\/?>', multiLine: true), '\n').replaceAll(RegExp(r'<\/p>', multiLine: true), '\n').replaceAll(RegExp(r'<divider>', multiLine: true), '\n'); .replaceAll(RegExp(r'<br\s*\/?>', multiLine: true), '\n')
.replaceAll(RegExp(r'<\/p>', multiLine: true), '\n')
.replaceAll(RegExp(r'<divider>', multiLine: true), '\n');
// Remove all other HTML tags // Remove all other HTML tags
var withoutTags = withLineBreaks.replaceAll(RegExp(r'<[^>]*>'), ''); var withoutTags = withLineBreaks.replaceAll(RegExp(r'<[^>]*>'), '');
@ -540,7 +552,20 @@ class Utils {
final year = parts[0]; final year = parts[0];
// Map month number to short month name (Hijri months) // Map month number to short month name (Hijri months)
const hijriMonthNames = ['Muharram', 'Safar', 'Rabi I', 'Rabi II', 'Jumada I', 'Jumada II', 'Rajab', 'Sha\'ban', 'Ramadan', 'Shawwal', 'Dhu al-Qi\'dah', 'Dhu al-Hijjah']; const hijriMonthNames = [
'Muharram',
'Safar',
'Rabi I',
'Rabi II',
'Jumada I',
'Jumada II',
'Rajab',
'Sha\'ban',
'Ramadan',
'Shawwal',
'Dhu al-Qi\'dah',
'Dhu al-Hijjah'
];
final monthIndex = int.tryParse(parts[1]) ?? 1; final monthIndex = int.tryParse(parts[1]) ?? 1;
final month = hijriMonthNames[monthIndex - 1]; final month = hijriMonthNames[monthIndex - 1];
@ -626,18 +651,20 @@ class Utils {
required String icon, required String icon,
Color? iconColor, Color? iconColor,
bool isDisabled = false, bool isDisabled = false,
double width = 24, double? width,
double height = 24, double? height,
BoxFit fit = BoxFit.cover, BoxFit fit = BoxFit.cover,
double? border, double? border,
double? borderRadius, double? borderRadius,
}) { }) {
final iconH = height ?? 24.h;
final iconW = width ?? 24.w;
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: border != null ? Border.all(color: AppColors.whiteColor, width: border) : null, border: border != null ? Border.all(color: AppColors.whiteColor, width: border) : null,
borderRadius: border != null ? BorderRadius.circular(borderRadius ?? 0) : null, borderRadius: border != null ? BorderRadius.circular(borderRadius ?? 0) : null,
), ),
child: Image.asset(icon, width: width, height: height, fit: fit), child: Image.asset(icon, width: iconW, height: iconH, fit: fit),
); );
// return Image.asset(icon, width: width, height: height, fit: fit, ); // return Image.asset(icon, width: width, height: height, fit: fit, );
} }
@ -662,16 +689,17 @@ class Utils {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset(AppAssets.mada, width: 25, height: 25), Image.asset(AppAssets.mada, width: 25.h, height: 25.h),
Image.asset(AppAssets.tamara_en, width: 25, height: 25), Image.asset(AppAssets.tamara_en, width: 25.h, height: 25.h),
Image.asset(AppAssets.visa, width: 25, height: 25), Image.asset(AppAssets.visa, width: 25.h, height: 25.h),
Image.asset(AppAssets.Mastercard, width: 25, height: 25), Image.asset(AppAssets.Mastercard, width: 25.h, height: 25.h),
Image.asset(AppAssets.apple_pay, width: 25, height: 25), Image.asset(AppAssets.apple_pay, width: 25.h, height: 25.h),
], ],
); );
} }
static Widget getPaymentAmountWithSymbol(Widget paymentAmountWidget, Color iconColor, double iconSize, {bool isSaudiCurrency = true, bool isExpanded = true}) { static Widget getPaymentAmountWithSymbol(Widget paymentAmountWidget, Color iconColor, double iconSize,
{bool isSaudiCurrency = true, bool isExpanded = true}) {
return Row( return Row(
mainAxisAlignment: isExpanded ? MainAxisAlignment.spaceBetween : MainAxisAlignment.start, mainAxisAlignment: isExpanded ? MainAxisAlignment.spaceBetween : MainAxisAlignment.start,
children: [ children: [
@ -701,7 +729,11 @@ class Utils {
} }
static Widget getPaymentAmountWithSymbol2(num habibWalletAmount, static Widget getPaymentAmountWithSymbol2(num habibWalletAmount,
{double iconSize = 14, Color iconColor = AppColors.textColor, Color textColor = AppColors.blackColor, bool isSaudiCurrency = true, bool isExpanded = true}) { {double iconSize = 14,
Color iconColor = AppColors.textColor,
Color textColor = AppColors.blackColor,
bool isSaudiCurrency = true,
bool isExpanded = true}) {
return RichText( return RichText(
maxLines: 1, maxLines: 1,
text: TextSpan( text: TextSpan(
@ -713,7 +745,7 @@ class Utils {
), ),
TextSpan( TextSpan(
text: " $habibWalletAmount", text: " $habibWalletAmount",
style: TextStyle(color: textColor, fontSize: 32.fSize, letterSpacing: -4, fontWeight: FontWeight.w600, height: 1), style: TextStyle(color: textColor, fontSize: 32.f, letterSpacing: -4, fontWeight: FontWeight.w600, height: 1),
), ),
], ],
), ),
@ -771,5 +803,4 @@ class Utils {
} }
return isHavePrivilege; return isHavePrivilege;
} }
} }

@ -4,7 +4,6 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:hmg_patient_app_new/core/common_models/nationality_country_model.dart'; import 'package:hmg_patient_app_new/core/common_models/nationality_country_model.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart';
@ -102,7 +101,8 @@ class ValidationUtils {
return regex.hasMatch(id); return regex.hasMatch(id);
} }
static bool validateUaeRegistration({String? name, GenderTypeEnum? gender, NationalityCountries? country, MaritalStatusTypeEnum? maritalStatus, required Function() onOkPress}) { static bool validateUaeRegistration(
{String? name, GenderTypeEnum? gender, NationalityCountries? country, MaritalStatusTypeEnum? maritalStatus, required Function() onOkPress}) {
if (name == null || name.isEmpty) { if (name == null || name.isEmpty) {
_dialogService.showExceptionBottomSheet(message: LocaleKeys.pleaseEnterAValidName.tr(), onOkPressed: onOkPress); _dialogService.showExceptionBottomSheet(message: LocaleKeys.pleaseEnterAValidName.tr(), onOkPressed: onOkPress);
return false; return false;
@ -141,7 +141,8 @@ class ValidationUtils {
return true; return true;
} }
static bool isValidatedIdAndPhoneWithCountryValidation({String? nationalId, String? phoneNumber, required Function() onOkPress, CountryEnum? selectedCountry}) { static bool isValidatedIdAndPhoneWithCountryValidation(
{String? nationalId, String? phoneNumber, required Function() onOkPress, CountryEnum? selectedCountry}) {
bool isCorrectID = true; bool isCorrectID = true;
if (nationalId == null || nationalId.isEmpty) { if (nationalId == null || nationalId.isEmpty) {
_dialogService.showExceptionBottomSheet(message: LocaleKeys.pleaseEnterAnationalID.tr(), onOkPressed: onOkPress); _dialogService.showExceptionBottomSheet(message: LocaleKeys.pleaseEnterAnationalID.tr(), onOkPressed: onOkPress);

@ -5,11 +5,10 @@ extension ContextUtils on BuildContext {
double get screenWidth => MediaQuery.of(this).size.width; double get screenWidth => MediaQuery.of(this).size.width;
EdgeInsets get padding => MediaQuery.of(this).padding; EdgeInsets get padding => MediaQuery.of(this).padding;
bool get safeInsets => padding.top > 0 || padding.bottom > 0 || padding.left > 0 || padding.right > 0; bool get safeInsets => padding.top > 0 || padding.bottom > 0 || padding.left > 0 || padding.right > 0;
ThemeData get theme => Theme.of(this); ThemeData get theme => Theme.of(this);
TextTheme get textTheme => theme.textTheme; TextTheme get textTheme => theme.textTheme;
@ -24,9 +23,18 @@ extension ContextUtils on BuildContext {
} }
extension ShowBottomSheet on BuildContext { extension ShowBottomSheet on BuildContext {
Future<T?> showBottomSheet<T>({isScrollControlled = true, isDismissible = false, required Widget child, Color? backgroundColor, enableDra = false, useSafeArea = false}) { Future<T?> showBottomSheet<T>({
isScrollControlled = true,
isDismissible = false,
required Widget child,
Color? backgroundColor,
enableDra = false,
useSafeArea = false,
BoxConstraints? constraints,
}) {
return showModalBottomSheet<T>( return showModalBottomSheet<T>(
context: this, context: this,
constraints: constraints,
isScrollControlled: isScrollControlled, isScrollControlled: isScrollControlled,
isDismissible: isDismissible, isDismissible: isDismissible,
enableDrag: enableDra, enableDrag: enableDra,

@ -1,23 +1,23 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:intl/intl.dart';
extension CapExtension on String { extension CapExtension on String {
String get toCamelCase => "${this[0].toUpperCase()}${this.substring(1)}"; String get toCamelCase => "${this[0].toUpperCase()}${substring(1)}";
String get inCaps => '${this[0].toUpperCase()}${this.substring(1)}'; String get inCaps => '${this[0].toUpperCase()}${substring(1)}';
String get allInCaps => this.toUpperCase(); String get allInCaps => toUpperCase();
String get needTranslation => this; String get needTranslation => this;
String get capitalizeFirstofEach => this.trim().length > 0 ? this.trim().toLowerCase().split(" ").map((str) => str.inCaps).join(" ") : ""; String get capitalizeFirstofEach => trim().isNotEmpty ? trim().toLowerCase().split(" ").map((str) => str.inCaps).join(" ") : "";
} }
extension EmailValidator on String { extension EmailValidator on String {
@ -28,7 +28,7 @@ extension EmailValidator on String {
maxLines: maxlines, maxLines: maxlines,
overflow: textOverflow, overflow: textOverflow,
style: TextStyle( style: TextStyle(
fontSize: 8.fSize, fontSize: 8.f,
fontStyle: fontStyle ?? FontStyle.normal, fontStyle: fontStyle ?? FontStyle.normal,
fontWeight: isBold ? FontWeight.bold : FontWeight.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
@ -36,12 +36,21 @@ extension EmailValidator on String {
), ),
); );
Widget toText10({Color? color, FontWeight? weight, bool isBold = false, bool isUnderLine = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow, double letterSpacing = 0}) => Text( Widget toText10(
{Color? color,
FontWeight? weight,
bool isBold = false,
bool isUnderLine = false,
int? maxlines,
FontStyle? fontStyle,
TextOverflow? textOverflow,
double letterSpacing = 0}) =>
Text(
this, this,
maxLines: maxlines, maxLines: maxlines,
overflow: textOverflow, overflow: textOverflow,
style: TextStyle( style: TextStyle(
fontSize: 10.fSize, fontSize: 10.f,
fontStyle: fontStyle ?? FontStyle.normal, fontStyle: fontStyle ?? FontStyle.normal,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
@ -50,13 +59,21 @@ extension EmailValidator on String {
decorationColor: color ?? AppColors.blackColor), decorationColor: color ?? AppColors.blackColor),
); );
Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isCenter = false, bool isBold = false, int maxLine = 0, double letterSpacing = 0}) => Text( Widget toText11(
{Color? color,
FontWeight? weight,
bool isUnderLine = false,
bool isCenter = false,
bool isBold = false,
int maxLine = 0,
double letterSpacing = 0}) =>
Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
softWrap: true, softWrap: true,
style: TextStyle( style: TextStyle(
fontSize: 11.fSize, fontSize: 11.f,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
letterSpacing: letterSpacing, letterSpacing: letterSpacing,
@ -65,13 +82,20 @@ extension EmailValidator on String {
); );
Widget toText12( Widget toText12(
{Color? color, bool isUnderLine = false, TextAlign textAlignment = TextAlign.start, bool isBold = false, FontWeight? fontWeight, bool isCenter = false, double? height, int maxLine = 0}) => {Color? color,
bool isUnderLine = false,
TextAlign textAlignment = TextAlign.start,
bool isBold = false,
FontWeight? fontWeight,
bool isCenter = false,
double? height,
int maxLine = 0}) =>
Text( Text(
this, this,
textAlign: isCenter ? TextAlign.center : textAlignment, textAlign: isCenter ? TextAlign.center : textAlignment,
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.f,
fontWeight: fontWeight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: fontWeight ?? (isBold ? FontWeight.bold : FontWeight.normal),
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
letterSpacing: 0, letterSpacing: 0,
@ -87,7 +111,7 @@ extension EmailValidator on String {
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
minFontSize: 8, minFontSize: 8,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.f,
fontWeight: isBold ? FontWeight.bold : FontWeight.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
letterSpacing: 0, letterSpacing: 0,
@ -123,12 +147,20 @@ extension EmailValidator on String {
), ),
); );
Widget toText13({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0, FontWeight? weight, double? letterSpacing = 0}) => Text( Widget toText13(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
int maxLine = 0,
FontWeight? weight,
double? letterSpacing = 0}) =>
Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
maxLines: (maxLine > 0) ? maxLine : null, maxLines: (maxLine > 0) ? maxLine : null,
style: TextStyle( style: TextStyle(
fontSize: 13.fSize, fontSize: 13.f,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
letterSpacing: letterSpacing, letterSpacing: letterSpacing,
@ -152,20 +184,28 @@ extension EmailValidator on String {
overflow: textOverflow, overflow: textOverflow,
style: TextStyle( style: TextStyle(
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
fontSize: 14.fSize, fontSize: 14.f,
letterSpacing: letterSpacing, letterSpacing: letterSpacing,
height: height, height: height,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
decoration: isUnderLine ? TextDecoration.underline : null), decoration: isUnderLine ? TextDecoration.underline : null),
); );
Widget toText15({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, FontWeight? weight, int? maxlines, double? letterSpacing = -1}) => Text( Widget toText15(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
FontWeight? weight,
int? maxlines,
double? letterSpacing = -1}) =>
Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
maxLines: maxlines, maxLines: maxlines,
style: TextStyle( style: TextStyle(
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
fontSize: 15.fSize, fontSize: 15.f,
letterSpacing: letterSpacing, letterSpacing: letterSpacing,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
decoration: isUnderLine ? TextDecoration.underline : null), decoration: isUnderLine ? TextDecoration.underline : null),
@ -189,7 +229,7 @@ extension EmailValidator on String {
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle( style: TextStyle(
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
fontSize: 16.fSize, fontSize: 16.f,
letterSpacing: letterSpacing, letterSpacing: letterSpacing,
height: height, height: height,
overflow: textOverflow, overflow: textOverflow,
@ -201,7 +241,7 @@ extension EmailValidator on String {
Widget toText17({Color? color, bool isBold = false, bool isCenter = false}) => Text( Widget toText17({Color? color, bool isBold = false, bool isCenter = false}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle(color: color ?? AppColors.blackColor, fontSize: 17.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(color: color ?? AppColors.blackColor, fontSize: 17.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toText18({Color? color, FontWeight? weight, bool isBold = false, bool isCenter = false, int? maxlines, TextOverflow? textOverflow}) => Text( Widget toText18({Color? color, FontWeight? weight, bool isBold = false, bool isCenter = false, int? maxlines, TextOverflow? textOverflow}) => Text(
@ -209,35 +249,40 @@ extension EmailValidator on String {
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
this, this,
overflow: textOverflow, overflow: textOverflow,
style: TextStyle(fontSize: 18.fSize, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), color: color ?? AppColors.blackColor, letterSpacing: -0.4), style: TextStyle(
fontSize: 18.f, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), color: color ?? AppColors.blackColor, letterSpacing: -0.4),
); );
Widget toText19({Color? color, bool isBold = false}) => Text( Widget toText19({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle(fontSize: 19.fSize, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: color ?? AppColors.blackColor, letterSpacing: -0.4), style: TextStyle(fontSize: 19.f, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: color ?? AppColors.blackColor, letterSpacing: -0.4),
); );
Widget toText20({Color? color, FontWeight? weight, bool isBold = false}) => Text( Widget toText20({Color? color, FontWeight? weight, bool isBold = false}) => Text(
this, this,
style: TextStyle(fontSize: 20.fSize, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), color: color ?? AppColors.blackColor, letterSpacing: -0.4), style: TextStyle(
fontSize: 20.f, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), color: color ?? AppColors.blackColor, letterSpacing: -0.4),
); );
Widget toText21({Color? color, bool isBold = false, FontWeight? weight, int? maxlines}) => Text( Widget toText21({Color? color, bool isBold = false, FontWeight? weight, int? maxlines}) => Text(
this, this,
maxLines: maxlines, maxLines: maxlines,
style: TextStyle(color: color ?? AppColors.blackColor, fontSize: 21.fSize, letterSpacing: -1, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)), style: TextStyle(
color: color ?? AppColors.blackColor, fontSize: 21.f, letterSpacing: -1, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)),
); );
Widget toText22({Color? color, bool isBold = false, bool isCenter = false}) => Text( Widget toText22({Color? color, bool isBold = false, bool isCenter = false}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle(height: 1, color: color ?? AppColors.blackColor, fontSize: 22.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(
height: 1, color: color ?? AppColors.blackColor, fontSize: 22.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toText24({Color? color, bool isBold = false, bool isCenter = false, FontWeight? fontWeight}) => Text( Widget toText24({Color? color, bool isBold = false, bool isCenter = false, FontWeight? fontWeight}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle(height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.fSize, letterSpacing: -1, fontWeight: fontWeight ?? (isBold ? FontWeight.bold : FontWeight.normal)), style: TextStyle(
height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing}) => Text( Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing}) => Text(
@ -246,7 +291,7 @@ extension EmailValidator on String {
style: TextStyle( style: TextStyle(
height: height ?? 23 / 26, height: height ?? 23 / 26,
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
fontSize: 26.fSize, fontSize: 26.f,
letterSpacing: letterSpacing ?? -1, letterSpacing: letterSpacing ?? -1,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)),
); );
@ -254,18 +299,25 @@ extension EmailValidator on String {
Widget toText28({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text( Widget toText28({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle(height: height ?? 23 / 28, color: color ?? AppColors.blackColor, fontSize: 28.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(
height: height ?? 23 / 28,
color: color ?? AppColors.blackColor,
fontSize: 28.f,
letterSpacing: -1,
fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toText32({Color? color, bool isBold = false, bool isCenter = false}) => Text( Widget toText32({Color? color, bool isBold = false, bool isCenter = false}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle(height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 32.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(
height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 32.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toText44({Color? color, bool isBold = false}) => Text( Widget toText44({Color? color, bool isBold = false}) => Text(
this, this,
style: TextStyle(height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 44.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(
height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 44.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) { Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) {
@ -301,12 +353,14 @@ extension EmailValidator on String {
} }
bool isValidEmail() { bool isValidEmail() {
return RegExp(r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$').hasMatch(this); return RegExp(
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
.hasMatch(this);
} }
String toFormattedDate() { String toFormattedDate() {
String date = this.split("T")[0]; String date = split("T")[0];
String time = this.split("T")[1]; String time = split("T")[1];
var dates = date.split("-"); var dates = date.split("-");
return "${dates[2]} ${getMonth(int.parse(dates[1]))} ${dates[0]} ${DateFormat('hh:mm a').format(DateFormat('hh:mm:ss').parse(time))}"; return "${dates[2]} ${getMonth(int.parse(dates[1]))} ${dates[0]} ${DateFormat('hh:mm a').format(DateFormat('hh:mm:ss').parse(time))}";
} }

@ -1,10 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/animation.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
@ -19,16 +17,16 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart'; import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart';
import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart';
typedef OnDone = void Function(String text); typedef OnDone = void Function(String text);
class ProvidedPinBoxTextAnimation { class ProvidedPinBoxTextAnimation {
static AnimatedSwitcherTransitionBuilder scalingTransition = (child, animation) { static AnimatedSwitcherTransitionBuilder scalingTransition = (child, animation) {
return ScaleTransition( return ScaleTransition(
child: child,
scale: animation, scale: animation,
child: child,
); );
}; };
@ -65,7 +63,7 @@ class OTPWidget extends StatefulWidget {
final EdgeInsets pinBoxOuterPadding; final EdgeInsets pinBoxOuterPadding;
const OTPWidget({ const OTPWidget({
Key? key, super.key,
this.maxLength = 4, this.maxLength = 4,
this.controller, this.controller,
this.pinBoxWidth = 70.0, this.pinBoxWidth = 70.0,
@ -87,7 +85,7 @@ class OTPWidget extends StatefulWidget {
this.pinBoxBorderWidth = 2.0, this.pinBoxBorderWidth = 2.0,
this.pinBoxRadius = 0, this.pinBoxRadius = 0,
this.hideDefaultKeyboard = false, this.hideDefaultKeyboard = false,
}) : super(key: key); });
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -430,7 +428,8 @@ class OTPVerificationScreen extends StatefulWidget {
final Function(String phoneNumber) onResendOTPPressed; final Function(String phoneNumber) onResendOTPPressed;
final bool isFormFamilyFile; final bool isFormFamilyFile;
const OTPVerificationScreen({super.key, required this.phoneNumber, required this.checkActivationCode, required this.onResendOTPPressed, required this.isFormFamilyFile}); const OTPVerificationScreen(
{super.key, required this.phoneNumber, required this.checkActivationCode, required this.onResendOTPPressed, required this.isFormFamilyFile});
@override @override
State<OTPVerificationScreen> createState() => _OTPVerificationScreenState(); State<OTPVerificationScreen> createState() => _OTPVerificationScreenState();
@ -555,7 +554,8 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
LocaleKeys.weHaveSendOTP.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4), LocaleKeys.weHaveSendOTP.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
_getMaskedPhoneNumber().toText15(color: AppColors.inputLabelTextColor, isBold: true), _getMaskedPhoneNumber().toText15(color: AppColors.inputLabelTextColor, isBold: true),
LocaleKeys.via.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4), LocaleKeys.via.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
(widget.isFormFamilyFile ? LoginTypeEnum.sms.displayName : authVM.loginTypeEnum.displayName).toText15(color: AppColors.inputLabelTextColor, isBold: true, letterSpacing: -0.4), (widget.isFormFamilyFile ? LoginTypeEnum.sms.displayName : authVM.loginTypeEnum.displayName)
.toText15(color: AppColors.inputLabelTextColor, isBold: true, letterSpacing: -0.4),
appState.getUserRegistrationPayload.isRegister != null && appState.getUserRegistrationPayload.isRegister == true appState.getUserRegistrationPayload.isRegister != null && appState.getUserRegistrationPayload.isRegister == true
? LocaleKeys.forRegistrationVerification.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4) ? LocaleKeys.forRegistrationVerification.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4)
: LocaleKeys.forLoginVerification.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4), : LocaleKeys.forLoginVerification.tr().toText15(color: AppColors.inputLabelTextColor, letterSpacing: -0.4),
@ -568,7 +568,7 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
maxLength: _otpLength, maxLength: _otpLength,
controller: _otpController, controller: _otpController,
pinBoxWidth: 70.h, pinBoxWidth: 70.h,
pinBoxHeight: 100, pinBoxHeight: 100.h,
pinBoxRadius: 16, pinBoxRadius: 16,
pinBoxBorderWidth: 0, pinBoxBorderWidth: 0,
pinBoxOuterPadding: EdgeInsets.symmetric(horizontal: 4.h), pinBoxOuterPadding: EdgeInsets.symmetric(horizontal: 4.h),
@ -578,7 +578,7 @@ class _OTPVerificationScreenState extends State<OTPVerificationScreen> {
autoFocus: true, autoFocus: true,
onTextChanged: _onOtpChanged, onTextChanged: _onOtpChanged,
pinTextStyle: TextStyle( pinTextStyle: TextStyle(
fontSize: 40.fSize, fontSize: 40.f,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: AppColors.whiteColor, color: AppColors.whiteColor,
), ),

@ -1,8 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/get_tamara_installments_details_response_model.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/appointemnet_filters.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/appointemnet_filters.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/get_tamara_installments_details_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_share_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_share_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart';
@ -29,8 +29,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
List<AppointmentListingFilters> availableFilters = []; List<AppointmentListingFilters> availableFilters = [];
List<AppointmentListingFilters>? selectedFilter = []; List<AppointmentListingFilters>? selectedFilter = [];
bool isDateFilterSelected = false; bool isDateFilterSelected = false;
DateTime? start =null; DateTime? start = null;
DateTime? end =null; DateTime? end = null;
List<PatientAppointmentHistoryResponseModel> patientAppointmentsHistoryList = []; List<PatientAppointmentHistoryResponseModel> patientAppointmentsHistoryList = [];
List<PatientAppointmentHistoryResponseModel> filteredAppointmentList = []; List<PatientAppointmentHistoryResponseModel> filteredAppointmentList = [];
@ -171,40 +171,36 @@ class MyAppointmentsViewModel extends ChangeNotifier {
getFiltersForSelectedAppointmentList(filteredAppointmentList); getFiltersForSelectedAppointmentList(filteredAppointmentList);
} }
void getFiltersForSelectedAppointmentList( void getFiltersForSelectedAppointmentList(List<PatientAppointmentHistoryResponseModel> filteredAppointmentList) {
List<PatientAppointmentHistoryResponseModel> filteredAppointmentList) {
availableFilters.clear(); availableFilters.clear();
if (filteredAppointmentList.isEmpty == true) return; if (filteredAppointmentList.isEmpty == true) return;
availableFilters.add(AppointmentListingFilters.DATESELECTION); availableFilters.add(AppointmentListingFilters.DATESELECTION);
if (filteredAppointmentList if (filteredAppointmentList.any((element) => element.isLiveCareAppointment == true)) {
.any((element) => element.isLiveCareAppointment == true)) {
availableFilters.add(AppointmentListingFilters.LIVECARE); availableFilters.add(AppointmentListingFilters.LIVECARE);
} }
if (filteredAppointmentList if (filteredAppointmentList.any((element) => element.isLiveCareAppointment == false)) {
.any((element) => element.isLiveCareAppointment == false)) {
availableFilters.add(AppointmentListingFilters.WALKIN); availableFilters.add(AppointmentListingFilters.WALKIN);
} }
if (filteredAppointmentList if (filteredAppointmentList.any((element) => AppointmentType.isArrived(element) == true)) {
.any((element) => AppointmentType.isArrived(element) == true)) {
availableFilters.add(AppointmentListingFilters.ARRIVED); availableFilters.add(AppointmentListingFilters.ARRIVED);
} }
if (filteredAppointmentList if (filteredAppointmentList.any((element) => AppointmentType.isBooked(element) == true)) {
.any((element) => AppointmentType.isBooked(element) == true)) {
availableFilters.add(AppointmentListingFilters.BOOKED); availableFilters.add(AppointmentListingFilters.BOOKED);
} }
if (filteredAppointmentList if (filteredAppointmentList.any((element) => AppointmentType.isConfirmed(element) == true)) {
.any((element) => AppointmentType.isConfirmed(element) == true)) {
availableFilters.add(AppointmentListingFilters.CONFIRMED); availableFilters.add(AppointmentListingFilters.CONFIRMED);
} }
notifyListeners(); notifyListeners();
} }
Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, bool isLiveCareAppointment, {Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, bool isLiveCareAppointment,
final result = await myAppointmentsRepo.getPatientShareAppointment(projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo, isLiveCareAppointment: isLiveCareAppointment); {Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getPatientShareAppointment(
projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo, isLiveCareAppointment: isLiveCareAppointment);
result.fold( result.fold(
(failure) async { (failure) async {
@ -230,8 +226,13 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> addAdvanceNumberRequest( Future<void> addAdvanceNumberRequest(
{required String advanceNumber, required String paymentReference, required String appointmentNo, Function(dynamic)? onSuccess, Function(String)? onError}) async { {required String advanceNumber,
final result = await myAppointmentsRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference, appointmentNo: appointmentNo); required String paymentReference,
required String appointmentNo,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result =
await myAppointmentsRepo.addAdvanceNumberRequest(advanceNumber: advanceNumber, paymentReference: paymentReference, appointmentNo: appointmentNo);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -249,8 +250,14 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> generateAppointmentQR( Future<void> generateAppointmentQR(
{required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp, Function(dynamic)? onSuccess, Function(String)? onError}) async { {required int clinicID,
final result = await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp); required int projectID,
required String appointmentNo,
required int isFollowUp,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result =
await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -267,7 +274,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> cancelAppointment(
{required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel); final result = await myAppointmentsRepo.cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold( result.fold(
@ -286,7 +294,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
); );
} }
Future<void> confirmAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> confirmAppointment(
{required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.confirmAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel); final result = await myAppointmentsRepo.confirmAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold( result.fold(
@ -347,7 +356,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
required int checkInType, required int checkInType,
Function(dynamic)? onSuccess, Function(dynamic)? onSuccess,
Function(String)? onError}) async { Function(String)? onError}) async {
final result = await myAppointmentsRepo.sendCheckInNfcRequest(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel, scannedCode: scannedCode, checkInType: checkInType); final result = await myAppointmentsRepo.sendCheckInNfcRequest(
patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel, scannedCode: scannedCode, checkInType: checkInType);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -393,8 +403,12 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
Future<void> insertLiveCareVIDARequest( Future<void> insertLiveCareVIDARequest(
{required clientRequestID, required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async { {required clientRequestID,
final result = await myAppointmentsRepo.insertLiveCareVIDARequest(clientRequestID: clientRequestID, patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel); required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel,
Function(dynamic)? onSuccess,
Function(String)? onError}) async {
final result = await myAppointmentsRepo.insertLiveCareVIDARequest(
clientRequestID: clientRequestID, patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold( result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure), (failure) async => await errorHandlerService.handleError(failure: failure),
@ -441,7 +455,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
return; return;
} }
selectedFilter?.add(availableFilter) ; selectedFilter?.add(availableFilter);
notifyListeners(); notifyListeners();
} }
@ -461,14 +475,14 @@ class MyAppointmentsViewModel extends ChangeNotifier {
if (start == null && end == null) { if (start == null && end == null) {
isDateFilterSelected = false; isDateFilterSelected = false;
filteredAppointmentList.clear(); filteredAppointmentList.clear();
sourceList.forEach((element) { for (var element in sourceList) {
if (isUnderFilter(element)) { if (isUnderFilter(element)) {
filteredAppointmentList.add(element); filteredAppointmentList.add(element);
} }
}); }
} else { } else {
filteredAppointmentList.clear(); filteredAppointmentList.clear();
sourceList.forEach((element) { for (var element in sourceList) {
try { try {
var dateTime = DateUtil.convertStringToDate(element.appointmentDate).provideDateOnly(); var dateTime = DateUtil.convertStringToDate(element.appointmentDate).provideDateOnly();
@ -479,14 +493,14 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
} }
} else if (start != null && end != null) { } else if (start != null && end != null) {
if ((dateTime.isAfter(start)) && ((dateTime.isBefore(end))||((dateTime.isAtSameMomentAs(end))))) { if ((dateTime.isAfter(start)) && ((dateTime.isBefore(end)) || ((dateTime.isAtSameMomentAs(end))))) {
if (isUnderFilter(element)) { if (isUnderFilter(element)) {
filteredAppointmentList.add(element); filteredAppointmentList.add(element);
} }
} }
} }
} catch (e) {} } catch (e) {}
}); }
} }
notifyListeners(); notifyListeners();
} }
@ -496,27 +510,24 @@ class MyAppointmentsViewModel extends ChangeNotifier {
} }
bool isUnderFilter(PatientAppointmentHistoryResponseModel element) { bool isUnderFilter(PatientAppointmentHistoryResponseModel element) {
bool isUnderTheFilter = false;
if (selectedFilter == null || selectedFilter!.isEmpty) return true; if (selectedFilter == null || selectedFilter!.isEmpty) return true;
int count = 0;
for (var filter in selectedFilter ?? []) { for (var filter in selectedFilter ?? []) {
switch (filter) { switch (filter) {
case AppointmentListingFilters.WALKIN: case AppointmentListingFilters.WALKIN:
if (element.isLiveCareAppointment == false) return true; if (element.isLiveCareAppointment == false) return true;
case AppointmentListingFilters.BOOKED: case AppointmentListingFilters.BOOKED:
if (AppointmentType.isBooked(element))return true; if (AppointmentType.isBooked(element)) return true;
case AppointmentListingFilters.CONFIRMED: case AppointmentListingFilters.CONFIRMED:
if (AppointmentType.isConfirmed(element))return true; if (AppointmentType.isConfirmed(element)) return true;
case AppointmentListingFilters.ARRIVED: case AppointmentListingFilters.ARRIVED:
if (AppointmentType.isArrived(element))return true; if (AppointmentType.isArrived(element)) return true;
case AppointmentListingFilters.LIVECARE: case AppointmentListingFilters.LIVECARE:
if (element.isLiveCareAppointment == true) return true; if (element.isLiveCareAppointment == true) return true;
case AppointmentListingFilters.DATESELECTION: case AppointmentListingFilters.DATESELECTION:
} }
} }
return false; return false;

@ -2,7 +2,7 @@
// ignore_for_file: constant_identifier_names // ignore_for_file: constant_identifier_names
abstract class LocaleKeys { abstract class LocaleKeys {
static const english = 'english'; static const english = 'english';
static const arabic = 'arabic'; static const arabic = 'arabic';
static const login = 'login'; static const login = 'login';
@ -876,5 +876,4 @@ abstract class LocaleKeys {
static const walkin = 'walkin'; static const walkin = 'walkin';
static const laserClinic = 'laserClinic'; static const laserClinic = 'laserClinic';
static const continueString = 'continueString'; static const continueString = 'continueString';
} }

@ -1,7 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -22,16 +21,15 @@ import 'package:hmg_patient_app_new/presentation/appointments/appointment_paymen
import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_checkin_bottom_sheet.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_checkin_bottom_sheet.dart';
import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_doctor_card.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_doctor_card.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/presentation/prescriptions/prescription_detail_page.dart'; import 'package:hmg_patient_app_new/presentation/prescriptions/prescription_detail_page.dart';
import 'package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart'; import 'package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart'; import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -170,15 +168,19 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
child: CustomButton( child: CustomButton(
text: "Get Directions".needTranslation, text: "Get Directions".needTranslation,
onPressed: () { onPressed: () {
MapsLauncher.launchCoordinates(double.parse(widget.patientAppointmentHistoryResponseModel.latitude!), MapsLauncher.launchCoordinates(
double.parse(widget.patientAppointmentHistoryResponseModel.longitude!), widget.patientAppointmentHistoryResponseModel.projectName); double.parse(widget.patientAppointmentHistoryResponseModel.latitude!),
double.parse(widget.patientAppointmentHistoryResponseModel.longitude!),
widget.patientAppointmentHistoryResponseModel.projectName);
}, },
backgroundColor: AppColors.textColor.withOpacity(0.8), backgroundColor: AppColors.textColor.withOpacity(0.8),
borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01), borderColor:
AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction)
.withOpacity(0.01),
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,
fontSize: 14, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12.h, borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40.h, height: 40.h,
icon: AppAssets.directions_icon, icon: AppAssets.directions_icon,
@ -235,7 +237,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
"Lab & Radiology".needTranslation.toText18(isBold: true), "Lab & Radiology".needTranslation.toText18(isBold: true),
SizedBox(height: 16.h), SizedBox(height: 16.h),
GridView( GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13.h, mainAxisSpacing: 13.h, childAspectRatio: 7 / 6), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisSpacing: 13.h, mainAxisSpacing: 13.h, childAspectRatio: 7 / 6),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
children: [ children: [
@ -296,13 +299,17 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
children: [ children: [
Column( Column(
children: [ children: [
SizedBox(width: 150.h, child: prescriptionVM.prescriptionDetailsList[index].itemDescription!.toText12(isBold: true, maxLine: 1)), SizedBox(
width: 150.h,
child: prescriptionVM.prescriptionDetailsList[index].itemDescription!
.toText12(isBold: true, maxLine: 1)),
SizedBox( SizedBox(
width: 150.h, width: 150.h,
child: child:
"Prescribed By: ${widget.patientAppointmentHistoryResponseModel.doctorTitle} ${widget.patientAppointmentHistoryResponseModel.doctorNameObj}" "Prescribed By: ${widget.patientAppointmentHistoryResponseModel.doctorTitle} ${widget.patientAppointmentHistoryResponseModel.doctorNameObj}"
.needTranslation .needTranslation
.toText10(weight: FontWeight.w500, color: AppColors.greyTextColor, letterSpacing: -0.4), .toText10(
weight: FontWeight.w500, color: AppColors.greyTextColor, letterSpacing: -0.4),
), ),
], ],
), ),
@ -415,7 +422,8 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Amount before tax".needTranslation.toText18(isBold: true), "Amount before tax".needTranslation.toText18(isBold: true),
Utils.getPaymentAmountWithSymbol(widget.patientAppointmentHistoryResponseModel.patientShare!.toString().toText16(isBold: true), AppColors.blackColor, 13, Utils.getPaymentAmountWithSymbol(
widget.patientAppointmentHistoryResponseModel.patientShare!.toString().toText16(isBold: true), AppColors.blackColor, 13,
isSaudiCurrency: true), isSaudiCurrency: true),
], ],
), ),
@ -423,8 +431,12 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: LocaleKeys.upcomingPaymentNow.tr(context: context).toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor)), Expanded(
"VAT 15%(${widget.patientAppointmentHistoryResponseModel.patientTaxAmount})".needTranslation.toText14(isBold: true, color: AppColors.greyTextColor, letterSpacing: -2), child:
LocaleKeys.upcomingPaymentNow.tr(context: context).toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor)),
"VAT 15%(${widget.patientAppointmentHistoryResponseModel.patientTaxAmount})"
.needTranslation
.toText14(isBold: true, color: AppColors.greyTextColor, letterSpacing: -2),
], ],
), ),
SizedBox(height: 18.h), SizedBox(height: 18.h),
@ -438,7 +450,10 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Utils.getPaymentAmountWithSymbol(widget.patientAppointmentHistoryResponseModel.patientShareWithTax!.toString().toText24(isBold: true), AppColors.blackColor, 17, Utils.getPaymentAmountWithSymbol(
widget.patientAppointmentHistoryResponseModel.patientShareWithTax!.toString().toText24(isBold: true),
AppColors.blackColor,
17,
isSaudiCurrency: true), isSaudiCurrency: true),
], ],
), ),
@ -543,9 +558,15 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
myAppointmentsViewModel.getPatientAppointments(true, false); myAppointmentsViewModel.getPatientAppointments(true, false);
showCommonBottomSheet(context, child: Utils.getSuccessWidget(loadingText: "Appointment Confirmed Successfully".needTranslation), callBackFunc: (str) { showCommonBottomSheet(context, child: Utils.getSuccessWidget(loadingText: "Appointment Confirmed Successfully".needTranslation),
callBackFunc: (str) {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, title: "", height: ResponsiveExtension.screenHeight * 0.3, isCloseButtonVisible: true, isDismissible: false, isFullScreen: false, },
title: "",
height: ResponsiveExtension.screenHeight * 0.3,
isCloseButtonVisible: true,
isDismissible: false,
isFullScreen: false,
isSuccessDialog: true); isSuccessDialog: true);
}); });
// LoaderBottomSheet.hideLoader(); // LoaderBottomSheet.hideLoader();

@ -188,7 +188,6 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
Widget getAppointmentFilters(MyAppointmentsViewModel myAppointmentsVM) { Widget getAppointmentFilters(MyAppointmentsViewModel myAppointmentsVM) {
return SizedBox( return SizedBox(
height: 56.h,
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(

@ -1,5 +1,3 @@
import 'dart:developer';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -94,6 +92,7 @@ class LoginScreenState extends State<LoginScreen> {
), ),
SizedBox(height: 16.h), // Adjusted to sizer unit (approx 16px) SizedBox(height: 16.h), // Adjusted to sizer unit (approx 16px)
CustomButton( CustomButton(
height: 50.h,
text: LocaleKeys.login.tr(), text: LocaleKeys.login.tr(),
icon: AppAssets.login1, icon: AppAssets.login1,
iconColor: Colors.white, iconColor: Colors.white,
@ -117,7 +116,7 @@ class LoginScreenState extends State<LoginScreen> {
text: TextSpan( text: TextSpan(
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14.fSize, // Adjusted to sizer unit fontSize: 14.f, // Adjusted to sizer unit
height: 26 / 16, // This height is a ratio, may need re-evaluation height: 26 / 16, // This height is a ratio, may need re-evaluation
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
@ -128,7 +127,7 @@ class LoginScreenState extends State<LoginScreen> {
text: LocaleKeys.registernow.tr(), text: LocaleKeys.registernow.tr(),
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
fontSize: 14.fSize, // Adjusted to sizer unit fontSize: 14.f, // Adjusted to sizer unit
height: 26 / 16, // Ratio height: 26 / 16, // Ratio
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
recognizer: TapGestureRecognizer() recognizer: TapGestureRecognizer()
@ -142,6 +141,7 @@ class LoginScreenState extends State<LoginScreen> {
), ),
).withVerticalPadding(2), // Adjusted to sizer unit ).withVerticalPadding(2), // Adjusted to sizer unit
), ),
SizedBox(height: 20.h), // Adjusted to sizer unit (approx 14px)
], ],
), ),
), ),
@ -160,6 +160,7 @@ class LoginScreenState extends State<LoginScreen> {
isScrollControlled: true, isScrollControlled: true,
isDismissible: false, isDismissible: false,
useSafeArea: true, useSafeArea: true,
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width),
backgroundColor: AppColors.transparent, backgroundColor: AppColors.transparent,
child: StatefulBuilder(builder: (BuildContext context, StateSetter setModalState) { child: StatefulBuilder(builder: (BuildContext context, StateSetter setModalState) {
return Padding( return Padding(

@ -1,7 +1,7 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
@ -17,11 +17,10 @@ class QuickLogin extends StatefulWidget {
const QuickLogin({super.key, required this.onPressed, this.isDone = false}); const QuickLogin({super.key, required this.onPressed, this.isDone = false});
@override @override
_QuickLogin createState() => _QuickLogin(); QuickLoginState createState() => QuickLoginState();
} }
class _QuickLogin extends State<QuickLogin> { class QuickLoginState extends State<QuickLogin> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
NavigationService navigationService = getIt.get<NavigationService>(); NavigationService navigationService = getIt.get<NavigationService>();
@ -40,99 +39,95 @@ class _QuickLogin extends State<QuickLogin> {
children: [ children: [
widget.isDone widget.isDone
? Column( ? Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
navigationService.pop(); navigationService.pop();
}, },
child: Utils.buildSvgWithAssets(icon: AppAssets.cross_circle)), child: Utils.buildSvgWithAssets(icon: AppAssets.cross_circle)),
], ],
), ),
Utils.showLottie(context: context, assetPath: AppAnimations.checkmark, width: 120, height: 120, repeat: true), Utils.showLottie(context: context, assetPath: AppAnimations.checkmark, width: 120, height: 120, repeat: true),
LocaleKeys.allSet.tr().toText16(textAlign: LocaleKeys.allSet.tr().toText16(textAlign: TextAlign.center, weight: FontWeight.w500)
TextAlign.center, weight: FontWeight.w500) // Text(
// Text( // ' TranslationBase.of(context).allSet',
// ' TranslationBase.of(context).allSet', // textAlign: TextAlign.center,
// textAlign: TextAlign.center, // style: context.dynamicTextStyle(
// style: context.dynamicTextStyle( // fontSize: 16,
// fontSize: 16, // fontWeight: FontWeight.w500,
// fontWeight: FontWeight.w500, // color: Colors.black,
// color: Colors.black, // ),
// ), // ),
// ), ],
], )
)
: Column( : Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.asset( Image.asset(AppAssets.lockIcon, height: 100),
AppAssets.lockIcon, SizedBox(height: 10.h),
height: 101, LocaleKeys.enableQuickLogin.tr().toText26(isBold: true),
), // Text(
const SizedBox(height: 10), // ' TranslationBase.of(context).enableQuickLogin',
LocaleKeys.enableQuickLogin.tr().toText26(isBold: true), // style: context.dynamicTextStyle(
// Text( // fontSize: 26,
// ' TranslationBase.of(context).enableQuickLogin', // fontWeight: FontWeight.bold,
// style: context.dynamicTextStyle( // color: Colors.black,
// fontSize: 26, // ),
// fontWeight: FontWeight.bold, // ),
// color: Colors.black, SizedBox(height: 5.h),
// ), LocaleKeys.enableQuickLogin.tr().toText16(color: AppColors.quickLoginColor),
// ), // Description
const SizedBox(height: 5), // Text(
LocaleKeys.enableQuickLogin.tr().toText16(color: AppColors.quickLoginColor), // 'TranslationBase.of(context).enableMsg',
// Description // style: context.dynamicTextStyle(
// Text( // fontSize: 16,
// 'TranslationBase.of(context).enableMsg', // color: Color(0xFF666666),
// style: context.dynamicTextStyle( // height: 1.5,
// fontSize: 16, // ),
// color: Color(0xFF666666), //),
// height: 1.5, const SizedBox(height: 24),
// ), // Buttons
//), Row(
const SizedBox(height: 24), mainAxisAlignment: MainAxisAlignment.end,
// Buttons children: [
Row( Expanded(
mainAxisAlignment: MainAxisAlignment.end, child: CustomButton(
children: [ text: LocaleKeys.enableQuickLogin.tr(),
Expanded( onPressed: () {
child: CustomButton( widget.onPressed();
text:LocaleKeys.enableQuickLogin.tr(), },
onPressed: () { backgroundColor: Color(0xffED1C2B),
widget.onPressed(); borderColor: Color(0xffED1C2B),
}, textColor: Colors.white,
backgroundColor: Color(0xffED1C2B), icon: AppAssets.apple_finder,
borderColor: Color(0xffED1C2B), )),
textColor: Colors.white, ],
icon:AppAssets.apple_finder, ),
)), SizedBox(
], height: 16,
), ),
SizedBox( Row(
height: 16, mainAxisAlignment: MainAxisAlignment.end,
), children: [
Row( Expanded(
mainAxisAlignment: MainAxisAlignment.end, child: CustomButton(
children: [ text: LocaleKeys.notNow.tr(),
Expanded( onPressed: () {
child: CustomButton( Navigator.pop(context, "true");
text: LocaleKeys.notNow.tr(), },
onPressed: () { backgroundColor: Color(0xffFEE9EA),
Navigator.pop(context, "true"); borderColor: Color(0xffFEE9EA),
}, textColor: Colors.red,
backgroundColor: Color(0xffFEE9EA), // icon: "assets/images/svg/apple-finder.svg",
borderColor: Color(0xffFEE9EA), )),
textColor: Colors.red, ],
// icon: "assets/images/svg/apple-finder.svg", ),
)), ],
], )
),
],
)
], ],
), ),
); );

@ -11,7 +11,6 @@ import 'package:hmg_patient_app_new/core/utils/validation_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/authentication/widgets/otp_verification_screen.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart'; import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart';
@ -79,7 +78,8 @@ class _RegisterNew extends State<RegisterNew> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Utils.showLottie(context: context, assetPath: 'assets/animations/lottie/register.json', width: 200.h, height: 200.h, fit: BoxFit.cover, repeat: true), Utils.showLottie(
context: context, assetPath: 'assets/animations/lottie/register.json', width: 200.h, height: 200.h, fit: BoxFit.cover, repeat: true),
SizedBox(height: 16.h), SizedBox(height: 16.h),
LocaleKeys.prepareToElevate.tr().toText32(isBold: true), LocaleKeys.prepareToElevate.tr().toText32(isBold: true),
SizedBox(height: 24.h), SizedBox(height: 24.h),
@ -149,7 +149,7 @@ class _RegisterNew extends State<RegisterNew> {
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
border: Border.all(color: isTermsAccepted ? AppColors.primaryRedBorderColor : AppColors.greyColor, width: 2.h), border: Border.all(color: isTermsAccepted ? AppColors.primaryRedBorderColor : AppColors.greyColor, width: 2.h),
), ),
child: isTermsAccepted ? Icon(Icons.check, size: 16.fSize, color: Colors.white) : null, child: isTermsAccepted ? Icon(Icons.check, size: 16.f, color: Colors.white) : null,
); );
}, },
), ),
@ -158,7 +158,7 @@ class _RegisterNew extends State<RegisterNew> {
children: [ children: [
Text( Text(
LocaleKeys.iAcceptThe.tr(), LocaleKeys.iAcceptThe.tr(),
style: context.dynamicTextStyle(fontSize: 14.fSize, fontWeight: FontWeight.w500, color: Color(0xFF2E3039)), style: context.dynamicTextStyle(fontSize: 14.f, fontWeight: FontWeight.w500, color: Color(0xFF2E3039)),
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
@ -168,7 +168,7 @@ class _RegisterNew extends State<RegisterNew> {
child: Text( child: Text(
LocaleKeys.termsConditoins.tr(), LocaleKeys.termsConditoins.tr(),
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
fontSize: 14.fSize, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
@ -216,7 +216,7 @@ class _RegisterNew extends State<RegisterNew> {
text: TextSpan( text: TextSpan(
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
color: Colors.black, color: Colors.black,
fontSize: 16.fSize, fontSize: 16.f,
height: 26 / 16, height: 26 / 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
@ -227,7 +227,7 @@ class _RegisterNew extends State<RegisterNew> {
text: LocaleKeys.loginNow.tr(), text: LocaleKeys.loginNow.tr(),
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
fontSize: 16.fSize, fontSize: 16.f,
height: 26 / 16, height: 26 / 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),

@ -62,7 +62,7 @@ class DoctorsFilters extends StatelessWidget{
style:TextStyle( style:TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 27.fSize, fontSize: 27.f,
color: AppColors.textColor, color: AppColors.textColor,
letterSpacing: -1 letterSpacing: -1
) )
@ -72,7 +72,7 @@ class DoctorsFilters extends StatelessWidget{
style:TextStyle( style:TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 14.fSize, fontSize: 14.f,
color: AppColors.errorColor color: AppColors.errorColor
) )
).onPress((){ ).onPress((){
@ -202,7 +202,7 @@ class DoctorsFilters extends StatelessWidget{
style:TextStyle( style:TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 16.fSize, fontSize: 16.f,
color: AppColors.textColor, color: AppColors.textColor,
letterSpacing:-1 letterSpacing:-1
) )

@ -39,7 +39,7 @@ class LaserAppointment extends StatelessWidget {
Text( Text(
LocaleKeys.totalMinutes.tr(), LocaleKeys.totalMinutes.tr(),
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.textColor, color: AppColors.textColor,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -48,7 +48,7 @@ class LaserAppointment extends StatelessWidget {
Text( Text(
"$duration / 90".tr(), "$duration / 90".tr(),
style: TextStyle( style: TextStyle(
fontSize: 16.fSize, fontSize: 16.f,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: AppColors.textColor, color: AppColors.textColor,
letterSpacing: -0.64, letterSpacing: -0.64,

@ -111,7 +111,7 @@ class BodyPartsListing extends StatelessWidget {
.read<BookAppointmentsViewModel>() .read<BookAppointmentsViewModel>()
.getLaserProcedureNameWRTLanguage(parts[index]), .getLaserProcedureNameWRTLanguage(parts[index]),
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xff2B353E), color: Color(0xff2B353E),
letterSpacing: -0.48, letterSpacing: -0.48,

@ -278,7 +278,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 20.fSize, fontSize: 20.f,
), ),
), ),
), ),

@ -15,8 +15,8 @@ import 'package:hmg_patient_app_new/features/book_appointments/models/resp_model
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_profile_page.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_profile_page.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/doctor_card.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/doctor_card.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
@ -132,14 +132,18 @@ class _SelectDoctorPageState extends State<SelectDoctorPage> {
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
curve: Curves.easeInOut, curve: Curves.easeInOut,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration:
RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: DoctorCard( child: DoctorCard(
doctorsListResponseModel: bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index], doctorsListResponseModel: bookAppointmentsVM.isLiveCareSchedule
? bookAppointmentsVM.liveCareDoctorsList[index]
: bookAppointmentsVM.doctorsList[index],
isLoading: false, isLoading: false,
bookAppointmentsViewModel: bookAppointmentsViewModel, bookAppointmentsViewModel: bookAppointmentsViewModel,
).onPress(() async { ).onPress(() async {
bookAppointmentsVM bookAppointmentsVM.setSelectedDoctor(bookAppointmentsVM.isLiveCareSchedule
.setSelectedDoctor(bookAppointmentsVM.isLiveCareSchedule ? bookAppointmentsVM.liveCareDoctorsList[index] : bookAppointmentsVM.doctorsList[index]); ? bookAppointmentsVM.liveCareDoctorsList[index]
: bookAppointmentsVM.doctorsList[index]);
// bookAppointmentsVM.setSelectedDoctor(DoctorsListResponseModel()); // bookAppointmentsVM.setSelectedDoctor(DoctorsListResponseModel());
LoaderBottomSheet.showLoader(); LoaderBottomSheet.showLoader();
await bookAppointmentsVM.getDoctorProfile(onSuccess: (dynamic respData) { await bookAppointmentsVM.getDoctorProfile(onSuccess: (dynamic respData) {

@ -99,11 +99,11 @@ class _AppointmentCalendarState extends State<AppointmentCalendar> {
headerStyle: CalendarHeaderStyle( headerStyle: CalendarHeaderStyle(
backgroundColor: AppColors.scaffoldBgColor, backgroundColor: AppColors.scaffoldBgColor,
textAlign: TextAlign.start, textAlign: TextAlign.start,
textStyle: TextStyle(fontSize: 18.fSize, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.primaryRedColor, fontFamily: "Poppins"), textStyle: TextStyle(fontSize: 18.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.primaryRedColor, fontFamily: "Poppins"),
), ),
viewHeaderStyle: ViewHeaderStyle( viewHeaderStyle: ViewHeaderStyle(
backgroundColor: AppColors.scaffoldBgColor, backgroundColor: AppColors.scaffoldBgColor,
dayTextStyle: TextStyle(fontSize: 14.fSize, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.textColor), dayTextStyle: TextStyle(fontSize: 14.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.textColor),
), ),
view: CalendarView.month, view: CalendarView.month,
todayHighlightColor: Colors.transparent, todayHighlightColor: Colors.transparent,
@ -131,7 +131,7 @@ class _AppointmentCalendarState extends State<AppointmentCalendar> {
showTrailingAndLeadingDates: false, showTrailingAndLeadingDates: false,
appointmentDisplayCount: 1, appointmentDisplayCount: 1,
monthCellStyle: MonthCellStyle( monthCellStyle: MonthCellStyle(
textStyle: TextStyle(fontSize: 19.fSize), textStyle: TextStyle(fontSize: 19.f),
), ),
), ),
onTap: (CalendarTapDetails details) { onTap: (CalendarTapDetails details) {

@ -19,7 +19,6 @@ import 'package:hmg_patient_app_new/features/book_appointments/book_appointments
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart'; import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart';
import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart'; import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart';
import 'package:hmg_patient_app_new/features/insurance/insurance_view_model.dart'; import 'package:hmg_patient_app_new/features/insurance/insurance_view_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_view_model.dart'; import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_view_model.dart';
@ -37,17 +36,12 @@ import 'package:hmg_patient_app_new/presentation/home/widgets/welcome_widget.dar
import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart';
import 'package:hmg_patient_app_new/presentation/profile_settings/profile_settings.dart'; import 'package:hmg_patient_app_new/presentation/profile_settings/profile_settings.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart' show CustomTabBar;
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/routes/spring_page_route_builder.dart'; import 'package:hmg_patient_app_new/widgets/routes/spring_page_route_builder.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:lottie/lottie.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LandingPage extends StatefulWidget { class LandingPage extends StatefulWidget {
@ -139,7 +133,7 @@ class _LandingPageState extends State<LandingPage> {
backgroundColor: Color(0xffFEE9EA), backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA), borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B), textColor: Color(0xffED1C2B),
fontSize: 14, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, borderRadius: 12,
padding: EdgeInsets.fromLTRB(10.h, 0, 10.h, 0), padding: EdgeInsets.fromLTRB(10.h, 0, 10.h, 0),
@ -149,7 +143,7 @@ class _LandingPageState extends State<LandingPage> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
spacing: 12.h, spacing: 12.h,
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.bell, height: 20, width: 20).onPress(() { Utils.buildSvgWithAssets(icon: AppAssets.bell, height: 18.h, width: 18.h).onPress(() {
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: MedicalFilePage(), page: MedicalFilePage(),
@ -157,7 +151,7 @@ class _LandingPageState extends State<LandingPage> {
), ),
); );
}), }),
Utils.buildSvgWithAssets(icon: AppAssets.search_icon, height: 20, width: 20).onPress(() { Utils.buildSvgWithAssets(icon: AppAssets.search_icon, height: 18.h, width: 18.h).onPress(() {
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: MedicalFilePage(), page: MedicalFilePage(),
@ -165,7 +159,7 @@ class _LandingPageState extends State<LandingPage> {
), ),
); );
}), }),
Utils.buildSvgWithAssets(icon: AppAssets.contact_icon, height: 20, width: 20).onPress(() { Utils.buildSvgWithAssets(icon: AppAssets.contact_icon, height: 18.h, width: 18.h).onPress(() {
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: MedicalFilePage(), page: MedicalFilePage(),
@ -216,7 +210,8 @@ class _LandingPageState extends State<LandingPage> {
: myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty : myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty
? myAppointmentsVM.patientAppointmentsHistoryList.length == 1 ? myAppointmentsVM.patientAppointmentsHistoryList.length == 1
? Container( ? Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration:
RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: AppointmentCard( child: AppointmentCard(
patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList.first, patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList.first,
myAppointmentsViewModel: myAppointmentsViewModel, myAppointmentsViewModel: myAppointmentsViewModel,
@ -245,7 +240,8 @@ class _LandingPageState extends State<LandingPage> {
), ),
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration: RoundedRectangleBorder()
.toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
child: AppointmentCard( child: AppointmentCard(
patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList[index], patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList[index],
myAppointmentsViewModel: myAppointmentsViewModel, myAppointmentsViewModel: myAppointmentsViewModel,
@ -258,7 +254,8 @@ class _LandingPageState extends State<LandingPage> {
) )
: Container( : Container(
width: double.infinity, width: double.infinity,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24, hasShadow: true), decoration:
RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24, hasShadow: true),
child: Padding( child: Padding(
padding: EdgeInsets.all(12.h), padding: EdgeInsets.all(12.h),
child: Column( child: Column(
@ -279,11 +276,9 @@ class _LandingPageState extends State<LandingPage> {
backgroundColor: Color(0xffFEE9EA), backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA), borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B), textColor: Color(0xffED1C2B),
fontSize: 14, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, padding: EdgeInsets.fromLTRB(10.h, 0, 10.h, 0),
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40,
icon: AppAssets.add_icon, icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
), ),
@ -406,7 +401,7 @@ class _LandingPageState extends State<LandingPage> {
), ),
); );
}, },
separatorBuilder: (BuildContext cxt, int index) => 0.width, separatorBuilder: (BuildContext cxt, int index) => 10.width,
), ),
), ),
], ],
@ -513,6 +508,7 @@ class _LandingPageState extends State<LandingPage> {
context, context,
title: "", title: "",
isCloseButtonVisible: false, isCloseButtonVisible: false,
child: StatefulBuilder(builder: (context, setState) { child: StatefulBuilder(builder: (context, setState) {
return QuickLogin( return QuickLogin(
isDone: isDone, isDone: isDone,

@ -99,18 +99,17 @@ class PatientInsuranceCardUpdateCard extends StatelessWidget {
CustomButton( CustomButton(
icon: AppAssets.insurance_active_icon, icon: AppAssets.insurance_active_icon,
iconColor: AppColors.whiteColor, iconColor: AppColors.whiteColor,
iconSize: 20.h, iconSize: 20.w,
text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}", text: "${LocaleKeys.updateInsurance.tr(context: context)} ${LocaleKeys.updateInsuranceSubtitle.tr(context: context)}",
onPressed: () {}, onPressed: () {},
backgroundColor: insuranceViewModel.patientInsuranceUpdateResponseModel != null ? AppColors.successColor : AppColors.lightGrayBGColor, backgroundColor: insuranceViewModel.patientInsuranceUpdateResponseModel != null ? AppColors.successColor : AppColors.lightGrayBGColor,
borderColor: AppColors.successColor.withOpacity(0.01), borderColor: AppColors.successColor.withOpacity(0.01),
textColor: AppColors.whiteColor, textColor: AppColors.whiteColor,
fontSize: 16, fontSize: 16.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 56.h, ).paddingSymmetrical(24.w, 0.h),
).paddingSymmetrical(24.h, 0.h),
], ],
); );
} }

@ -55,7 +55,7 @@ class LabOrderResultItem extends StatelessWidget {
child: Text( child: Text(
"${tests?.resultValue} ${tests?.uOM}", "${tests?.resultValue} ${tests?.uOM}",
style: TextStyle( style: TextStyle(
fontSize: 24.fSize, fontSize: 24.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: context.read<LabViewModel>().getColor( color: context.read<LabViewModel>().getColor(
@ -75,7 +75,7 @@ class LabOrderResultItem extends StatelessWidget {
child: Text( child: Text(
"(Reference range ${tests?.referanceRange})".needTranslation, "(Reference range ${tests?.referanceRange})".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: AppColors.greyTextColor, color: AppColors.greyTextColor,

@ -94,7 +94,7 @@ class LabResultDetails extends StatelessWidget {
"${recentLabResult.resultValue} ${recentLabResult.uOM}" ?? "${recentLabResult.resultValue} ${recentLabResult.uOM}" ??
"", "",
style: TextStyle( style: TextStyle(
fontSize: 24.fSize, fontSize: 24.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: context.read<LabViewModel>().getColor( color: context.read<LabViewModel>().getColor(
@ -115,7 +115,7 @@ class LabResultDetails extends StatelessWidget {
child: Text( child: Text(
"(Reference range ${recentLabResult.referanceRange})".needTranslation, "(Reference range ${recentLabResult.referanceRange})".needTranslation,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: AppColors.greyTextColor, color: AppColors.greyTextColor,
@ -252,7 +252,7 @@ class LabResultDetails extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 8.fSize, fontSize: 8.f,
color: AppColors.textColor, color: AppColors.textColor,
), ),
); );
@ -264,7 +264,7 @@ class LabResultDetails extends StatelessWidget {
child: Text( child: Text(
label, label,
style: TextStyle( style: TextStyle(
fontSize: 8.fSize, fontSize: 8.f,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.labelTextColor), color: AppColors.labelTextColor),

@ -24,7 +24,7 @@ class LabHistoryItem extends StatelessWidget{
Text( Text(
dayNameAndDate, dayNameAndDate,
style: TextStyle( style: TextStyle(
fontSize: 14.fSize, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: AppColors.labelTextColor color: AppColors.labelTextColor
@ -33,7 +33,7 @@ class LabHistoryItem extends StatelessWidget{
Text( Text(
result, result,
style: TextStyle( style: TextStyle(
fontSize: 18.fSize, fontSize: 18.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: AppColors.textColor color: AppColors.textColor

@ -8,6 +8,7 @@ import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/core/utils/size_config.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
@ -34,19 +35,19 @@ import 'package:hmg_patient_app_new/presentation/insurance/widgets/insurance_upd
import 'package:hmg_patient_app_new/presentation/insurance/widgets/patient_insurance_card.dart'; import 'package:hmg_patient_app_new/presentation/insurance/widgets/patient_insurance_card.dart';
import 'package:hmg_patient_app_new/presentation/lab/lab_orders_page.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_orders_page.dart';
import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_result_item_view.dart';
import 'package:hmg_patient_app_new/presentation/my_family/my_family.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/presentation/radiology/radiology_orders_page.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/presentation/medical_report/medical_reports_page.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/patient_sickleaves_list_page.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/patient_sickleaves_list_page.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/vaccine_list_page.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/vaccine_list_page.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/widgets/lab_rad_card.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/widgets/lab_rad_card.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/widgets/medical_file_card.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/widgets/medical_file_card.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/widgets/patient_sick_leave_card.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/widgets/patient_sick_leave_card.dart';
import 'package:hmg_patient_app_new/presentation/medical_report/medical_reports_page.dart';
import 'package:hmg_patient_app_new/presentation/my_family/my_family.dart';
import 'package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart'; import 'package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart';
import 'package:hmg_patient_app_new/presentation/radiology/radiology_orders_page.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
@ -61,7 +62,7 @@ import '../prescriptions/prescription_detail_page.dart';
import 'widgets/medical_file_appointment_card.dart'; import 'widgets/medical_file_appointment_card.dart';
class MedicalFilePage extends StatefulWidget { class MedicalFilePage extends StatefulWidget {
MedicalFilePage({super.key}); const MedicalFilePage({super.key});
@override @override
State<MedicalFilePage> createState() => _MedicalFilePageState(); State<MedicalFilePage> createState() => _MedicalFilePageState();
@ -104,15 +105,35 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
title: "Medical File".needTranslation, title: "Medical File".needTranslation,
trailing: Row( trailing: Row(
children: [ children: [
Wrap(spacing: -15, children: [ Wrap(
Utils.buildImgWithAssets(icon: AppAssets.babyGirlImg, width: 32.h, height: 32.h, border: 1.5.h, borderRadius: 50.h), children: [
Utils.buildImgWithAssets(icon: AppAssets.femaleImg, width: 32.h, height: 32.h, border: 1.5.h, borderRadius: 50.h), Utils.buildImgWithAssets(
Utils.buildImgWithAssets(icon: AppAssets.male_img, width: 32.h, height: 32.h, border: 1.5.h, borderRadius: 50.h), icon: AppAssets.babyGirlImg,
]), height: 32.h,
border: 1.5,
fit: BoxFit.contain,
borderRadius: 50.r,
),
Utils.buildImgWithAssets(
icon: AppAssets.femaleImg,
height: 32.h,
border: 1.5,
borderRadius: 50.r,
fit: BoxFit.contain,
),
Utils.buildImgWithAssets(
icon: AppAssets.male_img,
height: 32.h,
border: 1.5,
borderRadius: 50.r,
fit: BoxFit.contain,
),
],
),
SizedBox(width: 4.h), SizedBox(width: 4.h),
Utils.buildSvgWithAssets(icon: AppAssets.arrow_down) Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, height: 22.h, width: 22.w)
], ],
).onPress(() { ).withHorizontalPadding(24.w).onPress(() {
DialogService dialogService = getIt.get<DialogService>(); DialogService dialogService = getIt.get<DialogService>();
dialogService.showFamilyBottomSheetWithoutH( dialogService.showFamilyBottomSheetWithoutH(
label: "Who do you want to book for?".needTranslation, label: "Who do you want to book for?".needTranslation,
@ -140,21 +161,21 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h), padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8.h),
leadingIcon: AppAssets.student_card, leadingIcon: AppAssets.student_card,
).paddingSymmetrical(24.h, 0.0), ).paddingSymmetrical(24.w, 0.0),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Container( Container(
width: double.infinity, width: double.infinity,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r),
child: Padding( child: Padding(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(16.w),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.asset(appState.getAuthenticatedUser()?.gender == 1 ? AppAssets.male_img : AppAssets.femaleImg, width: 56.h, height: 56.h), Image.asset(appState.getAuthenticatedUser()?.gender == 1 ? AppAssets.male_img : AppAssets.femaleImg, width: 56.w, height: 56.h),
SizedBox(width: 8.h), SizedBox(width: 8.w),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -163,12 +184,13 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
SizedBox(height: 4.h), SizedBox(height: 4.h),
Wrap( Wrap(
direction: Axis.horizontal, direction: Axis.horizontal,
spacing: 4.h, spacing: 4.w,
runSpacing: 4.h, runSpacing: 6.w,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.file_icon, icon: AppAssets.file_icon,
labelText: "${LocaleKeys.fileNo.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}", labelText: "${LocaleKeys.fileNo.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}",
labelPadding: EdgeInsetsDirectional.only(end: 6.w),
onChipTap: () { onChipTap: () {
navigationService.pushPage( navigationService.pushPage(
page: FamilyMedicalScreen( page: FamilyMedicalScreen(
@ -181,6 +203,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
icon: AppAssets.checkmark_icon, icon: AppAssets.checkmark_icon,
labelText: LocaleKeys.verified.tr(context: context), labelText: LocaleKeys.verified.tr(context: context),
iconColor: AppColors.successColor, iconColor: AppColors.successColor,
labelPadding: EdgeInsetsDirectional.only(end: 6.w),
), ),
], ],
), ),
@ -203,7 +226,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
icon: AppAssets.blood_icon, icon: AppAssets.blood_icon,
labelText: "Blood: ${appState.getUserBloodGroup}", labelText: "Blood: ${appState.getUserBloodGroup}",
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
labelPadding: EdgeInsetsDirectional.only(start: -4.h, end: 8.h), labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 8.w),
), ),
Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) { Consumer<InsuranceViewModel>(builder: (context, insuranceVM, child) {
return AppCustomChipWidget( return AppCustomChipWidget(
@ -211,9 +234,10 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
labelText: insuranceVM.isInsuranceExpired ? "Insurance Expired".needTranslation : "Insurance Active".needTranslation, labelText: insuranceVM.isInsuranceExpired ? "Insurance Expired".needTranslation : "Insurance Active".needTranslation,
iconColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor, iconColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor,
textColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor, textColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor : AppColors.successColor,
iconSize: 12, iconSize: 12.w,
backgroundColor: insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor.withOpacity(0.1) : AppColors.successColor.withOpacity(0.1), backgroundColor:
labelPadding: EdgeInsetsDirectional.only(start: -4.h, end: 8.h), insuranceVM.isInsuranceExpired ? AppColors.primaryRedColor.withOpacity(0.1) : AppColors.successColor.withOpacity(0.1),
labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 8.w),
); );
}), }),
], ],
@ -221,7 +245,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
], ],
), ),
), ),
).paddingSymmetrical(24.h, 0.0), ).paddingSymmetrical(24.w, 0.0),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Consumer<MedicalFileViewModel>(builder: (context, medicalFileVM, child) { Consumer<MedicalFileViewModel>(builder: (context, medicalFileVM, child) {
return Column( return Column(
@ -238,7 +262,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
onTabChange: (index) { onTabChange: (index) {
medicalFileVM.onTabChanged(index); medicalFileVM.onTabChanged(index);
}, },
).paddingSymmetrical(24.h, 0.0), ).paddingSymmetrical(24.w, 0.0),
SizedBox(height: 24.h), SizedBox(height: 24.h),
getSelectedTabData(medicalFileVM.selectedTabIndex), getSelectedTabData(medicalFileVM.selectedTabIndex),
], ],
@ -309,93 +333,89 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
], ],
), ),
], ],
).paddingSymmetrical(24.h, 0.h).onPress(() { ).paddingSymmetrical(24.w, 0.h).onPress(() {
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: MyAppointmentsPage(), page: MyAppointmentsPage(),
), ),
); );
}), }),
SizedBox(height: 16.h),
Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) { Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) {
return SizedBox( return SizedBox(
height: myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty ? 200.h : 175.h, child: myAppointmentsVM.isMyAppointmentsLoading
child: ListView.separated( ? MedicalFileAppointmentCard(
scrollDirection: Axis.horizontal, patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel(),
padding: EdgeInsets.only(top: 16.h, left: 24.h, right: 24.h, bottom: 0.h), myAppointmentsViewModel: myAppointmentsVM,
shrinkWrap: true, onRescheduleTap: () {},
itemCount: myAppointmentsVM.isMyAppointmentsLoading ? 5 : (myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty ? myAppointmentsVM.patientAppointmentsHistoryList.length : 1), onAskDoctorTap: () {},
itemBuilder: (context, index) { )
return AnimationConfiguration.staggeredList( : myAppointmentsVM.patientAppointmentsHistoryList.isEmpty
position: index, ? Container(
duration: const Duration(milliseconds: 500), padding: EdgeInsets.all(12.w),
child: SlideAnimation( width: MediaQuery.of(context).size.width,
horizontalOffset: 100.0, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r, hasShadow: true),
child: FadeInAnimation( child: Column(
child: AnimatedContainer( children: [
duration: Duration(milliseconds: 300), Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h),
curve: Curves.easeInOut, SizedBox(height: 12.h),
child: myAppointmentsVM.isMyAppointmentsLoading "You do not have any appointments. Please book an appointment".needTranslation.toText12(isCenter: true),
? MedicalFileAppointmentCard( SizedBox(height: 12.h),
patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel(), CustomButton(
myAppointmentsViewModel: myAppointmentsVM, text: LocaleKeys.bookAppo.tr(context: context),
onRescheduleTap: () {}, onPressed: () {
onAskDoctorTap: () {}, Navigator.of(context).push(
) CustomPageRoute(
: myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty page: BookAppointmentPage(),
? MedicalFileAppointmentCard(
patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList[index],
myAppointmentsViewModel: myAppointmentsViewModel,
onRescheduleTap: () {
openDoctorScheduleCalendar(myAppointmentsVM.patientAppointmentsHistoryList[index]);
},
onAskDoctorTap: () {},
)
: Container(
width: MediaQuery.of(context).size.width - 48.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24, hasShadow: true),
child: Padding(
padding: EdgeInsets.all(12.h),
child: Column(
children: [
Utils.buildSvgWithAssets(icon: AppAssets.home_calendar_icon, width: 32.h, height: 32.h),
SizedBox(height: 12.h),
"You do not have any appointments. Please book an appointment".needTranslation.toText12(isCenter: true),
SizedBox(height: 12.h),
CustomButton(
text: LocaleKeys.bookAppo.tr(context: context),
onPressed: () {
Navigator.of(context).push(
CustomPageRoute(
page: BookAppointmentPage(),
),
);
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 14,
fontWeight: FontWeight.w500,
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 40,
icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor,
),
],
),
),
), ),
);
},
backgroundColor: Color(0xffFEE9EA),
borderColor: Color(0xffFEE9EA),
textColor: Color(0xffED1C2B),
fontSize: 14.f,
fontWeight: FontWeight.w500,
borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0),
height: 40.h,
icon: AppAssets.add_icon,
iconColor: AppColors.primaryRedColor,
),
],
),
)
: ListView.separated(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
itemCount: myAppointmentsVM.patientAppointmentsHistoryList.length,
itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
horizontalOffset: 100.0,
child: FadeInAnimation(
child: AnimatedContainer(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
child: MedicalFileAppointmentCard(
patientAppointmentHistoryResponseModel: myAppointmentsVM.patientAppointmentsHistoryList[index],
myAppointmentsViewModel: myAppointmentsViewModel,
onRescheduleTap: () {
openDoctorScheduleCalendar(myAppointmentsVM.patientAppointmentsHistoryList[index]);
},
onAskDoctorTap: () {},
)),
),
),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 12.h),
), ),
), ).paddingSymmetrical(24.w, 0);
),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 12.h),
),
);
}), }),
SizedBox(height: 24.h), SizedBox(height: 24.h),
"Lab & Radiology".needTranslation.toText18(isBold: true).paddingSymmetrical(24.h, 0.h), "Lab & Radiology".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0.h),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(
children: [ children: [
@ -431,27 +451,27 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
}), }),
), ),
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.w, 0.h),
SizedBox(height: 24.h), SizedBox(height: 24.h),
"Active Medications & Prescriptions".needTranslation.toText18(isBold: true).paddingSymmetrical(24.h, 0.h), "Active Medications & Prescriptions".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0.h),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Consumer<PrescriptionsViewModel>(builder: (context, prescriptionVM, child) { Consumer<PrescriptionsViewModel>(builder: (context, prescriptionVM, child) {
return prescriptionVM.isPrescriptionsOrdersLoading return prescriptionVM.isPrescriptionsOrdersLoading
? const MoviesShimmerWidget().paddingSymmetrical(24.h, 0.h) ? const MoviesShimmerWidget().paddingSymmetrical(24.w, 0.h)
: prescriptionVM.patientPrescriptionOrders.isNotEmpty : prescriptionVM.patientPrescriptionOrders.isNotEmpty
? Container( ? Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: Colors.white, color: Colors.white,
borderRadius: 20.h, borderRadius: 12.r,
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(16.h), padding: EdgeInsets.all(16.w),
child: Column( child: Column(
children: [ children: [
ListView.separated( ListView.separated(
itemCount: prescriptionVM.patientPrescriptionOrders.length, itemCount: prescriptionVM.patientPrescriptionOrders.length,
shrinkWrap: true, shrinkWrap: true,
padding: const EdgeInsets.only(left: 0, right: 8), padding: EdgeInsets.only(left: 0, right: 8.w),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList( return AnimationConfiguration.staggeredList(
@ -464,11 +484,11 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
children: [ children: [
Image.network( Image.network(
prescriptionVM.patientPrescriptionOrders[index].doctorImageURL!, prescriptionVM.patientPrescriptionOrders[index].doctorImageURL!,
width: 40.h, width: 40.w,
height: 40.h, height: 40.h,
fit: BoxFit.cover, fit: BoxFit.cover,
).circle(100), ).circle(100.r),
SizedBox(width: 16.h), SizedBox(width: 16.w),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -477,13 +497,16 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
SizedBox(height: 4.h), SizedBox(height: 4.h),
Wrap( Wrap(
direction: Axis.horizontal, direction: Axis.horizontal,
spacing: 3.h, spacing: 3.w,
runSpacing: 4.h, runSpacing: 4.w,
children: [ children: [
AppCustomChipWidget(labelText: prescriptionVM.patientPrescriptionOrders[index].clinicDescription!), AppCustomChipWidget(labelText: prescriptionVM.patientPrescriptionOrders[index].clinicDescription!),
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.doctor_calendar_icon, icon: AppAssets.doctor_calendar_icon,
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(prescriptionVM.patientPrescriptionOrders[index].appointmentDate), false), labelText: DateUtil.formatDateToDate(
DateUtil.convertStringToDate(prescriptionVM.patientPrescriptionOrders[index].appointmentDate),
false,
),
), ),
], ],
), ),
@ -494,7 +517,11 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Transform.flip( Transform.flip(
flipX: appState.isArabic(), flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets( child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon_small, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor)), icon: AppAssets.forward_arrow_icon_small,
width: 15.w,
height: 15.h,
fit: BoxFit.contain,
iconColor: AppColors.textColor)),
], ],
).onPress(() { ).onPress(() {
prescriptionVM.setPrescriptionsDetailsLoading(); prescriptionVM.setPrescriptionsDetailsLoading();
@ -510,9 +537,9 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
}, },
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
), ),
SizedBox(height: 16.h), SizedBox(height: 24.h),
const Divider(color: AppColors.dividerColor), const Divider(color: AppColors.dividerColor),
SizedBox(height: 16.h), SizedBox(height: 24.h),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -528,16 +555,16 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
backgroundColor: AppColors.secondaryLightRedColor, backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor, textColor: AppColors.primaryRedColor,
fontSize: 12, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12.h, borderRadius: 12.r,
height: 40.h, height: 56.h,
icon: AppAssets.requests, icon: AppAssets.requests,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
iconSize: 16.h, iconSize: 16.w,
), ),
), ),
SizedBox(width: 10.h), SizedBox(width: 10.w),
Expanded( Expanded(
child: CustomButton( child: CustomButton(
text: "All Medications".needTranslation, text: "All Medications".needTranslation,
@ -545,10 +572,10 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
backgroundColor: AppColors.secondaryLightRedColor, backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor, textColor: AppColors.primaryRedColor,
fontSize: 12, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12.h, borderRadius: 12.h,
height: 40.h, height: 56.h,
icon: AppAssets.all_medications_icon, icon: AppAssets.all_medications_icon,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
iconSize: 16.h, iconSize: 16.h,
@ -559,15 +586,21 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
], ],
), ),
), ),
).paddingSymmetrical(24.h, 0.h) ).paddingSymmetrical(24.w, 0.h)
: Container( : Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 20.h, borderRadius: 12.r,
hasShadow: false, hasShadow: false,
), ),
child: Utils.getNoDataWidget(context, noDataText: "You don't have any prescriptions yet.".needTranslation, isSmallWidget: true, width: 62, height: 62)) child: Utils.getNoDataWidget(
.paddingSymmetrical(24.h, 0.h); context,
noDataText: "You don't have any prescriptions yet.".needTranslation,
isSmallWidget: true,
width: 62.w,
height: 62.h,
),
).paddingSymmetrical(24.w, 0.h);
}), }),
SizedBox(height: 24.h), SizedBox(height: 24.h),
//My Doctor Section //My Doctor Section
@ -578,7 +611,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Row( Row(
children: [ children: [
LocaleKeys.viewAll.tr().toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500), LocaleKeys.viewAll.tr().toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500),
SizedBox(width: 2.h), SizedBox(width: 2.w),
Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h), Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
], ],
).onPress(() { ).onPress(() {
@ -590,58 +623,63 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
); );
}), }),
], ],
).paddingSymmetrical(24.h, 0.h), ).paddingSymmetrical(24.w, 0.h),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) { Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) {
return SizedBox( return myAppointmentsVM.isPatientMyDoctorsLoading
height: 120.h, ? Column(
child: ListView.separated( crossAxisAlignment: CrossAxisAlignment.center,
scrollDirection: Axis.horizontal, children: [
itemCount: myAppointmentsVM.isPatientMyDoctorsLoading Image.network(
? 5 "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
: myAppointmentsVM.patientMyDoctorsList.isNotEmpty width: 64.w,
? myAppointmentsVM.patientMyDoctorsList.length height: 64.h,
: 1, fit: BoxFit.cover,
shrinkWrap: true, ).circle(100).toShimmer2(isShow: true, radius: 50.r),
padding: EdgeInsets.only(left: 24.h, right: 24.h), SizedBox(height: 8.h),
itemBuilder: (context, index) { ("Dr. John Smith Smith Smith").toString().toText12(fontWeight: FontWeight.w500, isCenter: true, maxLine: 2).toShimmer2(isShow: true),
return myAppointmentsVM.isPatientMyDoctorsLoading ],
? SizedBox( )
width: 80.h, : myAppointmentsVM.patientMyDoctorsList.isEmpty
child: Column( ? Container(
crossAxisAlignment: CrossAxisAlignment.center, width: SizeConfig.screenWidth,
children: [ decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
Image.network( color: AppColors.whiteColor,
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", borderRadius: 12.r,
width: 64.h, hasShadow: false,
height: 64.h, ),
fit: BoxFit.cover, child: Utils.getNoDataWidget(
).circle(100).toShimmer2(isShow: true, radius: 50.h), context,
SizedBox(height: 8.h), noDataText: "You don't have any completed visits yet".needTranslation,
Expanded( isSmallWidget: true,
child: ("Dr. John Smith Smith Smith").toString().toText12(fontWeight: FontWeight.w500, isCenter: true, maxLine: 2).toShimmer2(isShow: true), width: 62.w,
), height: 62.h,
], ),
), ).paddingSymmetrical(24.w, 0.h)
) : SizedBox(
: myAppointmentsVM.patientMyDoctorsList.isNotEmpty height: 200.h,
? AnimationConfiguration.staggeredList( child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: myAppointmentsVM.patientMyDoctorsList.length,
shrinkWrap: true,
itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList(
position: index, position: index,
duration: const Duration(milliseconds: 1000), duration: const Duration(milliseconds: 1000),
child: SlideAnimation( child: SlideAnimation(
horizontalOffset: 100.0, horizontalOffset: 100.0,
child: FadeInAnimation( child: FadeInAnimation(
child: SizedBox( child: SizedBox(
width: 80.h, // width: 80.w,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Image.network( Image.network(
myAppointmentsVM.patientMyDoctorsList[index].doctorImageURL!, myAppointmentsVM.patientMyDoctorsList[index].doctorImageURL!,
width: 64.h, width: 64.w,
height: 64.h, height: 64.h,
fit: BoxFit.cover, fit: BoxFit.cover,
).circle(100).toShimmer2(isShow: false, radius: 50.h), ).circle(100).toShimmer2(isShow: false, radius: 50.r),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Expanded( Expanded(
child: (myAppointmentsVM.patientMyDoctorsList[index].doctorName) child: (myAppointmentsVM.patientMyDoctorsList[index].doctorName)
@ -678,29 +716,21 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
}), }),
), ),
), ),
) );
: Container( },
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 8.h),
color: AppColors.whiteColor, ),
borderRadius: 20.h, );
hasShadow: false,
),
child: Utils.getNoDataWidget(context, noDataText: "You don't have any completed visits yet.".needTranslation, isSmallWidget: true, width: 62, height: 62),
).paddingSymmetrical(24.h, 0.h);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 8.h),
),
);
}), }),
SizedBox(height: 24.h), SizedBox(height: 24.h),
"Others".needTranslation.toText18(isBold: true).paddingSymmetrical(24.h, 0.h), "Others".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0.h),
SizedBox(height: 16.h), SizedBox(height: 16.h),
GridView( GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, crossAxisCount: 3,
crossAxisSpacing: 16, crossAxisSpacing: 16.h,
mainAxisSpacing: 16, mainAxisSpacing: 16.w,
mainAxisExtent: 130, mainAxisExtent: 130.h,
), ),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
@ -712,15 +742,15 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.eye_result_icon, svgIcon: AppAssets.eye_result_icon,
isLargeText: true, isLargeText: true,
iconSize: 36.h, iconSize: 36.w,
), ),
MedicalFileCard( MedicalFileCard(
label: "Allergy Info".needTranslation, label: "Allergy Info".needTranslation,
textColor: AppColors.blackColor, textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.allergy_info_icon, svgIcon: AppAssets.allergy_info_icon,
isLargeText: true, isLargeText: true,
iconSize: 36.h, iconSize: 36.w,
), ),
MedicalFileCard( MedicalFileCard(
label: "Vaccine Info".needTranslation, label: "Vaccine Info".needTranslation,
@ -728,7 +758,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.vaccine_info_icon, svgIcon: AppAssets.vaccine_info_icon,
isLargeText: true, isLargeText: true,
iconSize: 36.h, iconSize: 36.w,
).onPress(() { ).onPress(() {
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
@ -737,7 +767,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
); );
}), }),
], ],
).paddingSymmetrical(24.h, 0.0), ).paddingSymmetrical(24.w, 0.0),
SizedBox(height: 24.h), SizedBox(height: 24.h),
], ],
); );
@ -752,7 +782,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
labOrder: null, labOrder: null,
index: index, index: index,
isLoading: true, isLoading: true,
).paddingSymmetrical(24.h, 0.0) ).paddingSymmetrical(24.w, 0.0)
: insuranceVM.patientInsuranceList.isNotEmpty : insuranceVM.patientInsuranceList.isNotEmpty
? PatientInsuranceCard( ? PatientInsuranceCard(
insuranceCardDetailsModel: insuranceVM.patientInsuranceList.first, insuranceCardDetailsModel: insuranceVM.patientInsuranceList.first,
@ -763,15 +793,15 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
: Container( : Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 20.h, borderRadius: 12.r,
hasShadow: false, hasShadow: false,
), ),
child: Utils.getNoDataWidget( child: Utils.getNoDataWidget(
context, context,
noDataText: "You don't have insurance registered with HMG.".needTranslation, noDataText: "You don't have insurance registered with HMG.".needTranslation,
isSmallWidget: true, isSmallWidget: true,
width: 62, width: 62.w,
height: 62, height: 62.h,
callToActionButton: CustomButton( callToActionButton: CustomButton(
icon: AppAssets.update_insurance_card_icon, icon: AppAssets.update_insurance_card_icon,
iconColor: AppColors.successColor, iconColor: AppColors.successColor,
@ -781,53 +811,51 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true); insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true);
insuranceViewModel.getPatientInsuranceDetailsForUpdate( insuranceViewModel.getPatientInsuranceDetailsForUpdate(
appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString()); appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString());
showCommonBottomSheetWithoutHeight(context, child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false); showCommonBottomSheetWithoutHeight(context,
child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false);
}, },
backgroundColor: AppColors.bgGreenColor.withOpacity(0.20), backgroundColor: AppColors.bgGreenColor.withOpacity(0.20),
borderColor: AppColors.bgGreenColor.withOpacity(0.0), borderColor: AppColors.bgGreenColor.withOpacity(0.0),
textColor: AppColors.bgGreenColor, textColor: AppColors.bgGreenColor,
fontSize: 14, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
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: 56.h,
).paddingOnly(left: 12.h, right: 12.h, bottom: 12.h), ).paddingOnly(left: 12.w, right: 12.w, bottom: 12.h),
), ),
).paddingSymmetrical(24.h, 0.h); ).paddingSymmetrical(24.w, 0.h);
}), }),
SizedBox(height: 10.h), SizedBox(height: 10.h),
GridView( GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, crossAxisCount: 3,
crossAxisSpacing: 16, crossAxisSpacing: 16.h,
mainAxisSpacing: 16, mainAxisSpacing: 16.w,
mainAxisExtent: 140, mainAxisExtent: 150.h,
), ),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(top: 12), padding: EdgeInsets.only(top: 12.h),
shrinkWrap: true, shrinkWrap: true,
children: [ children: [
MedicalFileCard( MedicalFileCard(
label: "Update Insurance".needTranslation, label: "Update Insurance".needTranslation,
textColor: AppColors.blackColor, textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.eye_result_icon, svgIcon: AppAssets.eye_result_icon,
isLargeText: true, isLargeText: true,
iconSize: 36.h) iconSize: 36.w,
.onPress(() { ).onPress(() {
Navigator.of(context).push( Navigator.of(context).push(CustomPageRoute(page: InsuranceHomePage()));
CustomPageRoute(
page: InsuranceHomePage(),
),
);
}), }),
MedicalFileCard( MedicalFileCard(
label: "${LocaleKeys.insurance.tr(context: context)} ${LocaleKeys.approvals.tr(context: context)}", label: "${LocaleKeys.insurance.tr(context: context)} ${LocaleKeys.approvals.tr(context: context)}",
textColor: AppColors.blackColor, textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.eye_result_icon, svgIcon: AppAssets.eye_result_icon,
isLargeText: true, isLargeText: true,
iconSize: 36.h).onPress(() { iconSize: 36.w,
).onPress(() {
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: InsuranceApprovalsPage(), page: InsuranceApprovalsPage(),
@ -835,21 +863,21 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
); );
}), }),
MedicalFileCard( MedicalFileCard(
label: "My Invoices List".needTranslation, label: "My Invoices List".needTranslation,
textColor: AppColors.blackColor, textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.eye_result_icon, svgIcon: AppAssets.eye_result_icon,
isLargeText: true, isLargeText: true,
iconSize: 36.h), iconSize: 36.w),
MedicalFileCard( MedicalFileCard(
label: "Ancillary Orders List".needTranslation, label: "Ancillary Orders List".needTranslation,
textColor: AppColors.blackColor, textColor: AppColors.blackColor,
backgroundColor: AppColors.whiteColor, backgroundColor: AppColors.whiteColor,
svgIcon: AppAssets.eye_result_icon, svgIcon: AppAssets.eye_result_icon,
isLargeText: true, isLargeText: true,
iconSize: 36.h), iconSize: 36.w),
], ],
).paddingSymmetrical(24.h, 0.0), ).paddingSymmetrical(24.w, 0.0),
SizedBox(height: 16.h), SizedBox(height: 16.h),
], ],
); );
@ -862,34 +890,34 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
? PatientSickLeaveCard( ? PatientSickLeaveCard(
patientSickLeavesResponseModel: PatientSickLeavesResponseModel(), patientSickLeavesResponseModel: PatientSickLeavesResponseModel(),
isLoading: true, isLoading: true,
).paddingSymmetrical(24.h, 0.0) ).paddingSymmetrical(24.w, 0.0)
: medicalFileVM.patientSickLeaveList.isNotEmpty : medicalFileVM.patientSickLeaveList.isNotEmpty
? PatientSickLeaveCard( ? PatientSickLeaveCard(
patientSickLeavesResponseModel: medicalFileVM.patientSickLeaveList.first, patientSickLeavesResponseModel: medicalFileVM.patientSickLeaveList.first,
isLoading: false, isLoading: false,
).paddingSymmetrical(24.h, 0.0) ).paddingSymmetrical(24.w, 0.0)
: Container( : Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 20.h, borderRadius: 12.r,
hasShadow: false, hasShadow: false,
), ),
child: Utils.getNoDataWidget( child: Utils.getNoDataWidget(
context, context,
noDataText: "You don't have any sick leaves yet.".needTranslation, noDataText: "You don't have any sick leaves yet.".needTranslation,
isSmallWidget: true, isSmallWidget: true,
width: 62, width: 62.w,
height: 62, height: 62.h,
), ),
).paddingSymmetrical(24.h, 0.h); ).paddingSymmetrical(24.w, 0.h);
}), }),
SizedBox(height: 16.h), SizedBox(height: 16.h),
GridView( GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, crossAxisCount: 3,
crossAxisSpacing: 16, crossAxisSpacing: 16.h,
mainAxisSpacing: 16, mainAxisSpacing: 16.w,
mainAxisExtent: 140, mainAxisExtent: 140.h,
), ),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
@ -934,7 +962,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
); );
}), }),
], ],
).paddingSymmetrical(24.h, 0.0), ).paddingSymmetrical(24.w, 0.0),
SizedBox(height: 24.h), SizedBox(height: 24.h),
], ],
); );
@ -944,9 +972,4 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
return Container(); return Container();
} }
} }
getMember() {
// AuthanticationViewModel authanticationViewModel = getIt.get<AuthanticationViewModel>();
// RequestUtils.getAddFamilyRequest(nationalIDorFile: nationalIDorFile, mobileNo: mobileNo, countryCode: countryCode, loginType: loginType);
}
} }

@ -9,18 +9,25 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
class LabRadCard extends StatelessWidget { class LabRadCard extends StatelessWidget {
LabRadCard({super.key, required this.icon, required this.labelText, required this.labOrderTests, required this.isLoading}); const LabRadCard({
super.key,
required this.icon,
required this.labelText,
required this.labOrderTests,
required this.isLoading,
});
String icon; final String icon;
String labelText; final String labelText;
List<String> labOrderTests = []; final List<String> labOrderTests;
bool isLoading;
final bool isLoading;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>(); AppState appState = getIt.get<AppState>();
return Container( return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: false), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 12.r, hasShadow: false),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -28,12 +35,12 @@ class LabRadCard extends StatelessWidget {
children: [ children: [
Utils.buildSvgWithAssets( Utils.buildSvgWithAssets(
icon: icon, icon: icon,
width: 40.h, width: 40.w,
height: 40.h, height: 40.h,
fit: BoxFit.contain, fit: BoxFit.contain,
).toShimmer2(isShow: false, radius: 12.h), ).toShimmer2(isShow: false, radius: 12.r),
SizedBox(width: 8.h), SizedBox(width: 8.w),
labelText.toText13(isBold: true).toShimmer2(isShow: false, radius: 6.h, height: 32.h), Flexible(child: labelText.toText14(isBold: true).toShimmer2(isShow: false, radius: 6.r, height: 32.h)),
], ],
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
@ -43,13 +50,19 @@ class LabRadCard extends StatelessWidget {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (cxt, index) { itemBuilder: (cxt, index) {
return labOrderTests[index].toText12(isBold: true, maxLine: 1).toShimmer2(isShow: false, radius: 6.h, height: 24.h, width: 120.h).toShimmer2(isShow: isLoading); return labOrderTests[index]
.toText12(isBold: true, maxLine: 1)
.toShimmer2(isShow: false, radius: 6.r, height: 24.h, width: 120.w)
.toShimmer2(isShow: isLoading);
}, },
separatorBuilder: (cxt, index) => SizedBox(height: 8.h), separatorBuilder: (cxt, index) => SizedBox(height: 8.h),
itemCount: 3, itemCount: 3,
) )
: "You don't have any records yet".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor, isCenter: true), : "You don't have any records yet".needTranslation.toText13(
color: AppColors.greyTextColor,
isCenter: true,
),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -57,13 +70,14 @@ class LabRadCard extends StatelessWidget {
SizedBox.shrink(), SizedBox.shrink(),
Transform.flip( Transform.flip(
flipX: appState.isArabic(), flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon_small, width: 15.h, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor) child: Utils.buildSvgWithAssets(
.toShimmer2(isShow: false, radius: 12.h), icon: AppAssets.forward_arrow_icon_small, width: 15.w, height: 15.h, fit: BoxFit.contain, iconColor: AppColors.textColor)
.toShimmer2(isShow: false, radius: 12.r),
), ),
], ],
) )
], ],
).paddingAll(16.h), ).paddingAll(16.w),
); );
} }
} }

@ -17,16 +17,20 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
class MedicalFileAppointmentCard extends StatelessWidget { class MedicalFileAppointmentCard extends StatelessWidget {
MedicalFileAppointmentCard({super.key, required this.patientAppointmentHistoryResponseModel, required this.myAppointmentsViewModel, required this.onRescheduleTap, required this.onAskDoctorTap}); final PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel;
final MyAppointmentsViewModel myAppointmentsViewModel;
final Function onRescheduleTap;
final Function onAskDoctorTap;
PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel; const MedicalFileAppointmentCard({
MyAppointmentsViewModel myAppointmentsViewModel; super.key,
required this.patientAppointmentHistoryResponseModel,
late Function onRescheduleTap; required this.myAppointmentsViewModel,
late Function onAskDoctorTap; required this.onRescheduleTap,
required this.onAskDoctorTap,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,19 +40,21 @@ class MedicalFileAppointmentCard extends StatelessWidget {
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(
richText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false) richText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)
.toText12(color: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, fontWeight: FontWeight.w500) .toText12(
.paddingOnly(left: 8.h), color: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor,
fontWeight: FontWeight.w500)
.paddingOnly(left: 8.w),
icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon, icon: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppAssets.appointment_calendar_icon : AppAssets.alarm_clock_icon,
iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, iconColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor,
iconSize: 16.h, iconSize: 16.w,
backgroundColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.greyColor : AppColors.secondaryLightRedColor, backgroundColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.greyColor : AppColors.secondaryLightRedColor,
textColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor, textColor: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) ? AppColors.textColor : AppColors.primaryRedColor,
padding: EdgeInsets.only(top: 12.h, bottom: 12.h, left: 8.h, right: 8.h), padding: EdgeInsets.only(top: 12.h, bottom: 12.h, left: 8.w, right: 8.w),
).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), ).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Container( Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true),
width: 200.h, width: 200.w,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -56,16 +62,18 @@ class MedicalFileAppointmentCard extends StatelessWidget {
children: [ children: [
Image.network( Image.network(
patientAppointmentHistoryResponseModel.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", patientAppointmentHistoryResponseModel.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
width: 25.h, width: 25.w,
height: 27.h, height: 27.h,
fit: BoxFit.fill, fit: BoxFit.fill,
).circle(100).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), ).circle(100).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading),
SizedBox(width: 8.h), SizedBox(width: 8.w),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(patientAppointmentHistoryResponseModel.doctorNameObj ?? "").toText14(isBold: true, maxlines: 1).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), (patientAppointmentHistoryResponseModel.doctorNameObj ?? "")
.toText14(isBold: true, maxlines: 1)
.toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading),
(patientAppointmentHistoryResponseModel.clinicName ?? "") (patientAppointmentHistoryResponseModel.clinicName ?? "")
.toText12(maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor) .toText12(maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor)
.toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), .toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading),
@ -78,7 +86,7 @@ class MedicalFileAppointmentCard extends StatelessWidget {
Row( Row(
children: [ children: [
myAppointmentsViewModel.isMyAppointmentsLoading myAppointmentsViewModel.isMyAppointmentsLoading
? Container().toShimmer2(isShow: true, height: 40.h, width: 100.h, radius: 12.h) ? Container().toShimmer2(isShow: true, height: 40.h, width: 100.w, radius: 12.r)
: Expanded( : Expanded(
flex: 6, flex: 6,
child: AppointmentType.isArrived(patientAppointmentHistoryResponseModel) child: AppointmentType.isArrived(patientAppointmentHistoryResponseModel)
@ -95,37 +103,38 @@ class MedicalFileAppointmentCard extends StatelessWidget {
// widget.myAppointmentsViewModel.getPatientAppointments(true, false); // widget.myAppointmentsViewModel.getPatientAppointments(true, false);
}); });
}, },
backgroundColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.15), backgroundColor:
AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.15),
borderColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01), borderColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01),
textColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction), textColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction),
fontSize: 14, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), padding: EdgeInsets.symmetric(horizontal: 10.w),
height: 40.h, height: 40.h,
icon: AppointmentType.getNextActionIcon(patientAppointmentHistoryResponseModel.nextAction), icon: AppointmentType.getNextActionIcon(patientAppointmentHistoryResponseModel.nextAction),
iconColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction), iconColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction),
iconSize: 14.h, iconSize: 14.h,
).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), ).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading),
), ),
SizedBox(width: 8.h), SizedBox(width: 8.w),
Expanded( Expanded(
flex: 2, flex: 2,
child: Container( child: Container(
height: 40.h, height: 40.h,
width: 40.h, width: 40.w,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.textColor, color: AppColors.textColor,
borderRadius: 10.h, borderRadius: 10.r,
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.w),
child: Transform.flip( child: Transform.flip(
flipX: appState.isArabic(), flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets( child: Utils.buildSvgWithAssets(
iconColor: AppColors.whiteColor, iconColor: AppColors.whiteColor,
icon: AppAssets.forward_arrow_icon_small, icon: AppAssets.forward_arrow_icon_small,
width: 40.h, width: 40.w,
height: 40.h, height: 40.h,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
@ -147,7 +156,7 @@ class MedicalFileAppointmentCard extends StatelessWidget {
], ],
), ),
], ],
).paddingAll(16.h), ).paddingAll(16.w),
), ),
], ],
); );
@ -163,8 +172,8 @@ class MedicalFileAppointmentCard extends StatelessWidget {
textColor: AppColors.primaryRedColor, textColor: AppColors.primaryRedColor,
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), padding: EdgeInsets.symmetric(horizontal: 10.w),
height: 40.h, height: 40.h,
icon: AppAssets.ask_doctor_icon, icon: AppAssets.ask_doctor_icon,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
@ -178,10 +187,10 @@ class MedicalFileAppointmentCard extends StatelessWidget {
backgroundColor: AppColors.greyColor, backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor, borderColor: AppColors.greyColor,
textColor: AppColors.blackColor, textColor: AppColors.blackColor,
fontSize: 14, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12, borderRadius: 12.r,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0), padding: EdgeInsets.symmetric(horizontal: 10.w),
height: 40.h, height: 40.h,
icon: AppAssets.rebook_appointment_icon, icon: AppAssets.rebook_appointment_icon,
iconColor: AppColors.blackColor, iconColor: AppColors.blackColor,

@ -9,32 +9,34 @@ class MedicalFileCard extends StatelessWidget {
final Color textColor; final Color textColor;
final Color backgroundColor; final Color backgroundColor;
final String svgIcon; final String svgIcon;
final num iconSize; final double? iconSize;
bool isLargeText; final bool isLargeText;
MedicalFileCard({ const MedicalFileCard({
super.key,
required this.label, required this.label,
required this.textColor, required this.textColor,
required this.backgroundColor, required this.backgroundColor,
this.svgIcon = "", this.svgIcon = "",
this.iconSize = 30, this.iconSize,
this.isLargeText = false this.isLargeText = false,
}); });
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final iconS = iconSize ?? 30.w;
return Container( return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: backgroundColor, color: backgroundColor,
borderRadius: 20, borderRadius: 12.r,
), ),
child: Padding( child: Padding(
padding: EdgeInsets.all(12.h), padding: EdgeInsets.all(12.w),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Utils.buildSvgWithAssets(icon: svgIcon, width: iconSize.h, height: iconSize.h, fit: BoxFit.contain), Utils.buildSvgWithAssets(icon: svgIcon, width: iconS, height: iconS, fit: BoxFit.contain),
SizedBox(height: 12.h), SizedBox(height: 12.h),
isLargeText ? label.toText13(color: textColor, isBold: true, maxLine: 2) : label.toText11(color: textColor, isBold: true, maxLine: 2), isLargeText ? label.toText13(color: textColor, isBold: true, maxLine: 2) : label.toText11(color: textColor, isBold: true, maxLine: 2),
], ],

@ -73,9 +73,8 @@ class _FamilyMedicalScreenState extends State<FamilyMedicalScreen> {
}); });
}, },
icon: AppAssets.add_icon, icon: AppAssets.add_icon,
height: 56.h, fontSize: 16.f,
fontSize: 16, borderRadius: 12.r,
borderRadius: 12.h,
fontWeight: FontWeight.w500)) fontWeight: FontWeight.w500))
: SizedBox(), : SizedBox(),
child: Column( child: Column(

@ -4,7 +4,6 @@ import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/cache_consts.dart'; import 'package:hmg_patient_app_new/core/cache_consts.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart'; import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart';
@ -82,16 +81,18 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
duration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
height: 6.h, height: 6.h,
width: selectedIndex == 0 ? 18.h : 6.h, width: selectedIndex == 0 ? 18.h : 6.h,
decoration: BoxDecoration(color: selectedIndex == 0 ? AppColors.textColor : AppColors.inputLabelTextColor, borderRadius: BorderRadius.circular(30)), decoration:
BoxDecoration(color: selectedIndex == 0 ? AppColors.textColor : AppColors.inputLabelTextColor, borderRadius: BorderRadius.circular(30)),
), ),
AnimatedContainer( AnimatedContainer(
duration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
height: 6.h, height: 6.h,
width: selectedIndex == 1 ? 18.h : 6.h, width: selectedIndex == 1 ? 18.h : 6.h,
decoration: BoxDecoration(color: selectedIndex == 1 ? AppColors.textColor : AppColors.inputLabelTextColor, borderRadius: BorderRadius.circular(30)), decoration:
BoxDecoration(color: selectedIndex == 1 ? AppColors.textColor : AppColors.inputLabelTextColor, borderRadius: BorderRadius.circular(30)),
), ),
], ],
).paddingOnly(left: 24, right: 24), ).paddingOnly(left: 24.h, right: 24.h),
Row( Row(
children: [ children: [
AnimatedSwitcher( AnimatedSwitcher(
@ -103,23 +104,21 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
onPressed: () => goToHomePage(), onPressed: () => goToHomePage(),
width: 86.h, width: 86.h,
height: 56.h, height: 56.h,
borderRadius: 12.h,
backgroundColor: Color(0xffFEE9EA), backgroundColor: Color(0xffFEE9EA),
textColor: AppColors.primaryRedColor, textColor: AppColors.primaryRedColor,
borderWidth: 0,
borderColor: Colors.transparent, borderColor: Colors.transparent,
).paddingOnly(left: 24) ).paddingOnly(left: 24.h)
: const SizedBox.shrink(), : const SizedBox.shrink(),
), ),
const Spacer(), const Spacer(),
AnimatedContainer( AnimatedContainer(
duration: const Duration(milliseconds: 400), duration: const Duration(milliseconds: 400),
curve: Curves.easeInOut, curve: Curves.easeInOut,
width: selectedIndex == 0 ? 86 : MediaQuery.of(context).size.width - 48, width: selectedIndex == 0 ? 86.h : MediaQuery.of(context).size.width - 48.h,
margin: EdgeInsets.only(left: 24, right: 24), margin: EdgeInsets.only(left: 24.h, right: 24.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12.r),
), ),
child: AnimatedSwitcher( child: AnimatedSwitcher(
duration: const Duration(milliseconds: 250), duration: const Duration(milliseconds: 250),
@ -130,7 +129,6 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
iconSize: 32.h, iconSize: 32.h,
width: 86.h, width: 86.h,
height: 56.h, height: 56.h,
borderRadius: 12.h,
text: "".needTranslation, text: "".needTranslation,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
onPressed: () { onPressed: () {
@ -139,9 +137,8 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
: CustomButton( : CustomButton(
text: "Get Started".needTranslation, text: "Get Started".needTranslation,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 16.h, fontSize: 16.f,
height: 56.h, height: 56.h,
borderRadius: 16.h,
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
onPressed: () => goToHomePage(), onPressed: () => goToHomePage(),
@ -166,18 +163,23 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Transform.flip( child: Transform.flip(
flipX: getIt.get<AppState>().isArabic() ? true : false, flipX: getIt.get<AppState>().isArabic() ? true : false,
child: Lottie.asset(icon, repeat: true, reverse: false, frameRate: FrameRate(60), width: MediaQuery.sizeOf(context).width - 50, height: MediaQuery.sizeOf(context).width - 50))) child: Lottie.asset(icon,
repeat: true,
reverse: false,
frameRate: FrameRate(60),
width: MediaQuery.sizeOf(context).width - 50,
height: MediaQuery.sizeOf(context).width - 50)))
.expanded, .expanded,
// 12.height, // 12.height,
Text( Text(
heading, heading,
style: TextStyle(fontSize: 36.h, fontWeight: FontWeight.w600, color: AppColors.textColor, letterSpacing: -0.4, height: 1), style: TextStyle(fontSize: 36.f, fontWeight: FontWeight.w600, color: AppColors.textColor, letterSpacing: -0.4, height: 1),
), ),
Text( Text(
body, body,
style: TextStyle(fontSize: 16.h, fontWeight: FontWeight.w500, color: AppColors.greyTextColor, letterSpacing: 0, height: 26 / 16), style: TextStyle(fontSize: 16.f, fontWeight: FontWeight.w500, color: AppColors.greyTextColor, letterSpacing: 0, height: 26 / 16),
), ),
], ],
).paddingOnly(left: 24, right: 24); ).paddingOnly(left: 24.h, right: 24.h);
} }
} }

@ -1,16 +1,12 @@
import 'dart:convert';
import 'dart:developer';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_swiper_view/flutter_swiper_view.dart'; import 'package:flutter_swiper_view/flutter_swiper_view.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/int_extensions.dart'; import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
@ -24,14 +20,13 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/habib_wallet/habib_wallet_page.dart'; import 'package:hmg_patient_app_new/presentation/habib_wallet/habib_wallet_page.dart';
import 'package:hmg_patient_app_new/presentation/habib_wallet/recharge_wallet_page.dart'; import 'package:hmg_patient_app_new/presentation/habib_wallet/recharge_wallet_page.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/app_language_change.dart'; import 'package:hmg_patient_app_new/widgets/app_language_change.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../core/dependencies.dart' show getIt; import '../../core/dependencies.dart' show getIt;
@ -66,7 +61,7 @@ class _ProfileSettingsState extends State<ProfileSettings> {
logout: () {}, logout: () {},
isClose: true, isClose: true,
child: SingleChildScrollView( child: SingleChildScrollView(
padding: EdgeInsets.only(top: 24, bottom: 24), padding: EdgeInsets.only(top: 24.h, bottom: 24.h),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
child: Consumer2<ProfileSettingsViewModel, MedicalFileViewModel>( child: Consumer2<ProfileSettingsViewModel, MedicalFileViewModel>(
builder: (context, profileVm, medicalVm, child) { builder: (context, profileVm, medicalVm, child) {
@ -77,14 +72,14 @@ class _ProfileSettingsState extends State<ProfileSettings> {
itemCount: medicalVm.patientFamilyFiles.length, itemCount: medicalVm.patientFamilyFiles.length,
layout: SwiperLayout.STACK, layout: SwiperLayout.STACK,
loop: true, loop: true,
itemWidth: MediaQuery.of(context).size.width - 42, itemWidth: SizeUtils.width - 42.w,
indicatorLayout: PageIndicatorLayout.COLOR, indicatorLayout: PageIndicatorLayout.COLOR,
axisDirection: AxisDirection.right, axisDirection: AxisDirection.right,
controller: _controller, controller: _controller,
itemHeight: 200.h, itemHeight: 220.h,
pagination: const SwiperPagination( pagination: SwiperPagination(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 210 + 8 + 24), margin: EdgeInsets.only(top: (210.h + 8.h + 24.h)),
builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor), builder: DotSwiperPaginationBuilder(color: Color(0xffD9D9D9), activeColor: AppColors.blackBgColor),
), ),
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
@ -102,20 +97,20 @@ class _ProfileSettingsState extends State<ProfileSettings> {
onFamilySwitchPress: (FamilyFileResponseModelLists profile) { onFamilySwitchPress: (FamilyFileResponseModelLists profile) {
medicalVm.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber); medicalVm.switchFamilyFiles(responseID: profile.responseId, patientID: profile.patientId, phoneNumber: profile.mobileNumber);
}, },
).paddingOnly(right: 16); ).paddingOnly(right: 16.w);
}, },
), ),
GridView( GridView(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 9, mainAxisSpacing: 9), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 9.w, mainAxisSpacing: 9.h),
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(24), padding: EdgeInsets.only(left: 24.w, right: 24.w, bottom: 24.w, top: 10.w),
shrinkWrap: true, shrinkWrap: true,
children: [ children: [
Container( Container(
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16.w),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 20.h, borderRadius: 20.r,
hasShadow: true, hasShadow: true,
), ),
child: Column( child: Column(
@ -123,10 +118,10 @@ class _ProfileSettingsState extends State<ProfileSettings> {
spacing: 4.h, spacing: 4.h,
children: [ children: [
Row( Row(
spacing: 8.h, spacing: 8.w,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.h, height: 40.h), Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h),
"Habib Wallet".needTranslation.toText14(weight: FontWeight.w600, maxlines: 2).expanded, "Habib Wallet".needTranslation.toText14(weight: FontWeight.w600, maxlines: 2).expanded,
Utils.buildSvgWithAssets(icon: AppAssets.arrow_forward), Utils.buildSvgWithAssets(icon: AppAssets.arrow_forward),
], ],
@ -134,7 +129,7 @@ class _ProfileSettingsState extends State<ProfileSettings> {
Spacer(), Spacer(),
Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) { Consumer<HabibWalletViewModel>(builder: (context, habibWalletVM, child) {
return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, isExpanded: false) return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, isExpanded: false)
.toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.h, width: 80.h, height: 24.h); .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.r, width: 80.w, height: 24.h);
}), }),
CustomButton( CustomButton(
height: 40.h, height: 40.h,
@ -143,12 +138,12 @@ class _ProfileSettingsState extends State<ProfileSettings> {
iconColor: AppColors.infoColor, iconColor: AppColors.infoColor,
textColor: AppColors.infoColor, textColor: AppColors.infoColor,
text: "Recharge".needTranslation, text: "Recharge".needTranslation,
borderWidth: 0.h, borderWidth: 0.w,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderColor: Colors.transparent, borderColor: Colors.transparent,
backgroundColor: Color(0xff45A2F8).withValues(alpha: 0.08), backgroundColor: Color(0xff45A2F8).withValues(alpha: 0.08),
padding: EdgeInsets.all(8.h), padding: EdgeInsets.all(8.w),
fontSize: 14, fontSize: 14.f,
onPressed: () { onPressed: () {
Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage())); Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage()));
}, },
@ -160,15 +155,19 @@ class _ProfileSettingsState extends State<ProfileSettings> {
) )
], ],
), ),
"Quick Actions".needTranslation.toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1).paddingOnly(left: 24, right: 24), "Quick Actions"
.needTranslation
.toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1)
.paddingOnly(left: 24.w, right: 24.w),
Container( Container(
margin: EdgeInsets.only(left: 24, right: 24, top: 16, bottom: 24), margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h, bottom: 24.h),
padding: EdgeInsets.only(top: 4, bottom: 4), padding: EdgeInsets.only(top: 4.h, bottom: 4.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true),
child: Column( child: Column(
children: [ children: [
actionItem(AppAssets.language_change, "Language".needTranslation, () { actionItem(AppAssets.language_change, "Language".needTranslation, () {
showCommonBottomSheetWithoutHeight(context, title: "Application Language".needTranslation, child: AppLanguageChange(), callBackFunc: () {}, isFullScreen: false); showCommonBottomSheetWithoutHeight(context,
title: "Application Language".needTranslation, child: AppLanguageChange(), callBackFunc: () {}, isFullScreen: false);
}, trailingLabel: Utils.appState.isArabic() ? "العربية".needTranslation : "English".needTranslation), }, trailingLabel: Utils.appState.isArabic() ? "العربية".needTranslation : "English".needTranslation),
1.divider, 1.divider,
actionItem(AppAssets.accessibility, "Accessibility".needTranslation, () {}), actionItem(AppAssets.accessibility, "Accessibility".needTranslation, () {}),
@ -179,11 +178,14 @@ class _ProfileSettingsState extends State<ProfileSettings> {
], ],
), ),
), ),
"Personal Information".needTranslation.toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1).paddingOnly(left: 24, right: 24), "Personal Information"
.needTranslation
.toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1)
.paddingOnly(left: 24.w, right: 24.w),
Container( Container(
margin: EdgeInsets.only(left: 24, right: 24, top: 16, bottom: 24), margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h, bottom: 24.h),
padding: EdgeInsets.only(top: 4, bottom: 4), padding: EdgeInsets.only(top: 4.h, bottom: 4.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true),
child: Column( child: Column(
children: [ children: [
actionItem(AppAssets.email_transparent, "Update Email Address".needTranslation, () {}), actionItem(AppAssets.email_transparent, "Update Email Address".needTranslation, () {}),
@ -196,11 +198,14 @@ class _ProfileSettingsState extends State<ProfileSettings> {
], ],
), ),
), ),
"Help & Support".needTranslation.toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1).paddingOnly(left: 24, right: 24), "Help & Support"
.needTranslation
.toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1)
.paddingOnly(left: 24.w, right: 24.w),
Container( Container(
margin: EdgeInsets.only(left: 24, right: 24, top: 16), margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h),
padding: EdgeInsets.only(top: 4, bottom: 4), padding: EdgeInsets.only(top: 4.h, bottom: 4.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true),
child: Column( child: Column(
children: [ children: [
actionItem(AppAssets.call_fill, "Contact Us".needTranslation, () {}, trailingLabel: "9200666666"), actionItem(AppAssets.call_fill, "Contact Us".needTranslation, () {}, trailingLabel: "9200666666"),
@ -215,7 +220,7 @@ class _ProfileSettingsState extends State<ProfileSettings> {
], ],
), ),
), ),
CustomButton(icon: AppAssets.minus, text: "Deactivate account".needTranslation, onPressed: () {}).paddingAll(24), CustomButton(icon: AppAssets.minus, text: "Deactivate account".needTranslation, onPressed: () {}).paddingAll(24.w),
], ],
); );
}, },
@ -226,18 +231,19 @@ class _ProfileSettingsState extends State<ProfileSettings> {
Widget actionItem(String icon, String label, VoidCallback onPress, {String trailingLabel = "", bool? switchValue, bool isExternalLink = false}) { Widget actionItem(String icon, String label, VoidCallback onPress, {String trailingLabel = "", bool? switchValue, bool isExternalLink = false}) {
return SizedBox( return SizedBox(
height: 56, height: 56.h,
child: Row( child: Row(
spacing: 8.h, spacing: 8.w,
children: [ children: [
Utils.buildSvgWithAssets(icon: icon, iconColor: AppColors.greyTextColor), Utils.buildSvgWithAssets(icon: icon, iconColor: AppColors.greyTextColor),
label.toText14(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1).expanded, label.toText14(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1).expanded,
if (trailingLabel.isNotEmpty) trailingLabel.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1), if (trailingLabel.isNotEmpty)
trailingLabel.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1),
switchValue != null switchValue != null
? Switch( ? Switch(
value: switchValue, value: switchValue,
onChanged: (value) {}, onChanged: (value) {},
activeColor: AppColors.successColor, activeThumbColor: AppColors.successColor,
activeTrackColor: AppColors.successColor.withValues(alpha: .15), activeTrackColor: AppColors.successColor.withValues(alpha: .15),
) )
: Transform.scale( : Transform.scale(
@ -245,18 +251,22 @@ class _ProfileSettingsState extends State<ProfileSettings> {
child: Utils.buildSvgWithAssets(icon: isExternalLink ? AppAssets.externalLink : AppAssets.arrow_forward), child: Utils.buildSvgWithAssets(icon: isExternalLink ? AppAssets.externalLink : AppAssets.arrow_forward),
) )
], ],
).paddingOnly(left: 16, right: 16).onPress(onPress), ).paddingOnly(left: 16.w, right: 16.w).onPress(onPress),
); );
} }
} }
class FamilyCardWidget extends StatelessWidget { class FamilyCardWidget extends StatelessWidget {
late AppState appState;
final Function() onAddFamilyMemberPress; final Function() onAddFamilyMemberPress;
final Function(FamilyFileResponseModelLists member) onFamilySwitchPress; final Function(FamilyFileResponseModelLists member) onFamilySwitchPress;
final FamilyFileResponseModelLists profile; final FamilyFileResponseModelLists profile;
FamilyCardWidget({super.key, required this.onAddFamilyMemberPress, required this.profile, required this.onFamilySwitchPress(FamilyFileResponseModelLists member)}); const FamilyCardWidget({
super.key,
required this.onAddFamilyMemberPress,
required this.profile,
required this.onFamilySwitchPress(FamilyFileResponseModelLists member),
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -265,7 +275,7 @@ class FamilyCardWidget extends StatelessWidget {
final isParentUser = appState.getAuthenticatedUser()?.isParentUser ?? false; final isParentUser = appState.getAuthenticatedUser()?.isParentUser ?? false;
final canSwitch = isParentUser || (!isParentUser && profile.responseId == appState.getSuperUserID); final canSwitch = isParentUser || (!isParentUser && profile.responseId == appState.getSuperUserID);
return Container( return Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.r, hasShadow: true),
child: Column( child: Column(
children: [ children: [
Column( Column(
@ -274,37 +284,38 @@ class FamilyCardWidget extends StatelessWidget {
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8.h, //
children: [ children: [
Image.asset(profile.gender == 1 ? AppAssets.male_img : AppAssets.femaleImg, width: 56.h, height: 56.h), Image.asset(profile.gender == 1 ? AppAssets.male_img : AppAssets.femaleImg, width: 56.w, height: 56.h),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 0.h,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
"${profile.patientName}".toText18(isBold: true, weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1), "${profile.patientName}".toText18(isBold: true, weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1),
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.file_icon, icon: AppAssets.file_icon,
labelText: "${LocaleKeys.fileNo.tr(context: context)}: ${profile.responseId}", labelText: "${LocaleKeys.fileNo.tr(context: context)}: ${profile.responseId}",
iconSize: 12, iconSize: 12.w,
), ),
], ],
).expanded, ).expanded,
Icon(Icons.qr_code, size: 56) Icon(Icons.qr_code, size: 56.h)
], ],
), ),
SizedBox(height: 4.h), SizedBox(height: 4.h),
SizedBox( SizedBox(
child: Wrap( child: Wrap(
alignment: WrapAlignment.start, alignment: WrapAlignment.start,
spacing: 4.h, spacing: 4.w,
runSpacing: 4.h, runSpacing: 4.h,
children: [ children: [
AppCustomChipWidget(labelText: "${profile.age} Years Old".needTranslation), AppCustomChipWidget(
labelText: "${profile.age} Years Old".needTranslation,
),
isActive && appState.getAuthenticatedUser()!.bloodGroup != null isActive && appState.getAuthenticatedUser()!.bloodGroup != null
? AppCustomChipWidget( ? AppCustomChipWidget(
icon: AppAssets.blood_icon, icon: AppAssets.blood_icon,
labelPadding: EdgeInsetsDirectional.only(start: -6.h, end: 8.h), labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 8.w),
labelText: "Blood: ${appState.getAuthenticatedUser()!.bloodGroup ?? ""}", labelText: "Blood: ${appState.getAuthenticatedUser()!.bloodGroup ?? ""}",
iconColor: AppColors.primaryRedColor) iconColor: AppColors.primaryRedColor)
: SizedBox(), : SizedBox(),
@ -351,9 +362,9 @@ class FamilyCardWidget extends StatelessWidget {
icon: icon, icon: icon,
labelText: labelText, labelText: labelText,
iconColor: iconColor, iconColor: iconColor,
iconSize: 12, iconSize: 12.w,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
labelPadding: EdgeInsetsDirectional.only(start: -6.h, end: 8.h), labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 8.w),
// padding: EdgeInsets.zero, // padding: EdgeInsets.zero,
).toShimmer2(isShow: isLoading); ).toShimmer2(isShow: isLoading);
}, },
@ -362,7 +373,7 @@ class FamilyCardWidget extends StatelessWidget {
), ),
), ),
], ],
).paddingOnly(top: 16.h, right: 16.h, left: 16.h, bottom: 12.h).expanded, ).paddingOnly(top: 16.h, right: 16.w, left: 16.w, bottom: 12.h),
1.divider, 1.divider,
_buildActionButton(appState), _buildActionButton(appState),
], ],
@ -393,9 +404,9 @@ class FamilyCardWidget extends StatelessWidget {
borderColor: canSwitch ? AppColors.secondaryLightRedColor : AppColors.primaryRedColor, borderColor: canSwitch ? AppColors.secondaryLightRedColor : AppColors.primaryRedColor,
textColor: canSwitch ? AppColors.primaryRedColor : AppColors.whiteColor, textColor: canSwitch ? AppColors.primaryRedColor : AppColors.whiteColor,
iconColor: canSwitch ? AppColors.primaryRedColor : AppColors.whiteColor, iconColor: canSwitch ? AppColors.primaryRedColor : AppColors.whiteColor,
height: 40.h, height: 56.h,
fontSize: 14, fontSize: 14.f,
).paddingOnly(top: 12, right: 16, left: 16, bottom: 16); ).paddingOnly(top: 12.h, right: 16.w, left: 16.w, bottom: 16.h);
} }
Widget _buildNonParentUserButton(int? superUserId) { Widget _buildNonParentUserButton(int? superUserId) {
@ -410,8 +421,8 @@ class FamilyCardWidget extends StatelessWidget {
iconColor: canSwitchBack ? AppColors.whiteColor : AppColors.greyTextColor, iconColor: canSwitchBack ? AppColors.whiteColor : AppColors.greyTextColor,
onPressed: canSwitchBack ? () => onFamilySwitchPress(profile) : () {}, onPressed: canSwitchBack ? () => onFamilySwitchPress(profile) : () {},
height: 40.h, height: 40.h,
fontSize: 14, fontSize: 14.f,
).paddingOnly(top: 12, right: 16, left: 16, bottom: 16); ).paddingOnly(top: 12.h, right: 16.w, left: 16.w, bottom: 16.h);
} }
// //TODO: Add family file switch logic here // //TODO: Add family file switch logic here

@ -22,9 +22,13 @@ abstract class DialogService {
Future<void> showCommonBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed}); Future<void> showCommonBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed});
Future<void> showFamilyBottomSheetWithoutH( Future<void> showFamilyBottomSheetWithoutH(
{String? label, required String message, required Function(FamilyFileResponseModelLists response) onSwitchPress, required List<FamilyFileResponseModelLists> profiles}); {String? label,
required String message,
required Function(FamilyFileResponseModelLists response) onSwitchPress,
required List<FamilyFileResponseModelLists> profiles});
Future<void> showFamilyBottomSheetWithoutHWithChild({String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed}); Future<void> showFamilyBottomSheetWithoutHWithChild(
{String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed});
Future<void> showPhoneNumberPickerSheet({String? label, String? message, required Function() onSMSPress, required Function() onWhatsappPress}); Future<void> showPhoneNumberPickerSheet({String? label, String? message, required Function() onSMSPress, required Function() onWhatsappPress});
@ -49,6 +53,7 @@ class DialogServiceImp implements DialogService {
await showModalBottomSheet( await showModalBottomSheet(
context: context, context: context,
isScrollControlled: false, isScrollControlled: false,
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width),
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(16)), borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
), ),
@ -80,6 +85,7 @@ class DialogServiceImp implements DialogService {
await showModalBottomSheet( await showModalBottomSheet(
context: context, context: context,
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width),
isScrollControlled: false, isScrollControlled: false,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(16)), borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
@ -101,13 +107,20 @@ class DialogServiceImp implements DialogService {
Future<void> showCommonBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed}) async { Future<void> showCommonBottomSheetWithoutH({String? label, required String message, required Function() onOkPressed, Function()? onCancelPressed}) async {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight(context, showCommonBottomSheetWithoutHeight(
title: label ?? "", child: exceptionBottomSheetWidget(context: context, message: message, onOkPressed: onOkPressed, onCancelPressed: onCancelPressed), callBackFunc: () {}); context,
title: label ?? "",
child: exceptionBottomSheetWidget(context: context, message: message, onOkPressed: onOkPressed, onCancelPressed: onCancelPressed),
callBackFunc: () {},
);
} }
@override @override
Future<void> showFamilyBottomSheetWithoutH( Future<void> showFamilyBottomSheetWithoutH(
{String? label, required String message, required Function(FamilyFileResponseModelLists response) onSwitchPress, required List<FamilyFileResponseModelLists> profiles}) async { {String? label,
required String message,
required Function(FamilyFileResponseModelLists response) onSwitchPress,
required List<FamilyFileResponseModelLists> profiles}) async {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight(context, showCommonBottomSheetWithoutHeight(context,
@ -124,7 +137,8 @@ class DialogServiceImp implements DialogService {
} }
@override @override
Future<void> showFamilyBottomSheetWithoutHWithChild({String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed}) async { Future<void> showFamilyBottomSheetWithoutHWithChild(
{String? label, required String message, Widget? child, required Function() onOkPressed, Function()? onCancelPressed}) async {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
@ -140,7 +154,9 @@ class DialogServiceImp implements DialogService {
final context = navigationService.navigatorKey.currentContext; final context = navigationService.navigatorKey.currentContext;
if (context == null) return; if (context == null) return;
showCommonBottomSheetWithoutHeight(context, showCommonBottomSheetWithoutHeight(context,
title: label ?? "", child: showPhoneNumberPickerWidget(context: context, message: message, onSMSPress: onSMSPress, onWhatsappPress: onWhatsappPress), callBackFunc: () {}); title: label ?? "",
child: showPhoneNumberPickerWidget(context: context, message: message, onSMSPress: onSMSPress, onWhatsappPress: onWhatsappPress),
callBackFunc: () {});
} }
@override @override
@ -178,7 +194,7 @@ Widget exceptionBottomSheetWidget({required BuildContext context, required Strin
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
), ),
), ),
SizedBox(width: 5.h), SizedBox(width: 10.h),
Expanded( Expanded(
child: CustomButton( child: CustomButton(
text: LocaleKeys.confirm.tr(), text: LocaleKeys.confirm.tr(),

@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/widgets/language_switcher.dart'; import 'package:hmg_patient_app_new/widgets/language_switcher.dart';
import '../../generated/locale_keys.g.dart'; import '../../generated/locale_keys.g.dart';
@ -11,14 +10,14 @@ import '../../generated/locale_keys.g.dart';
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
final VoidCallback onBackPressed; final VoidCallback onBackPressed;
final ValueChanged<String> onLanguageChanged; final ValueChanged<String> onLanguageChanged;
bool hideLogoAndLang; final bool hideLogoAndLang;
CustomAppBar({ const CustomAppBar({
Key? key, super.key,
required this.onBackPressed, required this.onBackPressed,
required this.onLanguageChanged, required this.onLanguageChanged,
this.hideLogoAndLang = false, this.hideLogoAndLang = false,
}) : super(key: key); });
@override @override
Size get preferredSize => const Size.fromHeight(kToolbarHeight); Size get preferredSize => const Size.fromHeight(kToolbarHeight);
@ -42,9 +41,17 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
child: context.locale.languageCode == "ar" child: context.locale.languageCode == "ar"
? RotatedBox( ? RotatedBox(
quarterTurns: 90, quarterTurns: 90,
child: Utils.buildSvgWithAssets(icon: AppAssets.arrow_back, width: 32.h, height: 32.h), child: Utils.buildSvgWithAssets(
icon: AppAssets.arrow_back,
width: 32.h,
height: 32.h,
),
) )
: Utils.buildSvgWithAssets(icon: AppAssets.arrow_back, width: 32.h, height: 32.h), : Utils.buildSvgWithAssets(
icon: AppAssets.arrow_back,
width: 32.h,
height: 32.h,
),
), ),
), ),
), ),
@ -53,6 +60,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
if (!hideLogoAndLang) if (!hideLogoAndLang)
Utils.buildSvgWithAssets( Utils.buildSvgWithAssets(
icon: AppAssets.habiblogo, icon: AppAssets.habiblogo,
height: 24.h,
), ),
if (!hideLogoAndLang) if (!hideLogoAndLang)

@ -1,6 +1,5 @@
import 'dart:ui'; import 'dart:ui';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -9,9 +8,8 @@ import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import '../../core/dependencies.dart'; import '../../core/dependencies.dart';
class CollapsingListView extends StatelessWidget { class CollapsingListView extends StatelessWidget {
@ -28,8 +26,21 @@ class CollapsingListView extends StatelessWidget {
bool isClose; bool isClose;
bool isLeading; bool isLeading;
CollapsingListView( CollapsingListView({
{required this.title, this.child, this.search, this.isClose = false, this.bottomChild, this.report, this.logout, this.history, this.instructions, this.requests, this.isLeading = true, this.trailing}); super.key,
required this.title,
this.child,
this.search,
this.isClose = false,
this.bottomChild,
this.report,
this.logout,
this.history,
this.instructions,
this.requests,
this.isLeading = true,
this.trailing,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -43,7 +54,7 @@ class CollapsingListView extends StatelessWidget {
SliverAppBar( SliverAppBar(
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
pinned: true, pinned: true,
expandedHeight: 100, expandedHeight: 100.h,
stretch: true, stretch: true,
systemOverlayStyle: SystemUiOverlayStyle(statusBarBrightness: Brightness.light), systemOverlayStyle: SystemUiOverlayStyle(statusBarBrightness: Brightness.light),
surfaceTintColor: Colors.transparent, surfaceTintColor: Colors.transparent,
@ -61,7 +72,7 @@ class CollapsingListView extends StatelessWidget {
: SizedBox.shrink(), : SizedBox.shrink(),
flexibleSpace: LayoutBuilder( flexibleSpace: LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
final double maxHeight = 100; final double maxHeight = 100.h;
final double minHeight = kToolbarHeight; final double minHeight = kToolbarHeight;
double t = (constraints.maxHeight - minHeight) / (maxHeight - minHeight); double t = (constraints.maxHeight - minHeight) / (maxHeight - minHeight);
t = t - 1; t = t - 1;
@ -81,7 +92,8 @@ class CollapsingListView extends StatelessWidget {
t, t,
)!, )!,
child: Padding( child: Padding(
padding: EdgeInsets.only(left: appState.isArabic() ? 0 : leftPadding, right: appState.isArabic() ? leftPadding : 0, bottom: bottomPadding), padding: EdgeInsets.only(
left: appState.isArabic() ? 0 : leftPadding, right: appState.isArabic() ? leftPadding : 0, bottom: bottomPadding),
child: Row( child: Row(
spacing: 4.h, spacing: 4.h,
children: [ children: [
@ -89,7 +101,7 @@ class CollapsingListView extends StatelessWidget {
title, title,
maxLines: 1, maxLines: 1,
style: TextStyle( style: TextStyle(
fontSize: (27 - (5 * (2 - t))).fSize, fontSize: (27 - (5 * (2 - t))).f,
fontWeight: FontWeight.lerp( fontWeight: FontWeight.lerp(
FontWeight.w300, FontWeight.w300,
FontWeight.w600, FontWeight.w600,
@ -100,9 +112,12 @@ class CollapsingListView extends StatelessWidget {
).expanded, ).expanded,
if (logout != null) actionButton(context, t, title: "Logout".needTranslation, icon: AppAssets.logout).onPress(logout!), if (logout != null) actionButton(context, t, title: "Logout".needTranslation, icon: AppAssets.logout).onPress(logout!),
if (report != null) actionButton(context, t, title: "Report".needTranslation, icon: AppAssets.report_icon).onPress(report!), if (report != null) actionButton(context, t, title: "Report".needTranslation, icon: AppAssets.report_icon).onPress(report!),
if (history != null) actionButton(context, t, title: "History".needTranslation, icon: AppAssets.insurance_history_icon).onPress(history!), if (history != null)
if (instructions != null) actionButton(context, t, title: "Instructions".needTranslation, icon: AppAssets.requests).onPress(instructions!), actionButton(context, t, title: "History".needTranslation, icon: AppAssets.insurance_history_icon).onPress(history!),
if (requests != null) actionButton(context, t, title: "Requests".needTranslation, icon: AppAssets.insurance_history_icon).onPress(requests!), if (instructions != null)
actionButton(context, t, title: "Instructions".needTranslation, icon: AppAssets.requests).onPress(instructions!),
if (requests != null)
actionButton(context, t, title: "Requests".needTranslation, icon: AppAssets.insurance_history_icon).onPress(requests!),
if (search != null) Utils.buildSvgWithAssets(icon: AppAssets.search_icon).onPress(search!).paddingOnly(right: 24), if (search != null) Utils.buildSvgWithAssets(icon: AppAssets.search_icon).onPress(search!).paddingOnly(right: 24),
if (trailing != null) trailing!, if (trailing != null) trailing!,
], ],
@ -131,12 +146,12 @@ class CollapsingListView extends StatelessWidget {
return AnimatedSize( return AnimatedSize(
duration: Duration(milliseconds: 150), duration: Duration(milliseconds: 150),
child: Container( child: Container(
height: 40, height: 40.h,
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8.w),
margin: EdgeInsets.only(right: 24), margin: EdgeInsets.only(right: 24.w),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.secondaryLightRedColor, color: AppColors.secondaryLightRedColor,
borderRadius: 12, borderRadius: 12.r,
), ),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -151,7 +166,7 @@ class CollapsingListView extends StatelessWidget {
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
letterSpacing: -0.4, letterSpacing: -0.4,
fontSize: (14 - (2 * (1 - t))).fSize, fontSize: (14 - (2 * (1 - t))).f,
fontWeight: FontWeight.lerp( fontWeight: FontWeight.lerp(
FontWeight.w300, FontWeight.w300,
FontWeight.w500, FontWeight.w500,

@ -18,7 +18,15 @@ class ExceptionBottomSheet extends StatelessWidget {
final Function() onOkPressed; final Function() onOkPressed;
final Function()? onCancelPressed; final Function()? onCancelPressed;
const ExceptionBottomSheet({super.key, this.title, required this.message, this.showOKButton = true, this.showCancel = false, required this.onOkPressed, this.onCancelPressed}); const ExceptionBottomSheet({
super.key,
this.title,
required this.message,
this.showOKButton = true,
this.showCancel = false,
required this.onOkPressed,
this.onCancelPressed,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -50,7 +58,10 @@ class ExceptionBottomSheet extends StatelessWidget {
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
child: Utils.buildSvgWithAssets(icon: AppAssets.cross_circle), child: Utils.buildSvgWithAssets(
icon: AppAssets.cross_circle,
height: 24.h,
),
) )
], ],
), ),
@ -63,6 +74,7 @@ class ExceptionBottomSheet extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: CustomButton( child: CustomButton(
height: 56.h,
text: LocaleKeys.cancel.tr(), text: LocaleKeys.cancel.tr(),
onPressed: onCancelPressed != null onPressed: onCancelPressed != null
? onCancelPressed! ? onCancelPressed!
@ -79,6 +91,7 @@ class ExceptionBottomSheet extends StatelessWidget {
SizedBox(width: 5.h), SizedBox(width: 5.h),
Expanded( Expanded(
child: CustomButton( child: CustomButton(
height: 56.h,
text: showCancel ? LocaleKeys.confirm.tr() : LocaleKeys.ok.tr(), text: showCancel ? LocaleKeys.confirm.tr() : LocaleKeys.ok.tr(),
onPressed: onOkPressed, onPressed: onOkPressed,
backgroundColor: AppColors.bgGreenColor, backgroundColor: AppColors.bgGreenColor,
@ -93,6 +106,7 @@ class ExceptionBottomSheet extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(bottom: 10.h), padding: EdgeInsets.only(bottom: 10.h),
child: CustomButton( child: CustomButton(
height: 56.h,
text: LocaleKeys.ok.tr(), text: LocaleKeys.ok.tr(),
onPressed: onOkPressed, onPressed: onOkPressed,
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,

@ -13,20 +13,20 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart';
class GenericBottomSheet extends StatefulWidget { class GenericBottomSheet extends StatefulWidget {
String? countryCode; final String? countryCode;
String? initialPhoneNumber; final String? initialPhoneNumber;
final List<Widget> buttons; final List<Widget> buttons;
TextEditingController? textController; final TextEditingController? textController;
final bool isForEmail; final bool isForEmail;
Function(CountryEnum)? onCountryChange; final Function(CountryEnum)? onCountryChange;
final bool isEnableCountryDropdown; final bool isEnableCountryDropdown;
final bool isFromSavedLogin; final bool isFromSavedLogin;
Function(String?)? onChange; final Function(String?)? onChange;
final bool autoFocus; final bool autoFocus;
// FocusNode myFocusNode; // FocusNode myFocusNode;
GenericBottomSheet({ const GenericBottomSheet({
super.key, super.key,
this.countryCode = "", this.countryCode = "",
this.initialPhoneNumber = "", this.initialPhoneNumber = "",
@ -42,10 +42,10 @@ class GenericBottomSheet extends StatefulWidget {
}); });
@override @override
_GenericBottomSheetState createState() => _GenericBottomSheetState(); GenericBottomSheetState createState() => GenericBottomSheetState();
} }
class _GenericBottomSheetState extends State<GenericBottomSheet> { class GenericBottomSheetState extends State<GenericBottomSheet> {
late FocusNode _textFieldFocusNode; late FocusNode _textFieldFocusNode;
@override @override
@ -85,8 +85,11 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
textDirection: Directionality.of(context), textDirection: Directionality.of(context),
child: Container( child: Container(
padding: EdgeInsets.all(24.h), padding: EdgeInsets.all(24.h),
decoration: RoundedRectangleBorder() decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
.toSmoothCornerDecoration(color: AppColors.bgScaffoldColor, borderRadius: 16, customBorder: BorderRadius.only(topLeft: Radius.circular(16), topRight: Radius.circular(16))), color: AppColors.bgScaffoldColor,
borderRadius: 16.r,
customBorder: BorderRadius.only(topLeft: Radius.circular(16.r), topRight: Radius.circular(16.r)),
),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -112,7 +115,10 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
}, },
child: Padding( child: Padding(
padding: EdgeInsets.only(top: 10.h), padding: EdgeInsets.only(top: 10.h),
child: Utils.buildSvgWithAssets(icon: AppAssets.cross_circle), child: Utils.buildSvgWithAssets(
icon: AppAssets.cross_circle,
height: 24.h,
),
), ),
), ),
], ],
@ -152,7 +158,7 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
prefix: widget.isForEmail ? null : widget.countryCode, prefix: widget.isForEmail ? null : widget.countryCode,
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
fontSize: 13.h, fontSize: 13,
isCountryDropDown: widget.isEnableCountryDropdown, isCountryDropDown: widget.isEnableCountryDropdown,
leadingIcon: widget.isForEmail ? AppAssets.email : AppAssets.smart_phone, leadingIcon: widget.isForEmail ? AppAssets.email : AppAssets.smart_phone,
) )

@ -6,72 +6,73 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
class CustomButton extends StatelessWidget { class CustomButton extends StatelessWidget {
final String text; final String text;
String? icon; final String? icon;
final VoidCallback onPressed; final VoidCallback onPressed;
final Color backgroundColor; final Color backgroundColor;
final Color borderColor; final Color borderColor;
final Color textColor; final Color textColor;
final double borderRadius; final double? borderRadius;
final double borderWidth; final double borderWidth;
final EdgeInsetsGeometry padding; final EdgeInsetsGeometry padding;
final double fontSize; final double? fontSize;
final String? fontFamily; final String? fontFamily;
final FontWeight fontWeight; final FontWeight fontWeight;
final bool isDisabled; final bool isDisabled;
final Color? iconColor; final Color? iconColor;
final double height; final double? height;
final double? width; final double? width;
final double iconSize; final double? iconSize;
final TextOverflow? textOverflow; final TextOverflow? textOverflow;
final BorderSide? borderSide; final BorderSide? borderSide;
CustomButton( const CustomButton({
{Key? key, super.key,
required this.text, required this.text,
required this.onPressed, required this.onPressed,
this.backgroundColor = const Color(0xFFED1C2B), this.backgroundColor = const Color(0xFFED1C2B),
this.borderColor = const Color(0xFFED1C2B), this.borderColor = const Color(0xFFED1C2B),
this.textColor = Colors.white, this.textColor = Colors.white,
this.borderRadius = 12, this.borderRadius,
this.borderWidth = 2, this.borderWidth = 2,
this.padding = const EdgeInsets.fromLTRB(8, 10, 8, 10), this.padding = const EdgeInsets.fromLTRB(8, 10, 8, 10),
this.fontSize = 16, this.fontSize,
this.fontFamily, this.fontFamily,
this.fontWeight = FontWeight.w500, this.fontWeight = FontWeight.w500,
this.isDisabled = false, this.isDisabled = false,
this.icon, this.icon,
this.iconColor = Colors.white, this.iconColor = Colors.white,
this.height = 56, this.height,
this.width, this.width,
this.iconSize = 24, this.iconSize,
this.textOverflow, this.textOverflow,
this.borderSide}) this.borderSide,
: super(key: key); });
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print("the text is empty or not ${text.isEmpty}"); final radius = borderRadius ?? (12.r);
final iconS = iconSize ?? (24.h);
final fontS = fontSize ?? (16.f);
return GestureDetector( return GestureDetector(
onTap: isDisabled ? null : onPressed, onTap: isDisabled ? null : onPressed,
child: Container( child: Container(
height: height, height: height ?? (50.h),
width: width, width: width,
padding: padding, padding: padding,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: isDisabled ? backgroundColor.withOpacity(.5) : backgroundColor, color: isDisabled ? backgroundColor.withOpacity(.5) : backgroundColor,
borderRadius: borderRadius, borderRadius: radius,
customBorder: BorderRadius.circular(borderRadius), customBorder: BorderRadius.circular(radius),
side: borderSide ?? BorderSide(width: borderWidth.h, color: isDisabled ? Colors.transparent : borderColor)), side: borderSide ?? BorderSide(width: borderWidth.h, color: isDisabled ? borderColor.withValues(alpha: 0.5) : borderColor)),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
if (icon != null) if (icon != null)
Padding( Padding(
padding: text.isNotEmpty ?EdgeInsets.only(right: 8.h, left: 8.h): EdgeInsets.zero, padding: text.isNotEmpty ? EdgeInsets.only(right: 8.h, left: 8.h) : EdgeInsets.zero,
child: Utils.buildSvgWithAssets(icon: icon!, iconColor: iconColor, isDisabled: isDisabled, width: iconSize, height: iconSize), child: Utils.buildSvgWithAssets(icon: icon!, iconColor: iconColor, isDisabled: isDisabled, width: iconS, height: iconS),
), ),
Visibility( Visibility(
visible: text.isNotEmpty, visible: text.isNotEmpty,
child: Padding( child: Padding(
@ -80,7 +81,7 @@ class CustomButton extends StatelessWidget {
text, text,
overflow: textOverflow, overflow: textOverflow,
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
fontSize: fontSize.fSize, fontSize: fontS,
color: isDisabled ? textColor.withOpacity(0.5) : textColor, color: isDisabled ? textColor.withOpacity(0.5) : textColor,
letterSpacing: 0, letterSpacing: 0,
fontWeight: fontWeight, fontWeight: fontWeight,

@ -81,7 +81,7 @@ class DefaultButton extends StatelessWidget {
text, text,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: fontSize ?? 18.fSize, fontSize: fontSize ?? 18.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: textColor, color: textColor,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -94,7 +94,7 @@ class DefaultButton extends StatelessWidget {
text, text,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: fontSize ?? 18.fSize, fontSize: fontSize ?? 18.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: textColor, color: textColor,
letterSpacing: -0.48, letterSpacing: -0.48,

@ -1,26 +1,24 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:smooth_corner/smooth_corner.dart'; import 'package:smooth_corner/smooth_corner.dart';
class AppCustomChipWidget extends StatelessWidget { class AppCustomChipWidget extends StatelessWidget {
AppCustomChipWidget({ const AppCustomChipWidget({
super.key, super.key,
this.labelText, this.labelText,
this.textColor = AppColors.textColor, this.textColor = AppColors.textColor,
this.backgroundColor = AppColors.greyColor, this.backgroundColor = AppColors.greyColor,
this.iconSize = 12, this.iconSize,
this.icon = "", this.icon = "",
this.iconColor = AppColors.textColor, this.iconColor = AppColors.textColor,
this.richText, this.richText,
this.iconHasColor = true, this.iconHasColor = true,
this.shape, this.shape,
this.deleteIcon, this.deleteIcon,
this.deleteIconSize = const Size(12, 12), this.deleteIconSize,
this.deleteIconColor = AppColors.textColor, this.deleteIconColor = AppColors.textColor,
this.deleteIconHasColor = false, this.deleteIconHasColor = false,
this.padding = EdgeInsets.zero, this.padding = EdgeInsets.zero,
@ -32,7 +30,7 @@ class AppCustomChipWidget extends StatelessWidget {
final Widget? richText; final Widget? richText;
final Color? textColor; final Color? textColor;
final Color? backgroundColor; final Color? backgroundColor;
final num iconSize; final double? iconSize;
final String icon; final String icon;
final String? deleteIcon; final String? deleteIcon;
final Size? deleteIconSize; final Size? deleteIconSize;
@ -47,56 +45,66 @@ class AppCustomChipWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final iconS = iconSize ?? 12.w;
return GestureDetector( return GestureDetector(
onTap: onChipTap, onTap: onChipTap,
child: ChipTheme( child: SizedBox(
data: ChipThemeData( child: ChipTheme(
padding: EdgeInsets.all(0.0), data: ChipThemeData(
shape: SmoothRectangleBorder( padding: EdgeInsets.zero,
side: BorderSide( shape: SmoothRectangleBorder(
width: 10.0, side: BorderSide(
color: Colors.transparent, // Crucially, set color to transparent width: 10.w,
style: BorderStyle.none, color: Colors.transparent, // Crucially, set color to transparent
style: BorderStyle.none,
),
borderRadius: BorderRadius.circular(8.r), // Apply a border radius of 16.0
), ),
borderRadius: BorderRadius.circular(8.h), // Apply a border radius of 16.0
), ),
child: icon.isNotEmpty
? Chip(
avatar: icon.isNotEmpty
? Utils.buildSvgWithAssets(icon: icon, width: iconS, height: iconS, iconColor: iconHasColor ? iconColor : null, fit: BoxFit.contain)
: SizedBox.shrink(),
label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor),
padding: padding,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
labelPadding: labelPadding ?? EdgeInsetsDirectional.only(start: 2.w, end: deleteIcon?.isNotEmpty == true ? 2.w : 8.w),
backgroundColor: backgroundColor,
shape: shape ??
SmoothRectangleBorder(
borderRadius: BorderRadius.circular(8.r),
smoothness: 10,
side: BorderSide(color: AppColors.transparent, width: 1.5),
),
deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets(
icon: deleteIcon!,
width: iconS,
height: iconS,
iconColor: deleteIconHasColor ? deleteIconColor : null,
)
: null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
)
: Chip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor),
padding: EdgeInsets.zero,
backgroundColor: backgroundColor,
shape: shape ??
SmoothRectangleBorder(
borderRadius: BorderRadius.circular(8.r),
smoothness: 10,
side: BorderSide(color: AppColors.transparent, width: 1.5),
),
labelPadding: labelPadding ?? EdgeInsetsDirectional.only(start: 2.w, end: deleteIcon?.isNotEmpty == true ? 2.w : 8.w),
deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets(icon: deleteIcon!, width: iconS, height: iconS, iconColor: deleteIconHasColor ? deleteIconColor : null)
: null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
),
), ),
child: icon.isNotEmpty
? Chip(
avatar: icon.isNotEmpty ? Utils.buildSvgWithAssets(icon: icon, width: iconSize.h, height: iconSize.h, iconColor: iconHasColor ? iconColor : null, fit: BoxFit.contain) : SizedBox.shrink(),
label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor),
padding: padding,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
labelPadding: labelPadding ?? EdgeInsetsDirectional.only(start: 0.h, end: deleteIcon?.isNotEmpty == true ? 2.h : 8.h),
backgroundColor: backgroundColor,
shape: shape ??
SmoothRectangleBorder(
borderRadius: BorderRadius.circular(8 ?? 0),
smoothness: 10,
side: BorderSide(color: AppColors.transparent, width: 1.5),
),
deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets(icon: deleteIcon!, width: deleteIconSize!.width!.h, height: deleteIconSize!.height.h, iconColor: deleteIconHasColor ? deleteIconColor : null)
: null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
)
: Chip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor),
padding: EdgeInsets.all(0.0),
backgroundColor: backgroundColor,
shape: shape ??
SmoothRectangleBorder(
borderRadius: BorderRadius.circular(8 ?? 0),
smoothness: 10,
side: BorderSide(color: AppColors.transparent, width: 1.5),
),
labelPadding: EdgeInsetsDirectional.only(start: 8.h, end: deleteIcon?.isNotEmpty == true ? -2.h : 8.h),
deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets(icon: deleteIcon!, width: deleteIconSize!.width.h, height: deleteIconSize!.height.h, iconColor: deleteIconHasColor ? deleteIconColor : null)
: null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
),
), ),
); );
} }

@ -122,6 +122,9 @@ void showCommonBottomSheetWithoutHeight(
duration: Duration(milliseconds: 500), duration: Duration(milliseconds: 500),
reverseDuration: Duration(milliseconds: 300), reverseDuration: Duration(milliseconds: 300),
), ),
constraints: BoxConstraints(
maxWidth: MediaQuery.of(context).size.width, // Full width
),
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
showDragHandle: false, showDragHandle: false,

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/int_extensions.dart'; import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
@ -23,23 +22,21 @@ class CustomTabBar extends StatefulWidget {
final Color inActiveBackgroundColor; final Color inActiveBackgroundColor;
final Function(int)? onTabChange; final Function(int)? onTabChange;
CustomTabBar( const CustomTabBar({
{Key? key, super.key,
required this.tabs, required this.tabs,
this.activeTextColor = const Color(0xff2E3039), this.activeTextColor = const Color(0xff2E3039),
this.inActiveTextColor = const Color(0xff898A8D), this.inActiveTextColor = const Color(0xff898A8D),
this.activeBackgroundColor = const Color(0x142E3039), this.activeBackgroundColor = const Color(0x142E3039),
this.inActiveBackgroundColor = Colors.white, this.inActiveBackgroundColor = Colors.white,
this.onTabChange}) this.onTabChange,
: super(key: key); });
@override @override
_CustomTabBarState createState() { CustomTabBarState createState() => CustomTabBarState();
return _CustomTabBarState();
}
} }
class _CustomTabBarState extends State<CustomTabBar> { class CustomTabBarState extends State<CustomTabBar> {
int selectedIndex = 0; int selectedIndex = 0;
@override @override
@ -65,44 +62,53 @@ class _CustomTabBarState extends State<CustomTabBar> {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
itemBuilder: (cxt, index) => myTab(widget.tabs[index], index), itemBuilder: (cxt, index) => myTab(widget.tabs[index], index).expanded,
separatorBuilder: (cxt, index) => 4.width, separatorBuilder: (cxt, index) => 4.width,
itemCount: widget.tabs.length, itemCount: widget.tabs.length,
); );
} else { } else {
parentWidget = Row( parentWidget = Row(
spacing: 4, mainAxisAlignment: MainAxisAlignment.center,
spacing: 4.w,
children: [for (int i = 0; i < widget.tabs.length; i++) myTab(widget.tabs[i], i).expanded], children: [for (int i = 0; i < widget.tabs.length; i++) myTab(widget.tabs[i], i).expanded],
); );
} }
return Container( return Container(
height: 62.h, height: 62.h,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4.w),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 11, borderRadius: 12.r,
), ),
child: parentWidget); child: Center(child: parentWidget));
} }
Widget myTab(CustomTabBarModel tabBar, int currentIndex) { Widget myTab(CustomTabBarModel tabBar, int currentIndex) {
bool isSelected = selectedIndex == currentIndex; bool isSelected = selectedIndex == currentIndex;
return Container( return Container(
height: 54.h, height: 54.h,
padding: EdgeInsets.only(top: 4, bottom: 4, left: 16, right: 16), padding: EdgeInsets.only(top: 4.h, bottom: 4.h, left: 16.w, right: 16.w),
alignment: Alignment.center, alignment: Alignment.center,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: isSelected ? widget.activeBackgroundColor : widget.inActiveBackgroundColor, color: isSelected ? widget.activeBackgroundColor : widget.inActiveBackgroundColor,
borderRadius: 12, borderRadius: 12.r,
), ),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
spacing: 4, spacing: 4.w,
children: [ children: [
if (tabBar.image != null) Utils.buildSvgWithAssets(icon: tabBar.image!, height: 18, width: 18, iconColor: isSelected ? widget.activeTextColor : widget.inActiveTextColor), if (tabBar.image != null)
tabBar.title Utils.buildSvgWithAssets(
.toText13(weight: isSelected ? FontWeight.w600 : FontWeight.w500, color: isSelected ? widget.activeTextColor : widget.inActiveTextColor, letterSpacing: isSelected ? -0.3 : -0.1), icon: tabBar.image!,
height: 18.h,
width: 18.w,
iconColor: isSelected ? widget.activeTextColor : widget.inActiveTextColor,
),
tabBar.title.toText13(
weight: isSelected ? FontWeight.w600 : FontWeight.w500,
color: isSelected ? widget.activeTextColor : widget.inActiveTextColor,
letterSpacing: isSelected ? -0.3 : -0.1),
], ],
)).onPress(() { )).onPress(() {
setState(() { setState(() {

@ -99,7 +99,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
backgroundColor: Colors.white, backgroundColor: Colors.white,
textAlign: TextAlign.start, textAlign: TextAlign.start,
textStyle: TextStyle( textStyle: TextStyle(
fontSize: 18.fSize, fontSize: 18.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.46, letterSpacing: -0.46,
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
@ -110,7 +110,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
viewHeaderStyle: DateRangePickerViewHeaderStyle( viewHeaderStyle: DateRangePickerViewHeaderStyle(
backgroundColor: Colors.white, backgroundColor: Colors.white,
textStyle: TextStyle( textStyle: TextStyle(
fontSize: 14.fSize, fontSize: 14.f,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.46, letterSpacing: -0.46,
color: AppColors.textColor, color: AppColors.textColor,
@ -129,7 +129,7 @@ class _DateRangeSelectorState extends State<DateRangeSelector> {
todayHighlightColor: Colors.transparent, todayHighlightColor: Colors.transparent,
monthCellStyle: DateRangePickerMonthCellStyle( monthCellStyle: DateRangePickerMonthCellStyle(
textStyle: TextStyle( textStyle: TextStyle(
fontSize: 12.fSize, fontSize: 12.f,
color: AppColors.textColor, color: AppColors.textColor,
), ),
todayTextStyle: TextStyle( todayTextStyle: TextStyle(

@ -16,27 +16,27 @@ class CustomCountryDropdown extends StatefulWidget {
final Function(String)? onPhoneNumberChanged; final Function(String)? onPhoneNumberChanged;
final bool isFromBottomSheet; final bool isFromBottomSheet;
final bool isEnableTextField; final bool isEnableTextField;
Widget? textField; final Widget? textField;
CustomCountryDropdown({ const CustomCountryDropdown({
Key? key, super.key,
required this.countryList, required this.countryList,
this.onCountryChange, this.onCountryChange,
this.onPhoneNumberChanged, this.onPhoneNumberChanged,
this.isFromBottomSheet = false, this.isFromBottomSheet = false,
this.isEnableTextField = false, this.isEnableTextField = false,
this.textField, this.textField,
}) : super(key: key); });
@override @override
_CustomCountryDropdownState createState() => _CustomCountryDropdownState(); CustomCountryDropdownState createState() => CustomCountryDropdownState();
} }
class _CustomCountryDropdownState extends State<CustomCountryDropdown> { class CustomCountryDropdownState extends State<CustomCountryDropdown> {
CountryEnum? selectedCountry; CountryEnum? selectedCountry;
late OverlayEntry _overlayEntry; late OverlayEntry _overlayEntry;
bool _isDropdownOpen = false; bool _isDropdownOpen = false;
FocusNode textFocusNode = new FocusNode(); FocusNode textFocusNode = FocusNode();
@override @override
void initState() { void initState() {
@ -61,87 +61,78 @@ class _CustomCountryDropdownState extends State<CustomCountryDropdown> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>(); AppState appState = getIt.get<AppState>();
return Container( return Row(
height: 40.h, children: [
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(borderRadius: 10.h), GestureDetector(
child: Row( onTap: () {
children: [ if (_isDropdownOpen) {
_closeDropdown();
} else {
_openDropdown();
}
},
child: Row(
children: [
Utils.buildSvgWithAssets(icon: selectedCountry != null ? selectedCountry!.iconPath : AppAssets.ksa, width: 40.h, height: 40.h),
SizedBox(width: 8.h),
Utils.buildSvgWithAssets(icon: _isDropdownOpen ? AppAssets.dropdow_icon : AppAssets.dropdow_icon),
],
),
),
SizedBox(width: 4.h),
if (widget.isFromBottomSheet)
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (_isDropdownOpen) { if (widget.isEnableTextField && textFocusNode.canRequestFocus) {
_closeDropdown(); FocusScope.of(context).requestFocus(textFocusNode);
} else {
_openDropdown();
} }
}, },
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Utils.buildSvgWithAssets(icon: selectedCountry != null ? selectedCountry!.iconPath : AppAssets.ksa, width: 40.h, height: 40.h), Text(
SizedBox(width: 8.h), LocaleKeys.phoneNumber.tr(),
Utils.buildSvgWithAssets(icon: _isDropdownOpen ? AppAssets.dropdow_icon : AppAssets.dropdow_icon), style: TextStyle(fontSize: 12.f, height: 1.5, fontWeight: FontWeight.w500, letterSpacing: -1),
], ),
), Row(
), mainAxisAlignment: MainAxisAlignment.start,
SizedBox(width: 4.h), children: [
if (widget.isFromBottomSheet) Text(
GestureDetector( selectedCountry!.countryCode,
onTap: () { style: TextStyle(fontSize: 12.f, fontWeight: FontWeight.w600, letterSpacing: -0.4, height: 1.5),
if (widget.isEnableTextField && textFocusNode.canRequestFocus) { ),
FocusScope.of(context).requestFocus(textFocusNode); SizedBox(width: 4.h),
} if (widget.isEnableTextField)
}, SizedBox(
child: Column( height: 20.h,
crossAxisAlignment: CrossAxisAlignment.start, width: 200.h,
mainAxisAlignment: MainAxisAlignment.start, child: Align(
children: [ alignment: Alignment.centerLeft,
Row( child: TextField(
children: [ focusNode: textFocusNode,
Text( style: TextStyle(fontSize: 12.f, fontWeight: FontWeight.w600, letterSpacing: -0.4, height: 1.5),
LocaleKeys.phoneNumber.tr(), decoration: InputDecoration(hintText: "", isDense: true, border: InputBorder.none, contentPadding: EdgeInsets.zero),
style: TextStyle(fontSize: 12.fSize, height: 1.2.h, fontWeight: FontWeight.w500, letterSpacing: -1), keyboardType: TextInputType.phone,
), onChanged: widget.onPhoneNumberChanged,
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
selectedCountry!.countryCode,
style: TextStyle(fontSize: 12.fSize, fontWeight: FontWeight.w600, letterSpacing: -0.4, height: 1.5),
),
SizedBox(width: 4.h),
if (widget.isEnableTextField)
SizedBox(
height: 20.h,
width: 200.h,
child: Align(
alignment: Alignment.centerLeft,
child: TextField(
focusNode: textFocusNode,
style: TextStyle(fontSize: 12.fSize, fontWeight: FontWeight.w600, letterSpacing: -0.4, height: 1.5),
decoration: InputDecoration(hintText: "", isDense: true, border: InputBorder.none, contentPadding: EdgeInsets.zero),
keyboardType: TextInputType.phone,
onChanged: widget.onPhoneNumberChanged,
),
), ),
), ),
], ),
) ],
], )
), ],
),
if (!widget.isFromBottomSheet)
Text(
selectedCountry != null
? appState.getLanguageCode() == "ar"
? selectedCountry!.nameArabic
: selectedCountry!.displayName
: LocaleKeys.selectCountry.tr(),
style: TextStyle(fontSize: 14.fSize, height: 21 / 14, fontWeight: FontWeight.w500, letterSpacing: -0.2),
), ),
], ),
), if (!widget.isFromBottomSheet)
Text(
selectedCountry != null
? appState.getLanguageCode() == "ar"
? selectedCountry!.nameArabic
: selectedCountry!.displayName
: LocaleKeys.selectCountry.tr(),
style: TextStyle(fontSize: 14.f, height: 21 / 14, fontWeight: FontWeight.w500, letterSpacing: -0.2),
),
],
); );
} }
@ -202,7 +193,7 @@ class _CustomCountryDropdownState extends State<CustomCountryDropdown> {
if (!widget.isFromBottomSheet) SizedBox(width: 12.h), if (!widget.isFromBottomSheet) SizedBox(width: 12.h),
if (!widget.isFromBottomSheet) if (!widget.isFromBottomSheet)
Text(appState.getLanguageCode() == "ar" ? country.nameArabic : country.displayName, Text(appState.getLanguageCode() == "ar" ? country.nameArabic : country.displayName,
style: TextStyle(fontSize: 14.fSize, height: 21 / 14, fontWeight: FontWeight.w500, letterSpacing: -0.2)), style: TextStyle(fontSize: 14.f, height: 21 / 14, fontWeight: FontWeight.w500, letterSpacing: -0.2)),
], ],
), ),
)), )),

@ -81,7 +81,7 @@ class DropdownWidget extends StatelessWidget {
return Text( return Text(
labelText, labelText,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: labelColor ?? Color(0xff898A8D), color: labelColor ?? Color(0xff898A8D),
letterSpacing: -0.2, letterSpacing: -0.2,
@ -111,7 +111,7 @@ class DropdownWidget extends StatelessWidget {
child: Text( child: Text(
e, e,
style: TextStyle( style: TextStyle(
fontSize: 14.fSize, fontSize: 14.f,
height: 21 / 14, height: 21 / 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
letterSpacing: -0.2, letterSpacing: -0.2,
@ -142,7 +142,7 @@ class DropdownWidget extends StatelessWidget {
textAlign: TextAlign.left, textAlign: TextAlign.left,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
style: TextStyle( style: TextStyle(
fontSize: 14.fSize, fontSize: 14.f,
height: 21 / 14, height: 21 / 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: (selectedValue != null && selectedValue!.isNotEmpty) ? const Color(0xff2E3039) : const Color(0xffB0B0B0), color: (selectedValue != null && selectedValue!.isNotEmpty) ? const Color(0xff2E3039) : const Color(0xffB0B0B0),

@ -145,7 +145,7 @@ class CustomGraph extends StatelessWidget {
'${dataPoint.actualValue} ${dataPoint.unitOfMeasurement??""} - ${dataPoint.displayTime}', '${dataPoint.actualValue} ${dataPoint.unitOfMeasurement??""} - ${dataPoint.displayTime}',
TextStyle( TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 12.fSize, fontSize: 12.f,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
); );
} }

@ -9,7 +9,6 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/dropdown/country_dropdown_widget.dart'; import 'package:hmg_patient_app_new/widgets/dropdown/country_dropdown_widget.dart';
import 'package:keyboard_actions/keyboard_actions.dart';
import '../core/dependencies.dart'; import '../core/dependencies.dart';
@ -36,9 +35,9 @@ class TextInputWidget extends StatelessWidget {
final bool isCountryDropDown; final bool isCountryDropDown;
final bool hasError; final bool hasError;
final String? errorMessage; final String? errorMessage;
Function(CountryEnum)? onCountryChange; final Function(CountryEnum)? onCountryChange;
final SelectionTypeEnum? selectionType; final SelectionTypeEnum? selectionType;
final num? fontSize; final double? fontSize;
final bool? isWalletAmountInput; final bool? isWalletAmountInput;
final Widget? suffix; final Widget? suffix;
final Color? labelColor; final Color? labelColor;
@ -70,7 +69,7 @@ class TextInputWidget extends StatelessWidget {
this.errorMessage, this.errorMessage,
this.onCountryChange, this.onCountryChange,
this.selectionType, this.selectionType,
this.fontSize = 14, this.fontSize,
this.isWalletAmountInput = false, this.isWalletAmountInput = false,
this.suffix, this.suffix,
this.labelColor, this.labelColor,
@ -118,7 +117,7 @@ class TextInputWidget extends StatelessWidget {
alignment: Alignment.center, alignment: Alignment.center,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: Colors.white, color: Colors.white,
borderRadius: isAllowRadius ? 20.h : null, borderRadius: isAllowRadius ? (12.r) : null,
side: isBorderAllowed ? BorderSide(color: hasError ? errorColor : const Color(0xffefefef), width: 1) : null, side: isBorderAllowed ? BorderSide(color: hasError ? errorColor : const Color(0xffefefef), width: 1) : null,
), ),
child: Row( child: Row(
@ -151,7 +150,7 @@ class TextInputWidget extends StatelessWidget {
], ],
), ),
), ),
(suffix!= null )?suffix!:SizedBox.shrink() (suffix != null) ? suffix! : SizedBox.shrink()
], ],
), ),
), ),
@ -167,7 +166,7 @@ class TextInputWidget extends StatelessWidget {
errorMessage!, errorMessage!,
style: TextStyle( style: TextStyle(
color: errorColor, color: errorColor,
fontSize: 12.fSize, fontSize: 12.f,
), ),
), ),
), ),
@ -182,7 +181,7 @@ class TextInputWidget extends StatelessWidget {
margin: EdgeInsets.only(right: 10.h), margin: EdgeInsets.only(right: 10.h),
padding: EdgeInsets.all(8.h), padding: EdgeInsets.all(8.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
borderRadius: 12.h, borderRadius: 12.r,
color: AppColors.greyColor, color: AppColors.greyColor,
), ),
child: Utils.buildSvgWithAssets(icon: leadingIcon!)); child: Utils.buildSvgWithAssets(icon: leadingIcon!));
@ -195,7 +194,7 @@ class TextInputWidget extends StatelessWidget {
width: 40.h, width: 40.h,
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
padding: EdgeInsets.all(8.h), padding: EdgeInsets.all(8.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(borderRadius: 10.h, color: AppColors.whiteColor), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(borderRadius: 12.r, color: AppColors.whiteColor),
child: GestureDetector( child: GestureDetector(
onTap: () async { onTap: () async {
bool isGregorian = true; bool isGregorian = true;
@ -206,7 +205,9 @@ class TextInputWidget extends StatelessWidget {
initialDate: DateTime.now(), initialDate: DateTime.now(),
fontFamily: appState.getLanguageCode() == "ar" ? "GESSTwo" : "Poppins", fontFamily: appState.getLanguageCode() == "ar" ? "GESSTwo" : "Poppins",
okWidget: Padding(padding: EdgeInsets.only(right: 8.h), child: Utils.buildSvgWithAssets(icon: AppAssets.confirm, width: 24.h, height: 24.h)), okWidget: Padding(padding: EdgeInsets.only(right: 8.h), child: Utils.buildSvgWithAssets(icon: AppAssets.confirm, width: 24.h, height: 24.h)),
cancelWidget: Padding(padding: EdgeInsets.only(right: 8.h), child: Utils.buildSvgWithAssets(icon: AppAssets.cancel, iconColor: Colors.white, width: 24.h, height: 24.h)), cancelWidget: Padding(
padding: EdgeInsets.only(right: 8.h),
child: Utils.buildSvgWithAssets(icon: AppAssets.cancel, iconColor: Colors.white, width: 24.h, height: 24.h)),
onCalendarTypeChanged: (bool value) { onCalendarTypeChanged: (bool value) {
isGregorian = value; isGregorian = value;
}); });
@ -226,7 +227,7 @@ class TextInputWidget extends StatelessWidget {
return Text( return Text(
labelText, labelText,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: labelColor ?? AppColors.inputLabelTextColor, color: labelColor ?? AppColors.inputLabelTextColor,
letterSpacing: -0, letterSpacing: -0,
@ -235,6 +236,7 @@ class TextInputWidget extends StatelessWidget {
} }
Widget _buildTextField(BuildContext context) { Widget _buildTextField(BuildContext context) {
double fontS = fontSize ?? 14.f;
return TextField( return TextField(
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
@ -253,11 +255,11 @@ class TextInputWidget extends StatelessWidget {
FocusManager.instance.primaryFocus?.unfocus(); FocusManager.instance.primaryFocus?.unfocus();
}, },
onSubmitted: onSubmitted, onSubmitted: onSubmitted,
style: TextStyle(fontSize: fontSize!.fSize, height: isWalletAmountInput! ? 1 / 4 : 0, fontWeight: FontWeight.w500, color: AppColors.textColor, letterSpacing: -1), style: TextStyle(fontSize: fontS, height: isWalletAmountInput! ? 1 / 4 : 0, fontWeight: FontWeight.w500, color: AppColors.textColor, letterSpacing: -1),
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
hintText: hintText, hintText: hintText,
hintStyle: TextStyle(fontSize: 14.fSize, height: 21 / 16, fontWeight: FontWeight.w500, color: AppColors.textColor, letterSpacing: -0.75), hintStyle: TextStyle(fontSize: 14.f, height: 21 / 16, fontWeight: FontWeight.w500, color: Color(0xff898A8D), letterSpacing: -0.75),
prefixIconConstraints: BoxConstraints(minWidth: 30.h), prefixIconConstraints: BoxConstraints(minWidth: 30.h),
prefixIcon: prefix == null ? null : "+${prefix!}".toText14(letterSpacing: -1, color: AppColors.textColor, weight: FontWeight.w500), prefixIcon: prefix == null ? null : "+${prefix!}".toText14(letterSpacing: -1, color: AppColors.textColor, weight: FontWeight.w500),
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
@ -269,13 +271,12 @@ class TextInputWidget extends StatelessWidget {
} }
_buildTrailingIconForSearch(BuildContext context) { _buildTrailingIconForSearch(BuildContext context) {
final AppState appState = getIt.get<AppState>();
return Container( return Container(
height: 40.h, height: 40.h,
width: 40.h, width: 40.h,
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
padding: EdgeInsets.all(8.h), padding: EdgeInsets.all(8.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(borderRadius: 10.h, color: AppColors.whiteColor), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(borderRadius: 12.r, color: AppColors.whiteColor),
child: Utils.buildSvgWithAssets(icon: AppAssets.search_icon), child: Utils.buildSvgWithAssets(icon: AppAssets.search_icon),
); );
} }

@ -35,7 +35,6 @@ class _LanguageSelectorState extends State<LanguageSelector> {
return InkWell( return InkWell(
onTap: () { onTap: () {
final newLanguage = widget.currentLanguage == 'ar' ? 'en' : 'ar'; final newLanguage = widget.currentLanguage == 'ar' ? 'en' : 'ar';
print(newLanguage);
widget.onLanguageChanged(newLanguage); widget.onLanguageChanged(newLanguage);
}, },
child: Utils.buildSvgWithAssets(icon: AppAssets.globe_black)); child: Utils.buildSvgWithAssets(icon: AppAssets.globe_black));
@ -43,7 +42,7 @@ class _LanguageSelectorState extends State<LanguageSelector> {
return Stack(clipBehavior: Clip.none, children: [ return Stack(clipBehavior: Clip.none, children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular((12.r)),
color: AppColors.secondaryLightRedColor, color: AppColors.secondaryLightRedColor,
), ),
child: InkWell( child: InkWell(
@ -53,7 +52,7 @@ class _LanguageSelectorState extends State<LanguageSelector> {
}, },
child: Container( child: Container(
padding: EdgeInsets.all(8.h), padding: EdgeInsets.all(8.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12)), decoration: BoxDecoration(borderRadius: BorderRadius.circular((12.r))),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -63,7 +62,7 @@ class _LanguageSelectorState extends State<LanguageSelector> {
currentLangData['name']?.toUpperCase() ?? 'EN', currentLangData['name']?.toUpperCase() ?? 'EN',
style: context.dynamicTextStyle( style: context.dynamicTextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontSize: 14.fSize, fontSize: 14.f,
color: AppColors.primaryRedColor, color: AppColors.primaryRedColor,
letterSpacing: 0.1, letterSpacing: 0.1,
isLanguageSwitcher: true, isLanguageSwitcher: true,

@ -15,14 +15,16 @@ class LoaderBottomSheet {
_isVisible = true; _isVisible = true;
final context = _navService.navigatorKey.currentContext!;
showModalBottomSheet( showModalBottomSheet(
context: _navService.navigatorKey.currentContext!, context: context,
isDismissible: (ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat || kDebugMode) ? true : false, isDismissible: (ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat || kDebugMode) ? true : false,
enableDrag: false, enableDrag: false,
constraints: BoxConstraints(minWidth: MediaQuery.of(context).size.width),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (_) { builder: (_) {
return Container( return Container(
height: MediaQuery.of(_navService.navigatorKey.currentContext!).size.height * 0.3, height: MediaQuery.of(context).size.height * 0.3,
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.vertical(top: Radius.circular(16)), borderRadius: BorderRadius.vertical(top: Radius.circular(16)),

@ -67,7 +67,6 @@ dependencies:
jiffy: ^6.4.3 jiffy: ^6.4.3
hijri_gregorian_calendar: ^0.1.1 hijri_gregorian_calendar: ^0.1.1
sms_otp_auto_verify: ^2.2.0 sms_otp_auto_verify: ^2.2.0
web: any web: any
flutter_staggered_animations: ^1.1.1 flutter_staggered_animations: ^1.1.1
smooth_corner: ^1.1.1 smooth_corner: ^1.1.1

Loading…
Cancel
Save