update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent b83c48abe5
commit f977dc10a4

@ -133,7 +133,7 @@ abstract class BaseMovingFloatingWidget : Service() {
return true return true
} }
override fun onDoubleTap(e: MotionEvent?): Boolean { override fun onDoubleTap(e: MotionEvent): Boolean {
miniCircleDoubleTap() miniCircleDoubleTap()
return super.onDoubleTap(e) return super.onDoubleTap(e)
} }

@ -230,7 +230,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
handleDragDialog() handleDragDialog()
mDetector = GestureDetectorCompat( mDetector = GestureDetectorCompat(
context, requireContext(),
MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() }) MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() })
) )
@ -1152,7 +1152,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
return true return true
} }
override fun onDoubleTap(e: MotionEvent?): Boolean { override fun onDoubleTap(e: MotionEvent): Boolean {
miniCircleDoubleTap() miniCircleDoubleTap()
return super.onDoubleTap(e) return super.onDoubleTap(e)
} }

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 50; objectVersion = 54;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -210,7 +210,7 @@
97C146E61CF9000F007C117D /* Project object */ = { 97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1300; LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "The Chromium Authors"; ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
@ -255,10 +255,12 @@
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
); );
name = "Thin Binary"; name = "Thin Binary";
outputPaths = ( outputPaths = (
@ -309,9 +311,6 @@
"${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework",
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
"${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework",
"${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework",
"${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
@ -350,9 +349,6 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
@ -361,6 +357,7 @@
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1300" LastUpgradeVersion = "1430"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

@ -49,7 +49,7 @@ class CheckActivationCodeForDoctorAppResponseModel {
} }
class ListDoctorsClinic { class ListDoctorsClinic {
Null setupID; String? setupID;
int? projectID; int? projectID;
int? doctorID; int? doctorID;
int? clinicID; int? clinicID;
@ -85,8 +85,8 @@ class MemberInformation {
String? email; String? email;
int? employeeId; int? employeeId;
int? memberId; int? memberId;
Null memberName; String? memberName;
Null memberNameArabic; String? memberNameArabic;
String? preferredLanguage; String? preferredLanguage;
List<Roles>? roles; List<Roles>? roles;

@ -3,7 +3,7 @@ class NewLoginInformationModel {
List<ListMemberInformation>? listMemberInformation; List<ListMemberInformation>? listMemberInformation;
String? logInTokenID; String? logInTokenID;
String? mobileNumber; String? mobileNumber;
Null? sELECTDeviceIMEIbyIMEIList; String? sELECTDeviceIMEIbyIMEIList;
int? userID; int? userID;
String? zipCode; String? zipCode;
bool? isActiveCode; bool? isActiveCode;
@ -42,8 +42,7 @@ class NewLoginInformationModel {
final Map<String, dynamic> data = <String, dynamic>{}; final Map<String, dynamic> data = <String, dynamic>{};
data['DoctorID'] = doctorID; data['DoctorID'] = doctorID;
if (listMemberInformation != null) { if (listMemberInformation != null) {
data['List_MemberInformation'] = data['List_MemberInformation'] = listMemberInformation?.map((v) => v.toJson()).toList();
listMemberInformation?.map((v) => v.toJson()).toList();
} }
data['LogInTokenID'] = logInTokenID; data['LogInTokenID'] = logInTokenID;
data['MobileNumber'] = mobileNumber; data['MobileNumber'] = mobileNumber;
@ -57,10 +56,10 @@ class NewLoginInformationModel {
} }
class ListMemberInformation { class ListMemberInformation {
Null? setupID; String? setupID;
int? memberID; int? memberID;
String? memberName; String? memberName;
Null? memberNameN; String? memberNameN;
String? preferredLang; String? preferredLang;
String? pIN; String? pIN;
String? saltHash; String? saltHash;

@ -1,19 +1,12 @@
class ClinicModel { class ClinicModel {
Null setupID; String? setupID;
int? projectID; int? projectID;
int? doctorID; int? doctorID;
int? clinicID; int? clinicID;
bool? isActive; bool? isActive;
String? clinicName; String? clinicName;
ClinicModel( ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName});
{this.setupID,
this.projectID,
this.doctorID,
this.clinicID,
this.isActive,
this.clinicName});
ClinicModel.fromJson(Map<String, dynamic> json) { ClinicModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];

@ -106,7 +106,7 @@ class AuthenticationService extends BaseService {
try { try {
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) {
_checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String? error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: checkActivationCodeRequestModel.toJson()); }, body: checkActivationCodeRequestModel.toJson());

@ -51,7 +51,7 @@ class AuthenticationViewModel extends BaseViewModel {
NewLoginInformationModel? loggedUser; NewLoginInformationModel? loggedUser;
GetIMEIDetailsModel user = GetIMEIDetailsModel(); GetIMEIDetailsModel? user;
UserModel userInfo = UserModel(); UserModel userInfo = UserModel();
final LocalAuthentication auth = LocalAuthentication(); final LocalAuthentication auth = LocalAuthentication();
@ -76,13 +76,11 @@ class AuthenticationViewModel extends BaseViewModel {
if (data != null) { if (data != null) {
user = GetIMEIDetailsModel.fromJson(data); user = GetIMEIDetailsModel.fromJson(data);
} }
var profileInfo = await sharedPref.getObj(DOCTOR_PROFILE); var profileInfo = await sharedPref.getObj(DOCTOR_PROFILE);
profileInfo['IMEI'] = token; profileInfo['IMEI'] = token;
profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
profileInfo['BioMetricEnabled'] = true; profileInfo['BioMetricEnabled'] = true;
profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile;
InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo);
insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description'];
insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN'];
@ -90,12 +88,12 @@ class AuthenticationViewModel extends BaseViewModel {
insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description'];
insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN'];
insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID);
insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID;
insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA;
insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
insertIMEIDetailsModel.password = userInfo.password; insertIMEIDetailsModel.password = userInfo.password;
insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser!.listMemberInformation![0].employeeID : int.parse(user.editedBy.toString()); insertIMEIDetailsModel.loginDoctorID = loggedIn != null ? loggedIn["employeeID"] : int.parse(user!.editedBy.toString());
await _authService.insertDeviceImei(insertIMEIDetailsModel); await _authService.insertDeviceImei(insertIMEIDetailsModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -126,17 +124,17 @@ class AuthenticationViewModel extends BaseViewModel {
Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel(
iMEI: user.iMEI, iMEI: user!.iMEI,
facilityId: user.projectID, facilityId: user!.projectID,
memberID: user.doctorID, memberID: user!.doctorID,
loginDoctorID: int.parse(user.editedBy.toString()), loginDoctorID: int.parse(user!.editedBy.toString()),
zipCode: user.outSA == true ? '971' : '966', zipCode: user!.outSA == true ? '971' : '966',
mobileNumber: user.mobile, mobileNumber: user!.mobile,
oTPSendType: authMethodType.getTypeIdService(), oTPSendType: authMethodType.getTypeIdService(),
isMobileFingerPrint: 1, isMobileFingerPrint: 1,
vidaAuthTokenID: user.vidaAuthTokenID, vidaAuthTokenID: user!.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID); vidaRefreshTokenID: user!.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user.editedBy.toString()); await sharedPref.setString(DOCTOR_ID, user!.editedBy.toString());
await _authService.sendActivationCodeVerificationScreen(activationCodeModel); await _authService.sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -172,17 +170,17 @@ class AuthenticationViewModel extends BaseViewModel {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel(
zipCode: loggedUser != null ? loggedUser!.zipCode : user.zipCode, zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode,
mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user.mobile, mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile,
projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID, projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID,
logInTokenID: await sharedPref.getString(TOKEN), logInTokenID: await sharedPref.getString(TOKEN),
activationCode: activationCode ?? '0000', activationCode: activationCode ?? '0000',
memberID: userInfo.userID != null ? int.parse(userInfo.userID!) : user.doctorID, memberID: userInfo.userID != null ? int.parse(userInfo.userID!) : user!.doctorID,
password: userInfo.password, password: userInfo.password,
facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(), facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user!.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken, iMEI: localToken,
loginDoctorID: loggedUser != null ? loggedUser!.listMemberInformation![0].employeeID : int.parse(user.editedBy.toString()), loginDoctorID: loggedUser != null ? loggedUser!.listMemberInformation![0].employeeID : int.parse(user!.editedBy.toString()),
///loggedUser.listMemberInformation[0].employeeID, ///loggedUser.listMemberInformation[0].employeeID,
// loggedUser.listMemberInformation[0].employeeID, // loggedUser.listMemberInformation[0].employeeID,
@ -332,8 +330,8 @@ class AuthenticationViewModel extends BaseViewModel {
if (_authService.dashboardItemsList.length > 0) { if (_authService.dashboardItemsList.length > 0) {
user = _authService.dashboardItemsList[0]; user = _authService.dashboardItemsList[0];
sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID!); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user!.vidaRefreshTokenID!);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID!); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user!.vidaAuthTokenID!);
this.unverified = true; this.unverified = true;
} }
setState(ViewState.Idle); setState(ViewState.Idle);

@ -108,7 +108,7 @@ class _LandingPageState extends State<LandingPage> {
} }
} }
class MyAppbar extends StatelessWidget { class MyAppbar extends StatelessWidget implements PreferredSizeWidget {
@override @override
final Size preferredSize; final Size preferredSize;

@ -1,26 +1,22 @@
import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../routes.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
Utils helpers = Utils(); Utils helpers = Utils();
@ -40,8 +36,9 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientSearchHeader(title: "ER Sign In",) appBar: PatientSearchHeader(
, title: "ER Sign In",
),
body: Center( body: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight! / 7), margin: EdgeInsets.only(top: SizeConfig.realScreenHeight! / 7),
@ -58,10 +55,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
SizedBox( SizedBox(
height: 7, height: 7,
), ),
AppText(TranslationBase.of(context).scanERQrCode, AppText(TranslationBase.of(context).scanERQrCode, fontSize: 14, fontWeight: FontWeight.w400, textAlign: TextAlign.center),
fontSize: 14,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center),
SizedBox( SizedBox(
height: 15, height: 15,
), ),
@ -98,22 +92,21 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
try { try {
List<String> listOfParams = result.split(','); List<String> listOfParams = result.split(',');
int patientID = 0; int patientID = 0;
if (listOfParams[0].length != 0) if (listOfParams[0].length != 0) patientID = int.parse(listOfParams[0]);
patientID = int.parse(listOfParams[0]); showMyDialog(
showMyDialog(context:context, firstAction: (){ context: context,
firstAction: () {
signInERPatient(context: context, model: model, patientId: patientID, signInType: 1); signInERPatient(context: context, model: model, patientId: patientID, signInType: 1);
} , secondAction: (){ },
secondAction: () {
signInERPatient(context: context, model: model, patientId: patientID, signInType: 2); signInERPatient(context: context, model: model, patientId: patientID, signInType: 2);
}); });
} catch (e) { } catch (e) {
Utils.showErrorToast("Please Enter Valid Code"); Utils.showErrorToast("Please Enter Valid Code");
} }
} }
} }
signInERPatient({BuildContext? context, ERSignInViewModel? model, patientId, signInType}) async { signInERPatient({BuildContext? context, ERSignInViewModel? model, patientId, signInType}) async {
GifLoaderDialogUtils.showMyDialog(context!); GifLoaderDialogUtils.showMyDialog(context!);
await model!.signInERPatient(patientId: patientId, signInType: signInType); await model!.signInERPatient(patientId: patientId, signInType: signInType);
@ -124,11 +117,14 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
/// TODO Elham* Make this as custom Dialog /// TODO Elham* Make this as custom Dialog
showMyDialog({BuildContext? context, Function? firstAction,Function? secondAction, }) { showMyDialog({
BuildContext? context,
Function? firstAction,
Function? secondAction,
}) {
showDialog( showDialog(
context: context!, context: context!,
builder: (ctx) => Center( builder: (ctx) => Center(
@ -171,9 +167,7 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
color: Colors.white, color: Colors.white,
child: AppText( child: AppText(
projectViewModel!.isArabic projectViewModel!.isArabic ? "الرجاء اختيار الإجراء الذي تريد القيام به" : 'Please choose the action you want to do ',
? "الرجاء اختيار الإجراء الذي تريد القيام به"
: 'Please choose the action you want to do ',
fontSize: 15, fontSize: 15,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -219,6 +213,4 @@ class _ErSignInScreenState extends State<ErSignInScreen> {
), ),
)); ));
} }
} }

@ -42,7 +42,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
late ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
bool isMoreOption = false; bool isMoreOption = false;
bool onlySMSBox = false; bool onlySMSBox = false;
late AuthMethodTypes fingerPrintBefore; AuthMethodTypes fingerPrintBefore = AuthMethodTypes.Fingerprint;
late AuthMethodTypes selectedOption; late AuthMethodTypes selectedOption;
late AuthenticationViewModel authenticationViewModel; late AuthenticationViewModel authenticationViewModel;
@ -94,7 +94,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.72, letterSpacing: -0.72,
), ),
AppText( AppText(
Utils.convertToTitleCase(authenticationViewModel.user.doctorName ?? ""), Utils.convertToTitleCase(authenticationViewModel.user!.doctorName!),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -153,7 +153,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.4), letterSpacing: -0.4),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: authenticationViewModel.getType(authenticationViewModel.user.logInTypeID, context), text: authenticationViewModel.getType(authenticationViewModel.user!.logInTypeID, context),
style: TextStyle( style: TextStyle(
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
@ -172,10 +172,10 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
authenticationViewModel.user.editedOn != null authenticationViewModel.user!.editedOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn!), isMonthShort: true) ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user!.editedOn!), isMonthShort: true)
: authenticationViewModel.user.createdOn != null : authenticationViewModel.user!.createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn!), isMonthShort: true) ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user!.createdOn!), isMonthShort: true)
: '--', : '--',
textAlign: TextAlign.right, textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5,
@ -184,10 +184,10 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
AppText( AppText(
authenticationViewModel.user.editedOn != null authenticationViewModel.user!.editedOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn!)) ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user!.editedOn!))
: authenticationViewModel.user.createdOn != null : authenticationViewModel.user!.createdOn != null
? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn!)) ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user!.createdOn!))
: '--', : '--',
textAlign: TextAlign.right, textAlign: TextAlign.right,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
@ -250,7 +250,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
}, },
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel, authenticationViewModel: authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!), authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!),
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
)), )),
), ),
@ -350,7 +350,6 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async { sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async {
if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password); await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Utils.showErrorToast(authenticationViewModel.error); Utils.showErrorToast(authenticationViewModel.error);
@ -422,7 +421,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
new SMSOTP( new SMSOTP(
context, context,
type, type,
authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser!.mobileNumber : authenticationViewModel.user.mobile, authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser!.mobileNumber : authenticationViewModel.user!.mobile,
(value) { (value) {
showDialog( showDialog(
context: context, context: context,
@ -443,8 +442,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
await authenticationViewModel.showIOSAuthMessages(); await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return; if (!mounted) return;
if (authenticationViewModel.user != null && if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!) == AuthMethodTypes.Fingerprint || (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID!) == AuthMethodTypes.FaceID)) { SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes); this.sendActivationCode(authMethodTypes);
} else { } else {
setState(() { setState(() {

@ -1,12 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/screens/ER_singin/ER_singin_screen.dart'; import 'package:doctor_app_flutter/screens/ER_singin/ER_singin_screen.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart';
@ -18,24 +18,21 @@ import 'package:doctor_app_flutter/screens/patients/In_patient/in_patient_screen
import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_details/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_details/patient_referral_screen.dart';
import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterPatientPage.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:sticky_headers/sticky_headers/widget.dart'; import 'package:sticky_headers/sticky_headers/widget.dart';
import '../../widgets/shared/app_texts_widget.dart';
import 'label.dart'; import 'label.dart';
class HomeScreen extends StatefulWidget { class HomeScreen extends StatefulWidget {
@ -277,23 +274,41 @@ class _HomeScreenState extends State<HomeScreen> {
colorIndex = 0; colorIndex = 0;
List<LinearGradient> backgroundColors = []; List<LinearGradient> backgroundColors = [];
backgroundColors[0] = LinearGradient(begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [ backgroundColors.add(
LinearGradient(
begin: Alignment(-1.0, -2.0),
end: Alignment(1.0, 2.0),
colors: [
AppGlobal.appRedColor, AppGlobal.appRedColor,
Color(0xFFAD3B3B), Color(0xFFAD3B3B),
]); //AppGlobal.appRedColor; ],
backgroundColors[1] = LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [ ),
); //AppGlobal.appRedColor;
backgroundColors.add(
LinearGradient(
begin: Alignment.center,
end: Alignment.center,
colors: [
Color(0xFFC9C9C9), Color(0xFFC9C9C9),
Color(0xFFC9C9C9), Color(0xFFC9C9C9),
]); ],
backgroundColors[2] = LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [Color(0xFF71787E), AppGlobal.appTextColor]); ),
);
backgroundColors.add(
LinearGradient(
begin: Alignment.center,
end: Alignment.center,
colors: [Color(0xFF71787E), AppGlobal.appTextColor],
),
);
List<Color> backgroundIconColors = []; List<Color> backgroundIconColors = [];
backgroundIconColors[0] = Colors.white12; backgroundIconColors.add(Colors.white12);
backgroundIconColors[1] = Colors.white38; backgroundIconColors.add(Colors.white38);
backgroundIconColors[2] = Colors.white10; backgroundIconColors.add(Colors.white10);
List<Color> textColors = []; List<Color> textColors = [];
textColors[0] = Colors.white; textColors.add(Colors.white);
textColors[1] = Color(0xFF353E47); textColors.add(Color(0xFF353E47));
textColors[2] = Colors.white; textColors.add(Colors.white);
List<HomePatientCard> patientCards = []; List<HomePatientCard> patientCards = [];

@ -1,16 +1,16 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/core/model/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/live_care/live-care_transfer_to_admin.dart'; import 'package:doctor_app_flutter/screens/live_care/live-care_transfer_to_admin.dart';
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/video_channel_utils.dart'; import 'package:doctor_app_flutter/utils/video_channel_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
@ -233,7 +233,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
isInPatient: cardsList[index].isInPatient, isInPatient: cardsList[index].isInPatient,
isDischargedPatient: cardsList[index].isDischargedPatient, isDischargedPatient: cardsList[index].isDischargedPatient,
isDisable: cardsList[index].isDisable, isDisable: cardsList[index].isDisable,
onTap: cardsList[index].onTap!, onTap: cardsList[index].onTap,
//cardsList[index].onTap!(),
isLoading: cardsList[index].isLoading, isLoading: cardsList[index].isLoading,
isDartIcon: cardsList[index].isDartIcon, isDartIcon: cardsList[index].isDartIcon,
dartIcon: cardsList[index].dartIcon!, dartIcon: cardsList[index].dartIcon!,

@ -1,4 +1,5 @@
import 'dart:math'; import 'dart:math';
import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
@ -6,11 +7,10 @@ import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -42,8 +42,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
String _currentLocaleId = ""; String _currentLocaleId = "";
final SpeechToText speech = SpeechToText(); final SpeechToText speech = SpeechToText();
String lastStatus = ''; String lastStatus = '';
GlobalKey key = GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
String? lastError; String? lastError;
double level = 0.0; double level = 0.0;
@ -56,13 +55,9 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
super.didChangeDependencies(); super.didChangeDependencies();
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize( bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
onError: errorListener, onStatus: statusListener); _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId;
_currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en'
? 'en-GB'
: 'ar-SA'; // systemLocale.localeId;
if (!mounted) return; if (!mounted) return;
setState(() { setState(() {
@ -72,8 +67,9 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MedicineViewModel>(onModelReady: (model) async { return BaseView<MedicineViewModel>(
}, builder: (_, model, w) { onModelReady: (model) async {},
builder: (_, model, w) {
myController.text = model.searchText; myController.text = model.searchText;
return AppScaffold( return AppScaffold(
// baseViewModel: model, // baseViewModel: model,
@ -89,28 +85,26 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
height: 20, height: 20,
), ),
AppTextFieldCustomSearch( AppTextFieldCustomSearch(
hintText: hintText: TranslationBase.of(context).searchMedicineNameHere,
TranslationBase.of(context).searchMedicineNameHere,
searchController: myController, searchController: myController,
onFieldSubmitted: (value) { onFieldSubmitted: (value) {
searchMedicine(context, model); searchMedicine(context, model);
}, },
marginTop: 5, onChangeFun: (){}, marginTop: 5,
onChangeFun: (val) {},
), ),
Container( Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).youCanFind + TranslationBase.of(context).youCanFind +
(myController.text != '' (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') +
? model.pharmacyItemsList.length.toString()
: '0') +
" " + " " +
TranslationBase.of(context).medicineSearchResult +" '${myController.text}'", TranslationBase.of(context).medicineSearchResult +
" '${myController.text}'",
fontHeight: 1.4, fontHeight: 1.4,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -127,33 +121,23 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
if (myController.text != '') if (myController.text != '')
Container( Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0),
height: MediaQuery.of(context).size.height * 0.6, height: MediaQuery.of(context).size.height * 0.6,
child: ListView.builder( child: ListView.builder(
padding: const EdgeInsets.only(top: 20), padding: const EdgeInsets.only(top: 20),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: model.pharmacyItemsList == null itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length,
? 0
: model.pharmacyItemsList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
child: MedicineItemWidget( child: MedicineItemWidget(
label: model.pharmacyItemsList[index] label: model.pharmacyItemsList[index]["ItemDescription"],
["ItemDescription"], url: model.pharmacyItemsList[index]["ImageSRCUrl"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"],
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => PharmaciesListScreen( builder: (context) => PharmaciesListScreen(itemID: model.pharmacyItemsList[index]["ItemID"], url: model.pharmacyItemsList[index]["ImageSRCUrl"]),
itemID: model.pharmacyItemsList[index] settings: RouteSettings(name: 'PharmaciesListScreen'),
["ItemID"],
url: model.pharmacyItemsList[index]
["ImageSRCUrl"]),
settings: RouteSettings(
name: 'PharmaciesListScreen'),
), ),
); );
}, },
@ -199,7 +183,6 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
], ],
), ),
), ),
); );
}); });
} }
@ -240,8 +223,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
recognizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
lastStatus = ''; lastStatus = '';
myController.text = recognizedWord!; myController.text = recognizedWord!;
Future.delayed(const Duration(seconds: 2), () { Future.delayed(const Duration(seconds: 2), () {});
});
}); });
} }
@ -258,7 +240,6 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
}); });
} }
void soundLevelListener(double level) { void soundLevelListener(double level) {
minSoundLevel = min(minSoundLevel, level); minSoundLevel = min(minSoundLevel, level);
maxSoundLevel = max(maxSoundLevel, level); maxSoundLevel = max(maxSoundLevel, level);

@ -1,19 +1,13 @@
import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class InPatientHeader extends StatelessWidget { class InPatientHeader extends StatelessWidget implements PreferredSizeWidget {
InPatientHeader( InPatientHeader({required this.model, required this.specialClinic, this.activeTab, this.selectedMapId, this.onChangeFunc}) : super();
{required this.model,
required this.specialClinic,
this.activeTab,
this.selectedMapId,
this.onChangeFunc})
: super();
final PatientSearchViewModel model; final PatientSearchViewModel model;
final GetSpecialClinicalCareListResponseModel specialClinic; final GetSpecialClinicalCareListResponseModel specialClinic;
final activeTab; final activeTab;
@ -47,9 +41,7 @@ class InPatientHeader extends StatelessWidget {
letterSpacing: -1.44, letterSpacing: -1.44,
), ),
), ),
if (model.specialClinicalCareMappingList.isNotEmpty && if (model.specialClinicalCareMappingList.isNotEmpty && specialClinic != null && activeTab != 2)
specialClinic != null &&
activeTab != 2)
Container( Container(
width: MediaQuery.of(context).size.width * .3, width: MediaQuery.of(context).size.width * .3,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
@ -57,8 +49,7 @@ class InPatientHeader extends StatelessWidget {
dropdownColor: Colors.white, dropdownColor: Colors.white,
iconEnabledColor: Colors.black, iconEnabledColor: Colors.black,
isExpanded: true, isExpanded: true,
value: selectedMapId ?? value: selectedMapId ?? model.specialClinicalCareMappingList[0].nursingStationID,
model.specialClinicalCareMappingList[0].nursingStationID,
iconSize: 25, iconSize: 25,
elevation: 16, elevation: 16,
selectedItemBuilder: (BuildContext context) { selectedItemBuilder: (BuildContext context) {
@ -83,24 +74,15 @@ class InPatientHeader extends StatelessWidget {
), ),
child: Center( child: Center(
child: AppText( child: AppText(
model.specialClinicalCareMappingList.length model.specialClinicalCareMappingList.length.toString(),
.toString(),
color: Colors.white, color: Colors.white,
fontSize: fontSize: projectsProvider.isArabic ? 10 : 11,
projectsProvider.isArabic ? 10 : 11,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
)), )),
], ],
), ),
AppText( AppText(selectedMapId == null ? TranslationBase.of(context).all : item.description!, fontSize: 12, color: Colors.black, fontWeight: FontWeight.bold, textAlign: TextAlign.end),
selectedMapId == null
? TranslationBase.of(context).all
: item.description!,
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.bold,
textAlign: TextAlign.end),
], ],
); );
}).toList(); }).toList();

@ -1,24 +1,25 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/dashboard/get_special_clinical_care_List_Respose_Model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart'; import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/tab_utils.dart'; import 'package:doctor_app_flutter/utils/tab_utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../DischargedPatientPage.dart'; import '../DischargedPatientPage.dart';
import 'in_patient_list_page.dart'; import 'in_patient_list_page.dart';
class InPatientScreen extends StatefulWidget { class InPatientScreen extends StatefulWidget {
GetSpecialClinicalCareListResponseModel specialClinic; GetSpecialClinicalCareListResponseModel? specialClinic;
bool isAllClinic = true; bool isAllClinic = true;
bool showBottomSheet = false; bool showBottomSheet = false;
@ -30,8 +31,7 @@ class InPatientScreen extends StatefulWidget {
_InPatientScreenState createState() => _InPatientScreenState(); _InPatientScreenState createState() => _InPatientScreenState();
} }
class _InPatientScreenState extends State<InPatientScreen> class _InPatientScreenState extends State<InPatientScreen> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
late TabController _tabController; late TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
int selectedMapId = 0; int selectedMapId = 0;
@ -65,9 +65,9 @@ class _InPatientScreenState extends State<InPatientScreen>
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.clearPatientList(); model.clearPatientList();
if (widget.specialClinic != null) { if (widget.specialClinic != null && widget.specialClinic!.clinicID != null) {
await model print(widget.specialClinic!.toJson());
.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); await model.getSpecialClinicalCareMappingList(widget.specialClinic!.clinicID);
// requestModel.nursingStationID = // requestModel.nursingStationID =
// model.specialClinicalCareMappingList[0].nursingStationID; // model.specialClinicalCareMappingList[0].nursingStationID;
} }
@ -80,7 +80,7 @@ class _InPatientScreenState extends State<InPatientScreen>
appBar: InPatientHeader( appBar: InPatientHeader(
model: model, model: model,
selectedMapId: selectedMapId, selectedMapId: selectedMapId,
specialClinic: widget.specialClinic, specialClinic: widget.specialClinic!,
activeTab: _activeTab, activeTab: _activeTab,
onChangeFunc: (newValue) async { onChangeFunc: (newValue) async {
setState(() { setState(() {
@ -89,18 +89,13 @@ class _InPatientScreenState extends State<InPatientScreen>
model.clearPatientList(); model.clearPatientList();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
PatientSearchRequestModel requestModel = PatientSearchRequestModel requestModel = PatientSearchRequestModel(nursingStationID: selectedMapId, clinicID: 0);
PatientSearchRequestModel(
nursingStationID: selectedMapId, clinicID: 0);
await model.getInPatientList(requestModel, isLocalBusy: true); await model.getInPatientList(requestModel, isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error); DrAppToastMsg.showErrorToast(model.error);
} else { } else {
onChangeState( onChangeState(isAllClinic: true, showBottomSheet: false, selectedClinicName: null);
isAllClinic: true,
showBottomSheet: false,
selectedClinicName: null);
} }
}), }),
body: Column( body: Column(
@ -110,15 +105,12 @@ class _InPatientScreenState extends State<InPatientScreen>
child: Scaffold( child: Scaffold(
extendBodyBehindAppBar: false, extendBodyBehindAppBar: false,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: Size.fromHeight( preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
MediaQuery.of(context).size.height * 0.070),
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.5), //width: 0.7
color: Theme.of(context).dividerColor,
width: 0.5), //width: 0.7
), ),
color: Colors.white), color: Colors.white),
child: Container( child: Container(
@ -132,15 +124,10 @@ class _InPatientScreenState extends State<InPatientScreen>
indicator: BoxDecoration(), indicator: BoxDecoration(),
// indicatorSize: TabBarIndicatorSize.tab, // indicatorSize: TabBarIndicatorSize.tab,
// labelColor: Theme.of(context).primaryColor, // labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only( labelPadding: EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0),
top: 0, left: 0, right: 0, bottom: 0),
// unselectedLabelColor: Colors.grey[800], // unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
tabWidget(screenSize, _activeTab == 0, tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, context: context, counter: model.inPatientList.length, isFirst: true),
TranslationBase.of(context).inPatientAll,
context: context,
counter: model.inPatientList.length,
isFirst: true),
tabWidget( tabWidget(
screenSize, screenSize,
_activeTab == 1, _activeTab == 1,
@ -204,30 +191,16 @@ class _InPatientScreenState extends State<InPatientScreen>
}); });
} }
Widget tabWidget(Size screenSize, bool isActive, String title, Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1, bool isFirst = false, bool isMiddle = false, bool isLast = false, BuildContext? context}) {
{int counter = -1,
bool isFirst = false,
bool isMiddle = false,
bool isLast = false,
BuildContext? context}) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context!); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context!);
return Center( return Center(
child: Container( child: Container(
height: TabUtils.getTabHeight(context!), height: TabUtils.getTabHeight(context!),
decoration: TabUtils.getBoxTabsBoxDecoration( decoration: TabUtils.getBoxTabsBoxDecoration(isActive: isActive, isFirst: isFirst, isMiddle: isMiddle, isLast: isLast, projectViewModel: projectsProvider),
isActive: isActive,
isFirst: isFirst,
isMiddle: isMiddle,
isLast: isLast,
projectViewModel: projectsProvider),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [TabUtils.getTabText(title: title, isActive: isActive), if (counter != -1) TabUtils.getTabCounter(isActive: isActive, counter: counter)],
TabUtils.getTabText(title: title, isActive: isActive),
if (counter != -1)
TabUtils.getTabCounter(isActive: isActive, counter: counter)
],
), ),
), ),
); );

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import '../../../routes.dart'; import '../../../routes.dart';
import 'NoData.dart'; import 'NoData.dart';
@ -27,54 +28,45 @@ class ListOfAllInPatient extends StatelessWidget {
? NoData() ? NoData()
: NotificationListener( : NotificationListener(
child: ListView.builder( child: ListView.builder(
itemCount: itemCount: patientSearchViewModel.filteredInPatientItems.length,
patientSearchViewModel.filteredInPatientItems.length,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return PatientCard( return PatientCard(
patientInfo: patientSearchViewModel patientInfo: patientSearchViewModel.filteredInPatientItems[index],
.filteredInPatientItems[index],
patientType: "1", patientType: "1",
arrivalType: "1", arrivalType: "1",
isInpatient: true, isInpatient: true,
isMyPatient: patientSearchViewModel isMyPatient: patientSearchViewModel.filteredInPatientItems[index].doctorId == patientSearchViewModel.doctorProfile!.doctorID,
.filteredInPatientItems[index].doctorId ==
patientSearchViewModel.doctorProfile!.doctorID,
onTap: () { onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context); FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus(); currentFocus.unfocus();
} }
Navigator.of(context) SchedulerBinding.instance.addPostFrameCallback((_) {
.pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientSearchViewModel "patient": patientSearchViewModel.filteredInPatientItems[index],
.filteredInPatientItems[index],
"patientType": "1", "patientType": "1",
"from": "0", "from": "0",
"to": "0", "to": "0",
"isSearch": false, "isSearch": false,
"isInpatient": true, "isInpatient": true,
"arrivalType": "1", "arrivalType": "1",
"isMyPatient": patientSearchViewModel "isMyPatient": patientSearchViewModel.filteredInPatientItems[index].doctorId == patientSearchViewModel.doctorProfile!.doctorID,
.filteredInPatientItems[index].doctorId == });
patientSearchViewModel.doctorProfile!.doctorID,
}); });
}, },
); );
}), }),
onNotification: (notification) { onNotification: (notification) {
if (isAllClinic && !hasQuery) if (notification if (isAllClinic && !hasQuery) if (notification is ScrollUpdateNotification) {
is ScrollUpdateNotification) { if (notification.metrics.pixels >= notification.metrics.maxScrollExtent - 50) {
if (notification.metrics.pixels >=
notification.metrics.maxScrollExtent - 50) {
patientSearchViewModel.addOnFilteredList(); patientSearchViewModel.addOnFilteredList();
} }
if (notification.metrics.pixels <= if (notification.metrics.pixels <= notification.metrics.minScrollExtent - 50) {
notification.metrics.minScrollExtent - 50) {
patientSearchViewModel.removeOnFilteredList(); patientSearchViewModel.removeOnFilteredList();
} }
} }

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PatientSearchHeader extends StatelessWidget { class PatientSearchHeader extends StatelessWidget implements PreferredSizeWidget {
final String? title; final String? title;
const PatientSearchHeader({Key? key, this.title}) : super(key: key); const PatientSearchHeader({Key? key, this.title}) : super(key: key);

@ -8,7 +8,7 @@ class PatientProfileCardModel {
final bool isInPatient; final bool isInPatient;
final bool isDisable; final bool isDisable;
final bool isLoading; final bool isLoading;
final Function? onTap; final Function()? onTap;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isSelectInpatient; final bool isSelectInpatient;
final bool isDartIcon; final bool isDartIcon;

@ -25,27 +25,97 @@ class ProfileGridForInPatient extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel(
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), TranslationBase.of(context).vital,
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', TranslationBase.of(context).signs,
isInPatient: isInpatient), VITAL_SIGN_DETAILS,
PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).result, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/Radiology.svg', 'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD, //onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).special,
ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).result,
RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/Radiology.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', //onTap: () {},
isInPatient: isInpatient), ),
PatientProfileCardModel(TranslationBase.of(context).progress, TranslationBase.of(context).note, PROGRESS_NOTE, 'assets/images/svgs/profile_screen/Progress notes.svg', PatientProfileCardModel(
isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), TranslationBase.of(context).patient,
PatientProfileCardModel(TranslationBase.of(context).order, TranslationBase.of(context).sheet, ORDER_NOTE, 'assets/images/svgs/profile_screen/order sheets.svg', TranslationBase.of(context).prescription,
isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), ORDER_PRESCRIPTION_NEW,
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', //onTap: () {},
isInPatient: isInpatient), ),
PatientProfileCardModel(TranslationBase.of(context).medical, TranslationBase.of(context).report, PATIENT_MEDICAL_REPORT, 'assets/images/svgs/profile_screen/medical report.svg', PatientProfileCardModel(
isInPatient: isInpatient, isDisable: false), TranslationBase.of(context).progress,
TranslationBase.of(context).note,
PROGRESS_NOTE,
'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).order,
TranslationBase.of(context).sheet,
ORDER_NOTE,
'assets/images/svgs/profile_screen/order sheets.svg',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,
HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).medical,
TranslationBase.of(context).report,
PATIENT_MEDICAL_REPORT,
'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient,
isDisable: false,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral, TranslationBase.of(context).referral,
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
@ -53,15 +123,23 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/refer patient.svg', 'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isDischargedPatient || isFromSearch, isDisable: isDischargedPatient || isFromSearch,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
TranslationBase.of(context).approvals,
PATIENT_INSURANCE_APPROVALS_NEW,
'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).approvals, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).discharge, TranslationBase.of(context).discharge,
TranslationBase.of(context).report, TranslationBase.of(context).report,
DISCHARGE_SUMMARY, DISCHARGE_SUMMARY,
'assets/images/svgs/profile_screen/discharge summary.svg', 'assets/images/svgs/profile_screen/discharge summary.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patientSick, TranslationBase.of(context).patientSick,
@ -69,6 +147,7 @@ class ProfileGridForInPatient extends StatelessWidget {
ADD_SICKLEAVE, ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg', 'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).operation, TranslationBase.of(context).operation,
@ -76,6 +155,7 @@ class ProfileGridForInPatient extends StatelessWidget {
GET_OPERATION_REPORT, GET_OPERATION_REPORT,
'assets/images/svgs/profile_screen/operating report.svg', 'assets/images/svgs/profile_screen/operating report.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).pending, TranslationBase.of(context).pending,
@ -83,6 +163,7 @@ class ProfileGridForInPatient extends StatelessWidget {
PENDING_ORDERS, PENDING_ORDERS,
'assets/images/svgs/profile_screen/pending orders.svg', 'assets/images/svgs/profile_screen/pending orders.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).admission, TranslationBase.of(context).admission,
@ -90,6 +171,7 @@ class ProfileGridForInPatient extends StatelessWidget {
ADMISSION_ORDERS, ADMISSION_ORDERS,
'assets/images/svgs/profile_screen/admission req.svg', 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
"Nursing", "Nursing",
@ -97,6 +179,7 @@ class ProfileGridForInPatient extends StatelessWidget {
NURSING_PROGRESS_NOTE, NURSING_PROGRESS_NOTE,
'assets/images/svgs/profile_screen/Progress notes.svg', 'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).diagnosis, TranslationBase.of(context).diagnosis,
@ -104,6 +187,7 @@ class ProfileGridForInPatient extends StatelessWidget {
DIAGNOSIS_FOR_IN_PATIENT, DIAGNOSIS_FOR_IN_PATIENT,
'assets/images/svgs/profile_screen/diagnosis.svg', 'assets/images/svgs/profile_screen/diagnosis.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).diabetic, TranslationBase.of(context).diabetic,
@ -111,6 +195,7 @@ class ProfileGridForInPatient extends StatelessWidget {
DIABETIC_CHART_VALUES, DIABETIC_CHART_VALUES,
'assets/images/svgs/profile_screen/diabetic chart.svg', 'assets/images/svgs/profile_screen/diabetic chart.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
"VTE", "VTE",
@ -118,6 +203,7 @@ class ProfileGridForInPatient extends StatelessWidget {
VTE_ASSESSMENT, VTE_ASSESSMENT,
'assets/images/svgs/profile_screen/diabetic chart.svg', 'assets/images/svgs/profile_screen/diabetic chart.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).pharmacy, TranslationBase.of(context).pharmacy,
@ -125,6 +211,7 @@ class ProfileGridForInPatient extends StatelessWidget {
PHARMACY_INTERVENTION, PHARMACY_INTERVENTION,
'assets/images/svgs/profile_screen/medical report.svg', 'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
]; ];
@ -155,7 +242,9 @@ class ProfileGridForInPatient extends StatelessWidget {
isInPatient: item.isInPatient, isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient, isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable, isDisable: item.isDisable,
onTap: item.onTap!, onTap: () {
//item.onTap();
},
isLoading: item.isLoading, isLoading: item.isLoading,
); );
}).toList(), }).toList(),

@ -21,29 +21,104 @@ class ProfileGridForOther extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), PatientProfileCardModel(
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), TranslationBase.of(context).vital,
PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', TranslationBase.of(context).signs,
isInPatient: isInpatient), VITAL_SIGN_DETAILS,
PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg', 'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD, //onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).result,
LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
TranslationBase.of(context).special,
ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
TranslationBase.of(context).service,
RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', //onTap: () {},
isInPatient: isInpatient), ),
PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', PatientProfileCardModel(
isInPatient: isInpatient), TranslationBase.of(context).health,
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient), TranslationBase.of(context).summary,
PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', HEALTH_SUMMARY,
isInPatient: isInpatient), 'assets/images/svgs/profile_screen/health summary.svg',
PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg', isInPatient: isInpatient,
isInPatient: isInpatient), //onTap: () {},
PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg', ),
isInPatient: isInpatient), PatientProfileCardModel(
TranslationBase.of(context).patient,
"ECG",
PATIENT_ECG,
'assets/images/svgs/profile_screen/ECG.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).orders,
TranslationBase.of(context).procedures,
ORDER_PROCEDURE,
'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
TranslationBase.of(context).service,
PATIENT_INSURANCE_APPROVALS_NEW,
'assets/images/svgs/profile_screen/insurance approval.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave,
ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient,
//onTap: () {},
),
if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0)) if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', PatientProfileCardModel(
isInPatient: isInpatient, isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null), TranslationBase.of(context).patient,
TranslationBase.of(context).ucaf,
PATIENT_UCAF_REQUEST,
'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null,
//onTap: () {},
),
if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0)) if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0))
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral, TranslationBase.of(context).referral,
@ -52,10 +127,18 @@ class ProfileGridForOther extends StatelessWidget {
'assets/images/svgs/profile_screen/refer patient.svg', 'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null, isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null,
//onTap: () {},
), ),
if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0)) if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', PatientProfileCardModel(
isInPatient: isInpatient, isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null), TranslationBase.of(context).admission,
TranslationBase.of(context).request,
PATIENT_ADMISSION_REQUEST,
'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null,
//onTap: () {},
),
]; ];
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
@ -84,7 +167,8 @@ class ProfileGridForOther extends StatelessWidget {
isInPatient: item.isInPatient, isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient, isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable, isDisable: item.isDisable,
onTap: item.onTap!, onTap: () {},
//item.onTap!(),
isLoading: item.isLoading, isLoading: item.isLoading,
); );
}).toList(), }).toList(),

@ -15,16 +15,7 @@ class ProfileGridForSearch extends StatelessWidget {
String? from; String? from;
String? to; String? to;
ProfileGridForSearch( ProfileGridForSearch({Key? key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient = false, this.from, this.to}) : super(key: key);
{Key? key,
this.patient,
this.patientType,
this.arrivalType,
this.height,
this.isInpatient = false,
this.from,
this.to})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,64 +25,89 @@ class ProfileGridForSearch extends StatelessWidget {
TranslationBase.of(context).signs, TranslationBase.of(context).signs,
VITAL_SIGN_DETAILS, VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg', 'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab, TranslationBase.of(context).lab,
TranslationBase.of(context).result, TranslationBase.of(context).result,
LAB_RESULT, LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg', 'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab, TranslationBase.of(context).lab,
TranslationBase.of(context).special, TranslationBase.of(context).special,
ALL_SPECIAL_LAB_RESULT, ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg', 'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).radiology, TranslationBase.of(context).radiology,
TranslationBase.of(context).service, TranslationBase.of(context).service,
RADIOLOGY_PATIENT, RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/health summary.svg', 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).orders, TranslationBase.of(context).orders,
TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
ORDER_PRESCRIPTION_OLD, ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
TranslationBase.of(context).prescription, TranslationBase.of(context).prescription,
ORDER_PRESCRIPTION_NEW, ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).health, TranslationBase.of(context).health,
TranslationBase.of(context).summary, TranslationBase.of(context).summary,
HEALTH_SUMMARY, HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg', 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", //onTap: () {},
PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', ),
isInPatient: isInpatient), PatientProfileCardModel(
TranslationBase.of(context).patient,
"ECG",
PATIENT_ECG,
'assets/images/svgs/profile_screen/ECG.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).orders, TranslationBase.of(context).orders,
TranslationBase.of(context).procedures, TranslationBase.of(context).procedures,
ORDER_PROCEDURE, ORDER_PROCEDURE,
'assets/images/svgs/profile_screen/Order Procedures.svg', 'assets/images/svgs/profile_screen/Order Procedures.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).insurance, TranslationBase.of(context).insurance,
TranslationBase.of(context).service, TranslationBase.of(context).service,
PATIENT_INSURANCE_APPROVALS_NEW, PATIENT_INSURANCE_APPROVALS_NEW,
'assets/images/svgs/profile_screen/vital signs.svg', 'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patientSick, TranslationBase.of(context).patientSick,
TranslationBase.of(context).leave, TranslationBase.of(context).leave,
ADD_SICKLEAVE, ADD_SICKLEAVE,
'assets/images/svgs/profile_screen/patient sick leave.svg', 'assets/images/svgs/profile_screen/patient sick leave.svg',
isInPatient: isInpatient), isInPatient: isInpatient,
//onTap: () {},
),
if (patient!.appointmentNo != null && patient!.appointmentNo != 0) if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
@ -99,7 +115,9 @@ class ProfileGridForSearch extends StatelessWidget {
PATIENT_UCAF_REQUEST, PATIENT_UCAF_REQUEST,
'assets/images/svgs/profile_screen/UCAF.svg', 'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: patient!.patientStatusType != 43 ? true : false), isDisable: patient!.patientStatusType != 43 ? true : false,
//onTap: () {},
),
if (patient!.appointmentNo != null && patient!.appointmentNo != 0) if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral, TranslationBase.of(context).referral,
@ -107,7 +125,9 @@ class ProfileGridForSearch extends StatelessWidget {
REFER_PATIENT_TO_DOCTOR, REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg', 'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: patient!.patientStatusType != 43 ? true : false), isDisable: patient!.patientStatusType != 43 ? true : false,
//onTap: () {},
),
if (patient!.appointmentNo != null && patient!.appointmentNo != 0) if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).admission, TranslationBase.of(context).admission,
@ -115,7 +135,9 @@ class ProfileGridForSearch extends StatelessWidget {
PATIENT_ADMISSION_REQUEST, PATIENT_ADMISSION_REQUEST,
'assets/images/svgs/profile_screen/admission req.svg', 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: patient!.patientStatusType != 43 ? true : false), isDisable: patient!.patientStatusType != 43 ? true : false,
//onTap: () {},
),
]; ];
return Padding( return Padding(
@ -145,7 +167,8 @@ class ProfileGridForSearch extends StatelessWidget {
isInPatient: item.isInPatient, isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient, isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable, isDisable: item.isDisable,
onTap: item.onTap!, onTap: () {},
//item.onTap(),
isLoading: item.isLoading, isLoading: item.isLoading,
); );
}).toList(), }).toList(),

@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BottomSheetTitle extends StatelessWidget { class BottomSheetTitle extends StatelessWidget implements PreferredSizeWidget {
BottomSheetTitle({ BottomSheetTitle({
Key? key, Key? key,
this.title = '', this.title = '',
@ -33,14 +33,7 @@ class BottomSheetTitle extends StatelessWidget {
text: TextSpan( text: TextSpan(
style: TextStyle(fontSize: 20, color: Colors.black), style: TextStyle(fontSize: 20, color: Colors.black),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(text: title, style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.w700, fontFamily: 'Poppins', letterSpacing: -1.44, fontSize: 24.0)),
text: title,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
letterSpacing: -1.44,
fontSize: 24.0)),
], ],
), ),
), ),
@ -48,9 +41,7 @@ class BottomSheetTitle extends StatelessWidget {
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
}, },
child: Icon(DoctorApp.close_1, child: Icon(DoctorApp.close_1, size: SizeConfig.getTextMultiplierBasedOnWidth() * 5, color: Color(0xFF2B353E)))
size: SizeConfig.getTextMultiplierBasedOnWidth() * 5,
color: Color(0xFF2B353E)))
], ],
), ),
], ],

@ -49,13 +49,8 @@ class SMSOTP {
displayDialog(BuildContext context) async { displayDialog(BuildContext context) async {
double dialogWidth = MediaQuery.of(context).size.width * 0.90; double dialogWidth = MediaQuery.of(context).size.width * 0.90;
double dialogInputWidth = (dialogWidth / 4) - double dialogInputWidth = (dialogWidth / 4) - (SizeConfig.isWidthLarge ? SizeConfig.getWidthMultiplier(width: dialogWidth) * 4.5 : 20);
(SizeConfig.isWidthLarge double dialogHeight = SizeConfig.isHeightVeryShort ? MediaQuery.of(context).size.height * 0.50 : MediaQuery.of(context).size.height * 0.40;
? SizeConfig.getWidthMultiplier(width: dialogWidth) * 4.5
: 20);
double dialogHeight = SizeConfig.isHeightVeryShort
? MediaQuery.of(context).size.height * 0.50
: MediaQuery.of(context).size.height * 0.40;
return showDialog( return showDialog(
context: context, context: context,
builder: (ctx) => Center( builder: (ctx) => Center(
@ -81,21 +76,12 @@ class SMSOTP {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: SizeConfig.getHeightMultiplier( height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 2,
height: dialogHeight) *
2,
), ),
Row( Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Icon( Icon(
type == AuthMethodTypes.SMS type == AuthMethodTypes.SMS ? DoctorApp.verify_sms_1 : DoctorApp.verify_whtsapp,
? DoctorApp.verify_sms_1 size: SizeConfig.getHeightMultiplier(height: dialogHeight) * 9,
: DoctorApp.verify_whtsapp,
size: SizeConfig.getHeightMultiplier(
height: dialogHeight) *
9,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
), ),
Row( Row(
@ -104,10 +90,7 @@ class SMSOTP {
IconButton( IconButton(
icon: Icon(Icons.close), icon: Icon(Icons.close),
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
iconSize: iconSize: SizeConfig.getHeightMultiplier(height: dialogHeight) * 15,
SizeConfig.getHeightMultiplier(
height: dialogHeight) *
15,
onPressed: () { onPressed: () {
this.isClosed = true; this.isClosed = true;
Navigator.pop(context); Navigator.pop(context);
@ -118,220 +101,155 @@ class SMSOTP {
) )
]), ]),
SizedBox( SizedBox(
height: SizeConfig.getHeightMultiplier( height: SizeConfig.getHeightMultiplier(height: dialogHeight) * (SizeConfig.isHeightVeryShort ? 10 : 5),
height: dialogHeight) *
(SizeConfig.isHeightVeryShort ? 10 : 5),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 5, right: 5), padding: EdgeInsets.only(top: 5, right: 5),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).verificationMessage + ' XXXXXX' + mobileNo.toString().substring(mobileNo.toString().length - 3),
.verificationMessage +
' XXXXXX' +
mobileNo.toString().substring(
mobileNo.toString().length - 3),
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5,
.getTextMultiplierBasedOnWidth(
width: dialogWidth) *
3.5,
//14, //14,
maxLines: 2, maxLines: 2,
)), )),
Form( Form(
key: verifyAccountForm, key: verifyAccountForm,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier(height: dialogHeight) * 2),
top: SizeConfig.getHeightMultiplier(
height: dialogHeight) *
2),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
width: dialogInputWidth, width: dialogInputWidth,
height: height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 30,
SizeConfig.getHeightMultiplier( margin: EdgeInsets.symmetric(vertical: 2, horizontal: 5),
height: dialogHeight) *
30,
margin: EdgeInsets.symmetric(
vertical: 2, horizontal: 5),
child: TextFormField( child: TextFormField(
textInputAction: textInputAction: TextInputAction.next,
TextInputAction.next,
style: buildTextStyle(), style: buildTextStyle(),
autofocus: true, autofocus: true,
maxLength: 1, maxLength: 1,
controller: digit1, controller: digit1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
keyboardType: keyboardType: TextInputType.number,
TextInputType.number, decoration: buildInputDecoration(context),
decoration:
buildInputDecoration(context),
onSaved: (val) {}, onSaved: (val) {},
validator: validateCodeDigit, // validator: validateCodeDigit,
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
FocusScope.of(context) FocusScope.of(context).requestFocus(focusD2);
.requestFocus(focusD2);
}, },
onChanged: (val) { onChanged: (val) {
if (val.length == 1) { if (val.length == 1) {
FocusScope.of(context) FocusScope.of(context).requestFocus(focusD2);
.requestFocus(focusD2); verifyAccountFormValue['digit1'] = val.trim();
verifyAccountFormValue[
'digit1'] = val.trim();
checkValue(); checkValue();
} }
}, },
), validator: validateCodeDigit),
), ),
Container( Container(
width: dialogInputWidth, width: dialogInputWidth,
height: height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 30,
SizeConfig.getHeightMultiplier( margin: EdgeInsets.symmetric(vertical: 2, horizontal: 5),
height: dialogHeight) *
30,
margin: EdgeInsets.symmetric(
vertical: 2, horizontal: 5),
child: TextFormField( child: TextFormField(
focusNode: focusD2, focusNode: focusD2,
textInputAction: textInputAction: TextInputAction.next,
TextInputAction.next,
maxLength: 1, maxLength: 1,
controller: digit2, controller: digit2,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: buildTextStyle(), style: buildTextStyle(),
keyboardType: keyboardType: TextInputType.number,
TextInputType.number, decoration: buildInputDecoration(context),
decoration:
buildInputDecoration(
context),
onSaved: (val) {}, onSaved: (val) {},
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
FocusScope.of(context) FocusScope.of(context).requestFocus(focusD3);
.requestFocus(focusD3);
}, },
onChanged: (val) { onChanged: (val) {
if (val.length == 1) { if (val.length == 1) {
FocusScope.of(context) FocusScope.of(context).requestFocus(focusD3);
.requestFocus(focusD3); verifyAccountFormValue['digit2'] = val.trim();
verifyAccountFormValue[
'digit2'] = val.trim();
checkValue(); checkValue();
} }
}, },
validator: validateCodeDigit), validator: validateCodeDigit
// validator: validateCodeDigit
),
), ),
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(vertical: 2, horizontal: 5),
vertical: 2, horizontal: 5),
width: dialogInputWidth, width: dialogInputWidth,
height: SizeConfig height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 30,
.getHeightMultiplier(
height:
dialogHeight) *
30,
child: TextFormField( child: TextFormField(
focusNode: focusD3, focusNode: focusD3,
textInputAction: textInputAction: TextInputAction.next,
TextInputAction.next,
maxLength: 1, maxLength: 1,
controller: digit3, controller: digit3,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: buildTextStyle(), style: buildTextStyle(),
keyboardType: keyboardType: TextInputType.number,
TextInputType.number, decoration: buildInputDecoration(context),
decoration:
buildInputDecoration(
context),
onSaved: (val) {}, onSaved: (val) {},
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
FocusScope.of(context) FocusScope.of(context).requestFocus(focusD4);
.requestFocus(focusD4);
}, },
onChanged: (val) { onChanged: (val) {
if (val.length == 1) { if (val.length == 1) {
FocusScope.of(context) FocusScope.of(context).requestFocus(focusD4);
.requestFocus( verifyAccountFormValue['digit3'] = val.trim();
focusD4);
verifyAccountFormValue[
'digit3'] =
val.trim();
checkValue(); checkValue();
} }
}, },
validator: validator: validateCodeDigit
validateCodeDigit)),
// validator: validateCodeDigit
)),
Container( Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(vertical: 2, horizontal: 5),
vertical: 2, horizontal: 5),
width: dialogInputWidth, width: dialogInputWidth,
height: SizeConfig height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 30,
.getHeightMultiplier(
height:
dialogHeight) *
30,
child: TextFormField( child: TextFormField(
focusNode: focusD4, focusNode: focusD4,
maxLength: 1, maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: buildTextStyle(), style: buildTextStyle(),
controller: digit4, controller: digit4,
keyboardType: keyboardType: TextInputType.number,
TextInputType.number, decoration: buildInputDecoration(context),
decoration:
buildInputDecoration(
context),
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
FocusScope.of(context) FocusScope.of(context).requestFocus(focusD4);
.requestFocus(focusD4);
}, },
onChanged: (val) { onChanged: (val) {
if (val.length == 1) { if (val.length == 1) {
verifyAccountFormValue[ verifyAccountFormValue['digit4'] = val.trim();
'digit4'] =
val.trim();
checkValue(); checkValue();
} }
}, },
validator: validator: validateCodeDigit),
validateCodeDigit)), ),
], ],
)), )),
), ),
), ),
Column( Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).validationMessage + ' ',
.validationMessage +
' ',
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.48, letterSpacing: -0.48,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5,
.getTextMultiplierBasedOnWidth(
width: dialogWidth) *
3.5,
), ),
AppText( AppText(
displayTime, displayTime,
color: Colors.red, color: Colors.red,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5,
.getTextMultiplierBasedOnWidth(
width: dialogWidth) *
3.5,
) )
]) ])
], ],
@ -370,43 +288,38 @@ class SMSOTP {
), ),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor), borderSide: BorderSide(color: Theme.of(context).colorScheme.error),
), ),
); );
} }
// ignore: missing_return // ignore: missing_return
String validateCodeDigit(value) { String? validateCodeDigit(value) {
if (value.isEmpty) { if (value.isEmpty) {
return ''; return '';
} else if (value.length == 3) { } else if (value.length == 3) {
print(value); print(value);
} }
return ""; return null;
} }
checkValue() async { checkValue() async {
if (verifyAccountForm.currentState!.validate()) { if (verifyAccountForm.currentState!.validate()) {
onSuccess(digit1.text.toString() + // if (digit1.text.isNotEmpty && digit2.text.isNotEmpty && digit3.text.isNotEmpty && digit4.text.isNotEmpty) {
digit2.text.toString() + onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + digit4.text.toString());
digit3.text.toString() +
digit4.text.toString());
this.isClosed = true; this.isClosed = true;
} }
} }
getSecondsAsDigitalClock(int inputSeconds) { getSecondsAsDigitalClock(int inputSeconds) {
var sec_num = var sec_num = int.parse(inputSeconds.toString()); // don't forget the second param
int.parse(inputSeconds.toString()); // don't forget the second param
var hours = (sec_num / 3600).floor(); var hours = (sec_num / 3600).floor();
var minutes = ((sec_num - hours * 3600) / 60).floor(); var minutes = ((sec_num - hours * 3600) / 60).floor();
var seconds = sec_num - hours * 3600 - minutes * 60; var seconds = sec_num - hours * 3600 - minutes * 60;
var minutesString = ""; var minutesString = "";
var secondsString = ""; var secondsString = "";
minutesString = minutesString = minutes < 10 ? "0" + minutes.toString() : minutes.toString();
minutes < 10 ? "0" + minutes.toString() : minutes.toString(); secondsString = seconds < 10 ? "0" + seconds.toString() : seconds.toString();
secondsString =
seconds < 10 ? "0" + seconds.toString() : seconds.toString();
return minutesString + ":" + secondsString; return minutesString + ":" + secondsString;
} }

@ -1,8 +1,8 @@
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class GaugeChart extends StatelessWidget { class GaugeChart extends StatelessWidget {
final List<charts.Series> seriesList; final List<Series<dynamic, String>> seriesList;
final bool animate; final bool animate;
GaugeChart(this.seriesList, {this.animate = false}); GaugeChart(this.seriesList, {this.animate = false});
@ -18,24 +18,23 @@ class GaugeChart extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new charts.PieChart(seriesList, return PieChart<String>(
animate: animate, seriesList, animate: animate, defaultRenderer: ArcRendererConfig(arcRendererDecorators: [ArcLabelDecorator(labelPosition: ArcLabelPosition.auto)]),
defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); //ArcRendererConfig(arcWidth: 10),
);
//); //);
} }
static List<charts.Series<GaugeSegment, String>> _createSampleData() { static List<Series<GaugeSegment, String>> _createSampleData() {
final data = [ final data = [
new GaugeSegment('Low', 75, charts.MaterialPalette.blue.shadeDefault), GaugeSegment('Low', 75, MaterialPalette.blue.shadeDefault),
new GaugeSegment( GaugeSegment('Acceptable', 100, MaterialPalette.blue.shadeDefault),
'Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), GaugeSegment('High', 50, MaterialPalette.blue.shadeDefault),
new GaugeSegment('High', 50, charts.MaterialPalette.blue.shadeDefault), GaugeSegment('Highly Unusual', 55, MaterialPalette.blue.shadeDefault),
new GaugeSegment(
'Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault),
]; ];
return [ return [
new charts.Series<GaugeSegment, String>( Series<GaugeSegment, String>(
id: 'Segments', id: 'Segments',
domainFn: (GaugeSegment segment, _) => segment.segment, domainFn: (GaugeSegment segment, _) => segment.segment,
measureFn: (GaugeSegment segment, _) => segment.size, measureFn: (GaugeSegment segment, _) => segment.size,

@ -1,24 +1,24 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/extenstions_utils.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'ShowTimer.dart'; import 'ShowTimer.dart';
class PatientCard extends StatelessWidget { class PatientCard extends StatelessWidget {
final PatiantInformtion? patientInfo; final PatiantInformtion? patientInfo;
final Function? onTap; final Function()? onTap;
final String patientType; final String patientType;
final String arrivalType; final String arrivalType;
final bool isInpatient; final bool isInpatient;
@ -29,7 +29,7 @@ class PatientCard extends StatelessWidget {
PatientCard( PatientCard(
{Key? key, {Key? key,
this.patientInfo, this.patientInfo,
this.onTap, required this.onTap,
this.patientType = '', this.patientType = '',
this.arrivalType = '', this.arrivalType = '',
this.isInpatient = false, this.isInpatient = false,
@ -52,11 +52,7 @@ class PatientCard extends StatelessWidget {
return Container( return Container(
width: SizeConfig.screenWidth! * 0.9, width: SizeConfig.screenWidth! * 0.9,
margin: EdgeInsets.all(6), margin: EdgeInsets.all(6),
padding: EdgeInsets.only( padding: EdgeInsets.only(left: projectViewModel.isArabic ? 5 : 0, right: projectViewModel.isArabic ? 0 : 5, bottom: 0, top: 0),
left: projectViewModel.isArabic ? 5 : 0,
right: projectViewModel.isArabic ? 0 : 5,
bottom: 0,
top: 0),
decoration: Utils.getCardBoxDecoration(), decoration: Utils.getCardBoxDecoration(),
child: CardWithBgWidget( child: CardWithBgWidget(
padding: 0, padding: 0,
@ -99,8 +95,7 @@ class PatientCard extends StatelessWidget {
? Row( ? Row(
children: [ children: [
PatientStatus( PatientStatus(
label: TranslationBase.of(context) label: TranslationBase.of(context).arrivedP,
.arrivedP,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
), ),
SizedBox( SizedBox(
@ -117,12 +112,8 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
PatientStatus( PatientStatus(
label: patientInfo!.status == 2 label: patientInfo!.status == 2 ? 'Confirmed' : 'Booked',
? 'Confirmed' color: patientInfo!.status == 2 ? AppGlobal.appGreenColor : Colors.grey,
: 'Booked',
color: patientInfo!.status == 2
? AppGlobal.appGreenColor
: Colors.grey,
), ),
], ],
) )
@ -130,9 +121,7 @@ class PatientCard extends StatelessWidget {
? Row( ? Row(
children: [ children: [
PatientStatus( PatientStatus(
label: label: TranslationBase.of(context).notArrived,
TranslationBase.of(context)
.notArrived,
color: Colors.red[800]!, color: Colors.red[800]!,
), ),
SizedBox( SizedBox(
@ -149,26 +138,16 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
PatientStatus( PatientStatus(
label: patientInfo!.status == 2 label: patientInfo!.status == 2 ? 'Confirmed' : 'Booked',
? 'Confirmed' color: patientInfo!.status == 2 ? AppGlobal.appGreenColor : Colors.grey,
: 'Booked',
color: patientInfo!.status == 2
? AppGlobal.appGreenColor
: Colors.grey,
) )
], ],
) )
: !isFromSearch && : !isFromSearch && !isFromLiveCare && patientInfo!.patientStatusType == null
!isFromLiveCare &&
patientInfo!
.patientStatusType ==
null
? Row( ? Row(
children: [ children: [
PatientStatus( PatientStatus(
label: TranslationBase.of( label: TranslationBase.of(context).notArrived,
context)
.notArrived,
color: Colors.red[800], color: Colors.red[800],
), ),
SizedBox( SizedBox(
@ -185,24 +164,15 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
PatientStatus( PatientStatus(
label: label: patientInfo!.status == 2 ? 'Booked' : 'Confirmed',
patientInfo!.status == 2 color: patientInfo!.status == 2 ? Colors.grey : AppGlobal.appGreenColor,
? 'Booked'
: 'Confirmed',
color:
patientInfo!.status == 2
? Colors.grey
: AppGlobal
.appGreenColor,
) )
], ],
) )
: SizedBox(), : SizedBox(),
this.arrivalType == '1' this.arrivalType == '1'
? AppText( ? AppText(
patientInfo!.startTime != null patientInfo!.startTime != null ? patientInfo!.startTime! : patientInfo!.startTimes!,
? patientInfo!.startTime!
: patientInfo!.startTimes!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
) )
@ -217,13 +187,9 @@ class PatientCard extends StatelessWidget {
letterSpacing: -0.64, letterSpacing: -0.64,
), ),
) )
: (patientInfo!.appointmentDate != : (patientInfo!.appointmentDate != null && patientInfo!.appointmentDate!.isNotEmpty)
null &&
patientInfo!.appointmentDate!
.isNotEmpty)
? Container( ? Container(
padding: padding: EdgeInsets.only(right: 9),
EdgeInsets.only(right: 9),
child: AppText( child: AppText(
" ${AppDateUtils.getStartTime(patientInfo!.startTime!)}", " ${AppDateUtils.getStartTime(patientInfo!.startTime!)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -255,19 +221,9 @@ class PatientCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
flex: 2, flex: 2,
child: Row( child: Row(crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
AppText( AppText(
isFromLiveCare isFromLiveCare ? Utils.capitalize(patientInfo!.fullName) : (Utils.capitalize(patientInfo!.firstName) + " " + Utils.capitalize(patientInfo!.lastName)),
? Utils.capitalize(
patientInfo!.fullName)
: (Utils.capitalize(
patientInfo!.firstName) +
" " +
Utils.capitalize(
patientInfo!.lastName)),
fontSize: 16, fontSize: 16,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -277,17 +233,13 @@ class PatientCard extends StatelessWidget {
), ),
if (patientInfo!.gender == 1) if (patientInfo!.gender == 1)
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2),
horizontal: 4, vertical: 2), child: SvgPicture.asset("assets/images/svgs/male.svg"),
child: SvgPicture.asset(
"assets/images/svgs/male.svg"),
) )
else else
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(horizontal: 4, vertical: 2),
horizontal: 4, vertical: 2), child: SvgPicture.asset("assets/images/svgs/female.svg"),
child: SvgPicture.asset(
"assets/images/svgs/female.svg"),
), ),
if (isFromLiveCare) if (isFromLiveCare)
ShowTimer( ShowTimer(
@ -314,26 +266,16 @@ class PatientCard extends StatelessWidget {
), ),
), ),
), ),
patientInfo!.nationality != null || patientInfo!.nationality != null || patientInfo!.nationalityId != null
patientInfo!.nationalityId != null
? Container( ? Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(right: 7, top: 5),
right: 7, top: 5),
child: ClipRRect( child: ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0),
child: CachedNetworkImage( child: CachedNetworkImage(
imageUrl: patientInfo! imageUrl: patientInfo!.nationalityFlagURL != null ? patientInfo!.nationalityFlagURL! : '',
.nationalityFlagURL !=
null
? patientInfo!
.nationalityFlagURL!
: '',
height: 16, height: 16,
width: 22, width: 22,
errorWidget: errorWidget: (context, url, error) => AppText(
(context, url, error) =>
AppText(
'No Image', 'No Image',
fontSize: 10, fontSize: 10,
), ),
@ -348,9 +290,7 @@ class PatientCard extends StatelessWidget {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Row( Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(left: 12.0, top: 5), padding: EdgeInsets.only(left: 12.0, top: 5),
child: Container( child: Container(
@ -358,9 +298,7 @@ class PatientCard extends StatelessWidget {
height: 60, height: 60,
//TODO Elham* create widget for this to make it use every where //TODO Elham* create widget for this to make it use every where
child: SvgPicture.asset( child: SvgPicture.asset(
patientInfo!.gender == 1 patientInfo!.gender == 1 ? 'assets/images/svgs/male avatar.svg' : 'assets/images/svgs/female avatar.svg',
? 'assets/images/svgs/male avatar.svg'
: 'assets/images/svgs/female avatar.svg',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -372,31 +310,21 @@ class PatientCard extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// SizedBox(height: 10,), // SizedBox(height: 10,),
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context).fileNumber,
.fileNumber, value: patientInfo!.patientId.toString(),
value:
patientInfo!.patientId.toString(),
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).age + label: TranslationBase.of(context).age + " : ",
" : ", value: "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}",
value:
"${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}",
), ),
patientInfo!.arrivedOn != null patientInfo!.arrivedOn != null
? Column( ? Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.end,
CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
// AppText( // AppText(
// AppDateUtils // AppDateUtils
@ -414,14 +342,9 @@ class PatientCard extends StatelessWidget {
// ), // ),
CustomRow( CustomRow(
label: TranslationBase.of( label: TranslationBase.of(context).arrivedP + " : ",
context) value: AppDateUtils.getDayMonthYearDateFormatted(
.arrivedP + AppDateUtils.convertStringToDate(
" : ",
value: AppDateUtils
.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
patientInfo!.arrivedOn!, patientInfo!.arrivedOn!,
), ),
isMonthShort: true, isMonthShort: true,
@ -429,24 +352,15 @@ class PatientCard extends StatelessWidget {
), ),
], ],
) )
: (patientInfo!.appointmentDate != : (patientInfo!.appointmentDate != null && patientInfo!.appointmentDate!.isNotEmpty)
null &&
patientInfo!.appointmentDate!
.isNotEmpty)
? Column( ? Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.end,
CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
CustomRow( CustomRow(
label: TranslationBase.of( label: TranslationBase.of(context).appointmentDate + " : ",
context)
.appointmentDate +
" : ",
value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(
patientInfo! patientInfo!.appointmentDate!,
.appointmentDate!,
), isMonthShort: true)}", ), isMonthShort: true)}",
), ),
], ],
@ -455,47 +369,31 @@ class PatientCard extends StatelessWidget {
if (isInpatient) if (isInpatient)
CustomRow( CustomRow(
label: label: patientInfo!.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ",
patientInfo!.admissionDate == null value: patientInfo!.admissionDate == null
? ""
: TranslationBase.of(context)
.admissionDate +
" : ",
value: patientInfo!.admissionDate ==
null
? "" ? ""
: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate.toString()), isMonthShort: true)}", : "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate.toString()), isMonthShort: true)}",
), ),
if (patientInfo!.admissionDate != null) if (patientInfo!.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context).numOfDays + " : ",
.numOfDays + value: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}",
" : ",
value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}",
), ),
if (patientInfo!.admissionDate != null) if (patientInfo!.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context).clinicName + " : ",
.clinicName + value: "${patientInfo!.clinicDescription}",
" : ",
value:
"${patientInfo!.clinicDescription}",
), ),
if (patientInfo!.admissionDate != null) if (patientInfo!.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context).roomNo + " : ",
.roomNo +
" : ",
value: "${patientInfo!.roomId}", value: "${patientInfo!.roomId}",
), ),
if (isFromLiveCare) if (isFromLiveCare)
Column( Column(
children: [ children: [
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context).clinic + " : ",
.clinic +
" : ",
value: patientInfo!.clinicName!, value: patientInfo!.clinicName!,
), ),
], ],
@ -517,8 +415,7 @@ class PatientCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 9, right: 9, bottom: 9),
left: 9, right: 9, bottom: 9),
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/svgs/profile_screen/livecare.svg', 'assets/images/svgs/profile_screen/livecare.svg',
height: 20, height: 20,
@ -528,21 +425,13 @@ class PatientCard extends StatelessWidget {
], ],
) )
: !isInpatient && !isFromSearch : !isInpatient && !isFromSearch
? Row( ? Row(mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: [
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 9, right: 9, bottom: 9),
left: 9, right: 9, bottom: 9),
child: SvgPicture.asset( child: SvgPicture.asset(
patientInfo!.appointmentType == patientInfo!.appointmentType == 'Regular' && patientInfo!.visitTypeId == 100
'Regular' &&
patientInfo!.visitTypeId ==
100
? 'assets/images/svgs/profile_screen/livecare.svg' ? 'assets/images/svgs/profile_screen/livecare.svg'
: patientInfo!.appointmentType == : patientInfo!.appointmentType == 'Walkin'
'Walkin'
? 'assets/images/svgs/profile_screen/walkin.svg' ? 'assets/images/svgs/profile_screen/walkin.svg'
: 'assets/images/svgs/profile_screen/booked.svg', : 'assets/images/svgs/profile_screen/booked.svg',
height: 25, height: 25,
@ -550,14 +439,9 @@ class PatientCard extends StatelessWidget {
)), )),
]) ])
: (isInpatient == true) : (isInpatient == true)
? Row( ? Row(mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: [
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 9, right: 9, bottom: 9),
left: 9, right: 9, bottom: 9),
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/svgs/inpatient.svg', 'assets/images/svgs/inpatient.svg',
height: 25, height: 25,

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
@ -24,7 +24,7 @@ class PatientProfileButton extends StatelessWidget {
final String url = "assets/images/"; final String url = "assets/images/";
final bool isDisable; final bool isDisable;
final bool isLoading; final bool isLoading;
final Function? onTap; final Function()? onTap;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isSelectInpatient; final bool isSelectInpatient;
final bool isDartIcon; final bool isDartIcon;
@ -42,7 +42,7 @@ class PatientProfileButton extends StatelessWidget {
this.icon, this.icon,
this.route, this.route,
this.isDisable = false, this.isDisable = false,
this.onTap, required this.onTap,
this.isLoading = false, this.isLoading = false,
this.from, this.from,
this.to, this.to,
@ -65,14 +65,12 @@ class PatientProfileButton extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: isDisable onTap: isDisable
? null ? null
: onTap!() != null : onTap != null
? onTap!() ? onTap!()
: () { : () {
navigator(context, this.route); navigator(context, this.route);
}, },
child: Column( child: Column(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container( Container(
padding: EdgeInsets.fromLTRB(8, 0, 8, 8), padding: EdgeInsets.fromLTRB(8, 0, 8, 8),
child: Row( child: Row(
@ -94,9 +92,7 @@ class PatientProfileButton extends StatelessWidget {
], ],
)), )),
Container( Container(
alignment: projectsProvider.isArabic alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft,
? Alignment.topRight
: Alignment.topLeft,
padding: EdgeInsets.symmetric(horizontal: 7), padding: EdgeInsets.symmetric(horizontal: 7),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -1,11 +1,11 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -14,7 +14,7 @@ import 'package:url_launcher/url_launcher.dart';
import '../large_avatar.dart'; import '../large_avatar.dart';
import 'header_row.dart'; import 'header_row.dart';
class PatientProfileAppBar extends StatelessWidget { class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final double height; final double height;
final bool isInpatient; final bool isInpatient;
@ -73,17 +73,14 @@ class PatientProfileAppBar extends StatelessWidget {
right: 5, right: 5,
bottom: 5, bottom: 5,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))),
color: Colors.white,
border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))),
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50), margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50),
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
child: Row(children: [ child: Row(children: [
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
@ -96,11 +93,8 @@ class PatientProfileAppBar extends StatelessWidget {
Expanded( Expanded(
child: AppText( child: AppText(
patient.firstName != null patient.firstName != null
? (Utils.capitalize(patient.firstName) + ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName))
" " + : Utils.capitalize(patient.fullName ?? patient.patientDetails!.fullName),
Utils.capitalize(patient.lastName))
: Utils.capitalize(patient.fullName ??
patient.patientDetails!.fullName),
fontSize: SizeConfig.textMultiplier! * 1.8, fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -133,15 +127,12 @@ class PatientProfileAppBar extends StatelessWidget {
), ),
Row(children: [ Row(children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
child: Container( child: Container(
width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, width: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
child: Image.asset( child: Image.asset(
gender == 1 gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -164,29 +155,18 @@ class PatientProfileAppBar extends StatelessWidget {
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
.getTextMultiplierBasedOnWidth() *
3.5,
) )
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
color: Colors.red[800]!, color: Colors.red[800]!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
.getTextMultiplierBasedOnWidth() *
3.5,
), ),
patient.startTime != null patient.startTime != null
? AppText( ? AppText(patient.startTime != null ? patient.startTime! : '',
patient.startTime != null fontWeight: FontWeight.w700, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A))
? patient.startTime!
: '',
fontWeight: FontWeight.w700,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A))
: SizedBox() : SizedBox()
], ],
)) ))
@ -199,9 +179,7 @@ class PatientProfileAppBar extends StatelessWidget {
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNumber, TranslationBase.of(context).fileNumber,
fontSize: fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
SizeConfig.getTextMultiplierBasedOnWidth() *
3,
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
@ -210,9 +188,7 @@ class PatientProfileAppBar extends StatelessWidget {
), ),
AppText( AppText(
patient.patientId.toString(), patient.patientId.toString(),
fontSize: fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
isCopyable: true, isCopyable: true,
@ -222,14 +198,9 @@ class PatientProfileAppBar extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
patient.nationalityName ?? patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '',
patient.nationality ??
patient.nationalityId ??
'',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
SizeConfig.getTextMultiplierBasedOnWidth() *
3.5,
), ),
patient.nationalityFlagURL != null patient.nationalityFlagURL != null
? ClipRRect( ? ClipRRect(
@ -238,9 +209,7 @@ class PatientProfileAppBar extends StatelessWidget {
patient.nationalityFlagURL!, patient.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
Object exception,
StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -256,42 +225,29 @@ class PatientProfileAppBar extends StatelessWidget {
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
), ),
if (patient.appointmentDate != null && if (patient.appointmentDate != null && patient.appointmentDate!.isNotEmpty && !isFromLabResult)
patient.appointmentDate!.isNotEmpty &&
!isFromLabResult)
HeaderRow( HeaderRow(
label: label: TranslationBase.of(context).appointmentDate + " : ",
TranslationBase.of(context).appointmentDate + " : ", value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate!)),
value: AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(
patient.appointmentDate!)),
), ),
if (isFromLabResult) if (isFromLabResult)
HeaderRow( HeaderRow(
label: "Result Date: ", label: "Result Date: ",
value: value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
), ),
// if(isInpatient) // if(isInpatient)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (patient.admissionDate != null && if (patient.admissionDate != null && patient.admissionDate!.isNotEmpty)
patient.admissionDate!.isNotEmpty)
HeaderRow( HeaderRow(
label: patient.admissionDate == null label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ",
? "" value: patient.admissionDate == null ? "" : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}",
: TranslationBase.of(context).admissionDate +
" : ",
value: patient.admissionDate == null
? ""
: "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}",
), ),
if (patient.admissionDate != null) if (patient.admissionDate != null)
HeaderRow( HeaderRow(
label: "${TranslationBase.of(context).numOfDays}: ", label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient && value: isDischargedPatient && patient.dischargeDate != null
patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}", : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}",
) )
@ -308,17 +264,12 @@ class PatientProfileAppBar extends StatelessWidget {
Container( Container(
width: 30, width: 30,
height: 30, height: 30,
margin: EdgeInsets.only( margin: EdgeInsets.only(left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5),
left: projectViewModel.isArabic ? 10 : 85,
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: bottom: BorderSide(color: Colors.grey[400]!, width: 2.5),
BorderSide(color: Colors.grey[400]!, width: 2.5), left: BorderSide(color: Colors.grey[400]!, width: 2.5),
left:
BorderSide(color: Colors.grey[400]!, width: 2.5),
)), )),
), ),
Expanded( Expanded(
@ -340,17 +291,12 @@ class PatientProfileAppBar extends StatelessWidget {
flex: 5, flex: 5,
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText( AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase('${TranslationBase.of(context).dr}$doctorName'),
'${TranslationBase.of(context).dr}$doctorName'),
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: SizeConfig fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
.getTextMultiplierBasedOnWidth() *
3.5,
isCopyable: true, isCopyable: true,
), ),
if (orderNo != null && !isPrescriptions) if (orderNo != null && !isPrescriptions)
@ -370,15 +316,8 @@ class PatientProfileAppBar extends StatelessWidget {
), ),
if (clinic != null) if (clinic != null)
Container( Container(
width: width: MediaQuery.of(context).size.width * 0.51,
MediaQuery.of(context).size.width * child: HeaderRow(label: 'Clinic: ', value: Utils.convertToTitleCase(clinic) ?? '', isExpanded: true),
0.51,
child: HeaderRow(
label: 'Clinic: ',
value: Utils.convertToTitleCase(
clinic) ??
'',
isExpanded: true),
), ),
if (isMedicalFile && episode != null) if (isMedicalFile && episode != null)
HeaderRow( HeaderRow(
@ -392,11 +331,8 @@ class PatientProfileAppBar extends StatelessWidget {
), ),
if (!isMedicalFile) if (!isMedicalFile)
HeaderRow( HeaderRow(
label: !isPrescriptions label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ',
? 'Result Date:' value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
: 'Prescriptions Date ',
value:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
), ),
]), ]),
), ),
@ -425,7 +361,6 @@ class PatientProfileAppBar extends StatelessWidget {
? 137 ? 137
: SizeConfig.isHeightShort : SizeConfig.isHeightShort
? 190 ? 190
: SizeConfig.heightMultiplier! * : SizeConfig.heightMultiplier! * (SizeConfig.isWidthLarge ? 25 : 20)
(SizeConfig.isWidthLarge ? 25 : 20)
: height); : height);
} }

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -15,14 +15,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
final String? arrivalType; final String? arrivalType;
final bool isInpatient; final bool isInpatient;
ProfileMedicalInfoWidget( ProfileMedicalInfoWidget({Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient = false});
{Key? key,
this.patient,
this.patientType,
this.arrivalType,
this.from,
this.to,
this.isInpatient = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -46,7 +39,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).vital, nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs, nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS, route: VITAL_SIGN_DETAILS,
icon: 'assets/images/svgs/profile_screen/vital signs.svg'), icon: 'assets/images/svgs/profile_screen/vital signs.svg',
onTap: () {},
),
// if (selectedPatientType != 7) // if (selectedPatientType != 7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -58,7 +53,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
nameLine2: "Summary", nameLine2: "Summary",
//TranslationBase.of(context).summaryReport, //TranslationBase.of(context).summaryReport,
icon: 'assets/images/svgs/profile_screen/health summary.svg'), icon: 'assets/images/svgs/profile_screen/health summary.svg', onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -67,7 +63,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: LAB_RESULT, route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab, nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result, nameLine2: TranslationBase.of(context).result,
icon: 'assets/images/svgs/profile_screen/lab results.svg'), icon: 'assets/images/svgs/profile_screen/lab results.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -76,7 +74,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: ALL_SPECIAL_LAB_RESULT, route: ALL_SPECIAL_LAB_RESULT,
nameLine1: TranslationBase.of(context).lab, nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).special, nameLine2: TranslationBase.of(context).special,
icon: 'assets/images/svgs/profile_screen/lab results.svg'), icon: 'assets/images/svgs/profile_screen/lab results.svg',
onTap: () {},
),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -87,7 +87,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: RADIOLOGY_PATIENT, route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology, nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).service,
icon: 'assets/images/svgs/profile_screen/health summary.svg'), icon: 'assets/images/svgs/profile_screen/health summary.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -96,7 +98,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: PATIENT_ECG, route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG", nameLine2: "ECG",
icon: 'assets/images/svgs/profile_screen/ECG.svg'), icon: 'assets/images/svgs/profile_screen/ECG.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -105,7 +109,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: ORDER_PRESCRIPTION_OLD, route: ORDER_PRESCRIPTION_OLD,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: 'assets/images/svgs/profile_screen/order prescription.svg'), icon: 'assets/images/svgs/profile_screen/order prescription.svg',
onTap: () {},
),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -115,7 +121,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: ORDER_PROCEDURE, route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures, nameLine2: TranslationBase.of(context).procedures,
icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), icon: 'assets/images/svgs/profile_screen/Order Procedures.svg',
onTap: () {},
),
//if (int.parse(patientType) == 7 || int.parse(patientType) == 6) //if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -125,7 +133,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: PATIENT_INSURANCE_APPROVALS_NEW, route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance, nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).service,
icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), icon: 'assets/images/svgs/profile_screen/insurance approval.svg',
onTap: () {},
),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -135,7 +145,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: ADD_SICKLEAVE, route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick, nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), icon: 'assets/images/svgs/profile_screen/patient sick leave.svg',
onTap: () {},
),
if (patient!.appointmentNo != null && patient!.appointmentNo != 0) if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -146,7 +158,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
isDisable: patient!.patientStatusType != 43 ? true : false, isDisable: patient!.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf, nameLine2: TranslationBase.of(context).ucaf,
icon: 'patient/ucaf.png'), icon: 'patient/ucaf.png',
onTap: () {},
),
if (patient!.appointmentNo != null && patient!.appointmentNo != 0) if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -157,7 +171,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
isDisable: patient!.patientStatusType != 43 ? true : false, isDisable: patient!.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).referral, nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'), icon: 'patient/refer_patient.png',
onTap: () {},
),
if (patient!.appointmentNo != null && patient!.appointmentNo != 0) if (patient!.appointmentNo != null && patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -168,7 +184,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
isDisable: patient!.patientStatusType != 43 ? true : false, isDisable: patient!.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request, nameLine2: TranslationBase.of(context).request,
icon: 'patient/admission_req.png'), icon: 'patient/admission_req.png',
onTap: () {},
),
if (isInpatient) if (isInpatient)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -178,7 +196,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
route: PROGRESS_NOTE, route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress, nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note, nameLine2: TranslationBase.of(context).note,
icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), icon: 'assets/images/svgs/profile_screen/Progress notes.svg',
onTap: () {},
),
if (isInpatient) if (isInpatient)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -189,7 +209,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: "Order", nameLine1: "Order",
//"Text", //"Text",
nameLine2: "Sheet", nameLine2: "Sheet",
icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), icon: 'assets/images/svgs/profile_screen/Progress notes.svg', onTap: () {},
),
], ],
), ),
); );

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
@ -16,15 +16,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
final bool isInpatient; final bool isInpatient;
final bool isDischargedPatient; final bool isDischargedPatient;
ProfileMedicalInfoWidgetInPatient( ProfileMedicalInfoWidgetInPatient({Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient = false, this.isDischargedPatient = false});
{Key? key,
this.patient,
this.patientType,
this.arrivalType,
this.from,
this.to,
this.isInpatient = false,
this.isDischargedPatient = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -49,7 +41,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
nameLine2: TranslationBase.of(context).signs, nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS, route: VITAL_SIGN_DETAILS,
isInPatient: true, isInPatient: true,
icon: 'assets/images/svgs/profile_screen/vital signs.svg'), icon: 'assets/images/svgs/profile_screen/vital signs.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -59,7 +53,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
isInPatient: true, isInPatient: true,
nameLine1: TranslationBase.of(context).lab, nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result, nameLine2: TranslationBase.of(context).result,
icon: 'assets/images/svgs/profile_screen/lab results.svg'), icon: 'assets/images/svgs/profile_screen/lab results.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -69,7 +65,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
route: RADIOLOGY_PATIENT, route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology, nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).result, nameLine2: TranslationBase.of(context).result,
icon: 'assets/images/svgs/profile_screen/health summary.svg'), icon: 'assets/images/svgs/profile_screen/health summary.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -78,7 +76,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
route: ORDER_PRESCRIPTION_OLD, route: ORDER_PRESCRIPTION_OLD,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', nameLine2: TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})',
icon: 'assets/images/svgs/profile_screen/order prescription.svg'), icon: 'assets/images/svgs/profile_screen/order prescription.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -87,7 +87,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
route: ORDER_PRESCRIPTION_NEW, route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: 'assets/images/svgs/profile_screen/order prescription.svg'), icon: 'assets/images/svgs/profile_screen/order prescription.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -97,7 +99,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
isDischargedPatient: isDischargedPatient, isDischargedPatient: isDischargedPatient,
nameLine1: TranslationBase.of(context).progress, nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note, nameLine2: TranslationBase.of(context).note,
icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), icon: 'assets/images/svgs/profile_screen/Progress notes.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -109,7 +113,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
//"Text", //"Text",
nameLine2: "Sheet", nameLine2: "Sheet",
//TranslationBase.of(context).orders, //TranslationBase.of(context).orders,
icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), icon: 'assets/images/svgs/profile_screen/Progress notes.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -118,7 +124,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
route: ORDER_PROCEDURE, route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures, nameLine2: TranslationBase.of(context).procedures,
icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), icon: 'assets/images/svgs/profile_screen/Order Procedures.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -129,7 +137,8 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
nameLine2: "Summary", nameLine2: "Summary",
//TranslationBase.of(context).summaryReport, //TranslationBase.of(context).summaryReport,
icon: 'assets/images/svgs/profile_screen/health summary.svg'), icon: 'assets/images/svgs/profile_screen/health summary.svg', onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -143,7 +152,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
nameLine2: "Report", nameLine2: "Report",
//Report //Report
//TranslationBase.of(context).summaryReport, //TranslationBase.of(context).summaryReport,
icon: 'assets/images/svgs/profile_screen/health summary.svg'), icon: 'assets/images/svgs/profile_screen/health summary.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -153,7 +164,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
isInPatient: true, isInPatient: true,
nameLine1: TranslationBase.of(context).referral, nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'), icon: 'patient/refer_patient.png',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -162,7 +175,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
route: PATIENT_INSURANCE_APPROVALS_NEW, route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance, nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).approvals, nameLine2: TranslationBase.of(context).approvals,
icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), icon: 'assets/images/svgs/profile_screen/insurance approval.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -172,7 +187,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
route: null, route: null,
nameLine1: "Discharge", nameLine1: "Discharge",
nameLine2: "Summery", nameLine2: "Summery",
icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), icon: 'assets/images/svgs/profile_screen/patient sick leave.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
@ -181,7 +198,9 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
route: ADD_SICKLEAVE, route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick, nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), icon: 'assets/images/svgs/profile_screen/patient sick leave.svg',
onTap: () {},
),
], ],
), ),
); );

@ -1,10 +1,9 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProfileMedicalInfoWidgetSearch extends StatefulWidget { class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
@ -16,24 +15,13 @@ class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
final bool isInpatient; final bool isInpatient;
final bool isDischargedPatient; final bool isDischargedPatient;
ProfileMedicalInfoWidgetSearch( ProfileMedicalInfoWidgetSearch({Key? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient = false, this.isDischargedPatient = false});
{Key? key,
this.patient,
this.patientType,
this.arrivalType,
this.from,
this.to,
this.isInpatient = false,
this.isDischargedPatient = false});
@override @override
State<ProfileMedicalInfoWidgetSearch> createState() => State<ProfileMedicalInfoWidgetSearch> createState() => _ProfileMedicalInfoWidgetSearchState();
_ProfileMedicalInfoWidgetSearchState();
} }
class _ProfileMedicalInfoWidgetSearchState class _ProfileMedicalInfoWidgetSearchState extends State<ProfileMedicalInfoWidgetSearch> with SingleTickerProviderStateMixin {
extends State<ProfileMedicalInfoWidgetSearch>
with SingleTickerProviderStateMixin {
late TabController _tabController; late TabController _tabController;
void initState() { void initState() {
@ -73,7 +61,9 @@ class _ProfileMedicalInfoWidgetSearchState
nameLine1: TranslationBase.of(context).vital, nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs, nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS, route: VITAL_SIGN_DETAILS,
icon: 'assets/images/svgs/profile_screen/vital signs.svg'), icon: 'assets/images/svgs/profile_screen/vital signs.svg',
onTap: () {},
),
// if (selectedPatientType != 7) // if (selectedPatientType != 7)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
@ -85,8 +75,8 @@ class _ProfileMedicalInfoWidgetSearchState
//TranslationBase.of(context).medicalReport, //TranslationBase.of(context).medicalReport,
nameLine2: "Summary", nameLine2: "Summary",
//TranslationBase.of(context).summaryReport, //TranslationBase.of(context).summaryReport,
icon: icon: 'assets/images/svgs/profile_screen/health summary.svg', onTap: () {},
'assets/images/svgs/profile_screen/health summary.svg'), ),
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
patient: widget.patient, patient: widget.patient,
@ -95,7 +85,9 @@ class _ProfileMedicalInfoWidgetSearchState
route: LAB_RESULT, route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab, nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result, nameLine2: TranslationBase.of(context).result,
icon: 'assets/images/svgs/profile_screen/lab results.svg'), icon: 'assets/images/svgs/profile_screen/lab results.svg',
onTap: () {},
),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
@ -106,8 +98,9 @@ class _ProfileMedicalInfoWidgetSearchState
route: RADIOLOGY_PATIENT, route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology, nameLine1: TranslationBase.of(context).radiology,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).service,
icon: icon: 'assets/images/svgs/profile_screen/health summary.svg',
'assets/images/svgs/profile_screen/health summary.svg'), onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
patient: widget.patient, patient: widget.patient,
@ -116,7 +109,9 @@ class _ProfileMedicalInfoWidgetSearchState
route: PATIENT_ECG, route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG", nameLine2: "ECG",
icon: 'assets/images/svgs/profile_screen/ECG.svg'), icon: 'assets/images/svgs/profile_screen/ECG.svg',
onTap: () {},
),
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
patient: widget.patient, patient: widget.patient,
@ -125,8 +120,9 @@ class _ProfileMedicalInfoWidgetSearchState
route: ORDER_PRESCRIPTION_OLD, route: ORDER_PRESCRIPTION_OLD,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription,
icon: icon: 'assets/images/svgs/profile_screen/order prescription.svg',
'assets/images/svgs/profile_screen/order prescription.svg'), onTap: () {},
),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
@ -136,8 +132,9 @@ class _ProfileMedicalInfoWidgetSearchState
route: ORDER_PROCEDURE, route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures, nameLine2: TranslationBase.of(context).procedures,
icon: icon: 'assets/images/svgs/profile_screen/Order Procedures.svg',
'assets/images/svgs/profile_screen/Order Procedures.svg'), onTap: () {},
),
//if (int.parse(patientType) == 7 || int.parse(patientType) == 6) //if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
@ -147,8 +144,9 @@ class _ProfileMedicalInfoWidgetSearchState
route: PATIENT_INSURANCE_APPROVALS_NEW, route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance, nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).service,
icon: icon: 'assets/images/svgs/profile_screen/insurance approval.svg',
'assets/images/svgs/profile_screen/insurance approval.svg'), onTap: () {},
),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
@ -158,52 +156,48 @@ class _ProfileMedicalInfoWidgetSearchState
route: ADD_SICKLEAVE, route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick, nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: icon: 'assets/images/svgs/profile_screen/patient sick leave.svg',
'assets/images/svgs/profile_screen/patient sick leave.svg'), onTap: () {},
if (widget.patient!.appointmentNo != null && ),
widget.patient!.appointmentNo != 0) if (widget.patient!.appointmentNo != null && widget.patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
patient: widget.patient, patient: widget.patient,
patientType: widget.patientType, patientType: widget.patientType,
arrivalType: widget.arrivalType, arrivalType: widget.arrivalType,
route: PATIENT_UCAF_REQUEST, route: PATIENT_UCAF_REQUEST,
isDisable: widget.patient!.patientStatusType != 43 isDisable: widget.patient!.patientStatusType != 43 ? true : false,
? true
: false,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf, nameLine2: TranslationBase.of(context).ucaf,
icon: 'assets/images/svgs/profile_screen/UCAF.svg'), icon: 'assets/images/svgs/profile_screen/UCAF.svg',
if (widget.patient!.appointmentNo != null && onTap: () {},
widget.patient!.appointmentNo != 0) ),
if (widget.patient!.appointmentNo != null && widget.patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
patient: widget.patient, patient: widget.patient,
patientType: widget.patientType, patientType: widget.patientType,
arrivalType: widget.arrivalType, arrivalType: widget.arrivalType,
route: REFER_PATIENT_TO_DOCTOR, route: REFER_PATIENT_TO_DOCTOR,
isDisable: widget.patient!.patientStatusType != 43 isDisable: widget.patient!.patientStatusType != 43 ? true : false,
? true
: false,
nameLine1: TranslationBase.of(context).referral, nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: icon: 'assets/images/svgs/profile_screen/refer patient.svg',
'assets/images/svgs/profile_screen/refer patient.svg'), onTap: () {},
if (widget.patient!.appointmentNo != null && ),
widget.patient!.appointmentNo != 0) if (widget.patient!.appointmentNo != null && widget.patient!.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
patient: widget.patient, patient: widget.patient,
patientType: widget.patientType, patientType: widget.patientType,
arrivalType: widget.arrivalType, arrivalType: widget.arrivalType,
route: PATIENT_ADMISSION_REQUEST, route: PATIENT_ADMISSION_REQUEST,
isDisable: widget.patient!.patientStatusType != 43 isDisable: widget.patient!.patientStatusType != 43 ? true : false,
? true
: false,
nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request, nameLine2: TranslationBase.of(context).request,
icon: icon: 'assets/images/svgs/profile_screen/admission req.svg',
'assets/images/svgs/profile_screen/admission req.svg'), onTap: () {},
),
if (widget.isInpatient) if (widget.isInpatient)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
@ -213,8 +207,9 @@ class _ProfileMedicalInfoWidgetSearchState
route: PROGRESS_NOTE, route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress, nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note, nameLine2: TranslationBase.of(context).note,
icon: icon: 'assets/images/svgs/profile_screen/Progress notes.svg',
'assets/images/svgs/profile_screen/Progress notes.svg'), onTap: () {},
),
if (widget.isInpatient) if (widget.isInpatient)
PatientProfileButton( PatientProfileButton(
key: widget.key, key: widget.key,
@ -225,8 +220,8 @@ class _ProfileMedicalInfoWidgetSearchState
nameLine1: "Order", nameLine1: "Order",
//"Text", //"Text",
nameLine2: "Sheet", nameLine2: "Sheet",
icon: icon: 'assets/images/svgs/profile_screen/Progress notes.svg', onTap: () {},
'assets/images/svgs/profile_screen/Progress notes.svg'), ),
], ],
), ),
), ),

@ -18,7 +18,7 @@ class AppScaffold extends StatelessWidget {
final BaseViewModel? baseViewModel; final BaseViewModel? baseViewModel;
final Widget? bottomSheet; final Widget? bottomSheet;
final Color? backgroundColor; final Color? backgroundColor;
final Widget? appBar; final PreferredSizeWidget? appBar;
final Widget? drawer; final Widget? drawer;
final Widget? bottomNavigationBar; final Widget? bottomNavigationBar;
final String? subtitle; final String? subtitle;
@ -29,7 +29,7 @@ class AppScaffold extends StatelessWidget {
{this.appBarTitle = '', {this.appBarTitle = '',
this.body, this.body,
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = true, this.isShowAppBar = false,
this.baseViewModel, this.baseViewModel,
this.bottomSheet, this.bottomSheet,
this.backgroundColor, this.backgroundColor,
@ -49,12 +49,12 @@ class AppScaffold extends StatelessWidget {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(new FocusNode());
}, },
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
drawer: drawer, drawer: drawer,
extendBody: extendBody, extendBody: extendBody,
bottomNavigationBar: bottomNavigationBar, bottomNavigationBar: bottomNavigationBar,
appBar: isShowAppBar && appBar != null appBar: isShowAppBar
? appBar != null
? appBar as PreferredSizeWidget ? appBar as PreferredSizeWidget
: AppBar( : AppBar(
elevation: 0, elevation: 0,
@ -88,12 +88,12 @@ class AppScaffold extends StatelessWidget {
? IconButton( ? IconButton(
icon: Icon(DoctorApp.home_icon_active), icon: Icon(DoctorApp.home_icon_active),
color: Colors.black, //Colors.black, color: Colors.black, //Colors.black,
onPressed: () => Navigator.pushNamedAndRemoveUntil( onPressed: () => Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false),
context, HOME, (r) => false),
) )
: SizedBox() : SizedBox()
], ],
), )
: null,
bottomSheet: bottomSheet, bottomSheet: bottomSheet,
body: projectProvider.isInternetConnection body: projectProvider.isInternetConnection
? baseViewModel != null ? baseViewModel != null
@ -101,8 +101,7 @@ class AppScaffold extends StatelessWidget {
baseViewModel: baseViewModel!, baseViewModel: baseViewModel!,
child: body!, child: body!,
) )
: Stack( : Stack(children: <Widget>[body!, buildAppLoaderWidget(isLoading)])
children: <Widget>[body!, buildAppLoaderWidget(isLoading)])
: Center( : Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

@ -1,16 +1,15 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class AppText extends StatefulWidget { class AppText extends StatefulWidget {
final String text; final String text;
final String? variant; final String? variant;
final Color color; final Color? color;
final FontWeight? fontWeight; final FontWeight? fontWeight;
final double? fontSize; final double? fontSize;
final double? fontHeight; final double? fontHeight;
final String fontFamily; final String? fontFamily;
final int maxLength; final int maxLength;
final bool italic; final bool italic;
final double? margin; final double? margin;
@ -20,9 +19,9 @@ class AppText extends StatefulWidget {
final double marginLeft; final double marginLeft;
final double? letterSpacing; final double? letterSpacing;
final TextAlign? textAlign; final TextAlign? textAlign;
final bool bold; final bool? bold;
final bool regular; final bool? regular;
final bool medium; final bool? medium;
final int? maxLines; final int? maxLines;
final bool readMore; final bool readMore;
final String? style; final String? style;
@ -48,9 +47,9 @@ class AppText extends StatefulWidget {
this.marginBottom = 0, this.marginBottom = 0,
this.marginLeft = 0, this.marginLeft = 0,
this.textAlign, this.textAlign,
this.bold = false, this.bold,
this.regular = false, this.regular,
this.medium = false, this.medium,
this.maxLines, this.maxLines,
this.readMore = false, this.readMore = false,
this.style, this.style,
@ -97,13 +96,7 @@ class _AppTextState extends State<AppText> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
child: Container( child: Container(
margin: widget.margin != null margin: widget.margin != null ? EdgeInsets.all(widget.margin!) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft),
? EdgeInsets.all(widget.margin!)
: EdgeInsets.only(
top: widget.marginTop,
right: widget.marginRight,
bottom: widget.marginBottom,
left: widget.marginLeft),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -118,21 +111,16 @@ class _AppTextState extends State<AppText> {
right: 0, right: 0,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(colors: [
colors: [ Theme.of(context).colorScheme.background,
Theme.of(context).backgroundColor, Theme.of(context).colorScheme.background.withOpacity(0),
Theme.of(context).backgroundColor.withOpacity(0), ], begin: Alignment.bottomCenter, end: Alignment.topCenter)),
],
begin: Alignment.bottomCenter,
end: Alignment.topCenter)),
height: 30, height: 30,
), ),
) )
], ],
), ),
if (widget.allowExpand && if (widget.allowExpand && widget.readMore && text.length > widget.maxLength)
widget.readMore &&
text.length > widget.maxLength)
Padding( Padding(
padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0),
child: InkWell( child: InkWell(
@ -171,13 +159,7 @@ class _AppTextState extends State<AppText> {
), ),
child: Container( child: Container(
child: SelectableText( child: SelectableText(
!hidden !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
// overflow: widget.maxLines != null // overflow: widget.maxLines != null
// ? ((widget.maxLines > 1) // ? ((widget.maxLines > 1)
@ -188,51 +170,42 @@ class _AppTextState extends State<AppText> {
style: widget.style != null style: widget.style != null
? _getFontStyle()!.copyWith( ? _getFontStyle()!.copyWith(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
fontSize: widget.fontSize ?? _getFontSize(),
color: widget.color, color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight) height: widget.fontHeight)
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: color: widget.color != null ? widget.color : Color(0xff2E303A),
widget.color != null ? widget.color : Color(0xff2E303A),
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration, decoration: widget.textDecoration,
height: widget.fontHeight), height: widget.fontHeight,
),
), ),
), ),
); );
} else { } else {
return Text( return Text(
!hidden !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
overflow: widget.maxLines != null overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null,
? ((widget.maxLines! > 1)
? TextOverflow.fade
: TextOverflow.ellipsis)
: null,
maxLines: widget.maxLines ?? null, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle()!.copyWith( ? _getFontStyle()?.copyWith(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
fontSize: widget.fontSize ?? _getFontSize(),
color: widget.color, color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight) height: widget.fontHeight,
)
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black, color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration, decoration: widget.textDecoration,
@ -265,8 +238,6 @@ class _AppTextState extends State<AppText> {
return Theme.of(context).textTheme.labelSmall; return Theme.of(context).textTheme.labelSmall;
case "button": case "button":
return Theme.of(context).textTheme.labelLarge; return Theme.of(context).textTheme.labelLarge;
default:
return TextStyle();
} }
} }

@ -24,8 +24,8 @@ class AppTextFieldCustom extends StatefulWidget {
final int minLines; final int minLines;
final int maxLines; final int maxLines;
final List<TextInputFormatter>? inputFormatters; final List<TextInputFormatter>? inputFormatters;
final Function(String? value) onChanged; final Function(String value) onChanged;
final Function onFieldSubmitted; final Function() onFieldSubmitted;
final String? validationError; final String? validationError;
final bool isPrscription; final bool isPrscription;

@ -24,7 +24,7 @@ class AppTextFieldCustomSearch extends StatelessWidget {
final TextEditingController? searchController; final TextEditingController? searchController;
final Function onChangeFun; final Function(String val) onChangeFun;
final Function onFieldSubmitted; final Function onFieldSubmitted;
final Widget? positionedChild; final Widget? positionedChild;
@ -59,8 +59,12 @@ class AppTextFieldCustomSearch extends StatelessWidget {
onPressed: () {}, onPressed: () {},
), ),
controller: searchController, controller: searchController,
onChanged: onChangeFun(), onChanged: (val) {
onFieldSubmitted: onFieldSubmitted(), onChangeFun(val);
},
onFieldSubmitted: () {
onFieldSubmitted();
},
validationError: validationError, validationError: validationError,
onClick: () {}, onClick: () {},
), ),

Loading…
Cancel
Save