lab results working(cont.) & improvements

merge-update-with-lab-changes
Sikander Saleem 5 years ago
parent 70614d3555
commit 4db432b351

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
//const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/'; //const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
//const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; //const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -39,7 +39,9 @@ const Map localizedValues = {
'bookAppo': {'en': 'Book Appointment', 'ar': 'حجز موعد'}, 'bookAppo': {'en': 'Book Appointment', 'ar': 'حجز موعد'},
'searchBy': {'en': 'Search By:', 'ar': 'البحث عن طريق:'}, 'searchBy': {'en': 'Search By:', 'ar': 'البحث عن طريق:'},
'clinic': {'en': 'Clinic', 'ar': 'العيادة'}, 'clinic': {'en': 'Clinic', 'ar': 'العيادة'},
'by-clinic': {'en': 'By Clinic', 'ar': 'العيادة'},
'hospital': {'en': 'Hospital', 'ar': 'المستشفى'}, 'hospital': {'en': 'Hospital', 'ar': 'المستشفى'},
'by-hospital': {'en': 'By Hospital', 'ar': 'المستشفى'},
'name': {'en': 'Name', 'ar': 'الإسم'}, 'name': {'en': 'Name', 'ar': 'الإسم'},
'doctor': {'en': 'Doctor', 'ar': 'الطبيب'}, 'doctor': {'en': 'Doctor', 'ar': 'الطبيب'},
'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'}, 'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'},
@ -135,6 +137,7 @@ const Map localizedValues = {
"verify-through": {"en": "Verify Through", "ar": " تحقق من خلال"}, "verify-through": {"en": "Verify Through", "ar": " تحقق من خلال"},
"last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"}, "last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"},
"last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"},
"please-verify": {"en": "Please Verify", "ar": "ارجوك تحقق:"},
"verify-fingerprint": { "verify-fingerprint": {
"en": "To activate the fingerprint login service, please verify data by using one of the following options.", "en": "To activate the fingerprint login service, please verify data by using one of the following options.",
"ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات"
@ -823,7 +826,7 @@ const Map localizedValues = {
"send-copy": {"en": "Email the Report", "ar": "أرسل التقرير"}, "send-copy": {"en": "Email the Report", "ar": "أرسل التقرير"},
"appoSurvey": {"en": "Survey", "ar": "إستبيان"}, "appoSurvey": {"en": "Survey", "ar": "إستبيان"},
"appoSurveySubtitle": {"en": "Survey", "ar": "إستبيان"}, "appoSurveySubtitle": {"en": "Survey", "ar": "إستبيان"},
"labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, "labResults": {"en": "Lab Results", "ar": "نتيجة المختبر"},
"doctorRating": {"en": "Doctor Rating", "ar": "تقييم الطبيب"}, "doctorRating": {"en": "Doctor Rating", "ar": "تقييم الطبيب"},
"good": {"en": "Good", "ar": "جيد"}, "good": {"en": "Good", "ar": "جيد"},
"v-good": {"en": "Very Good", "ar": "جيد جدا"}, "v-good": {"en": "Very Good", "ar": "جيد جدا"},

@ -497,7 +497,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return Scaffold( return Scaffold(
appBar: AppBar( appBar: currentTab == 1
? null
: AppBar(
elevation: 0, elevation: 0,
textTheme: TextTheme( textTheme: TextTheme(
headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold),

@ -120,6 +120,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
if (user != null) if (user != null)
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).welcomeBack, TranslationBase.of(context).welcomeBack,
@ -160,9 +161,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Text( Text(
user.editedOn != null user.editedOn != null
? formatDateToDate(DateUtil.convertStringToDate(user.editedOn)) ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn))
: user.createdOn != null : user.createdOn != null
? formatDateToDate(DateUtil.convertStringToDate(user.createdOn)) ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.createdOn))
: '--', : '--',
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
), ),
@ -193,9 +194,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Text( Text(
user.editedOn != null user.editedOn != null
? formatDateToTime(DateUtil.convertStringToDate(user.editedOn)) ? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.editedOn))
: user.createdOn != null : user.createdOn != null
? formatDateToTime(DateUtil.convertStringToDate(user.createdOn)) ? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.createdOn))
: '--', : '--',
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
), ),
@ -927,14 +928,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return DateFormat('MMM dd, yyy, kk:mm').format(date); return DateFormat('MMM dd, yyy, kk:mm').format(date);
} }
formatDateToDate(date) {
return DateFormat('dd MMM yyy').format(date);
}
formatDateToTime(date) {
return DateFormat('kk:mm a').format(date);
}
showLoader(bool isTrue) { showLoader(bool isTrue) {
setState(() { setState(() {
isLoading = isTrue; isLoading = isTrue;

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
class WelcomeLogin extends StatefulWidget { class WelcomeLogin extends StatefulWidget {
@override @override
@ -21,7 +22,6 @@ class _WelcomeLogin extends State<WelcomeLogin> {
@override @override
void initState() { void initState() {
isLoading = true; isLoading = true;
// checkUser(context);
super.initState(); super.initState();
} }
@ -31,68 +31,74 @@ class _WelcomeLogin extends State<WelcomeLogin> {
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: false, showNewAppBarTitle: false,
body: Padding( body: Column(
padding: EdgeInsets.all(20),
child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 6, child: ListView(
child: Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ padding: EdgeInsets.only(left: 21, right: 21),
Image.asset('assets/images/DQ/logo.png', height: 90, width: 90), physics: BouncingScrollPhysics(),
AppText( children: [
SizedBox(height: 12),
Align(
alignment: Alignment.centerLeft,
child: SvgPicture.asset(
"assets/images/new/hmg_icon.svg",
height: 35,
width: 35,
),
),
SizedBox(height: 16),
Text(
TranslationBase.of(context).welcome, TranslationBase.of(context).welcome,
fontSize: 30, style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24),
fontWeight: FontWeight.bold,
), ),
AppText( Text(
TranslationBase.of(context).welcomeText, TranslationBase.of(context).welcomeText,
fontSize: 24, style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14),
textAlign: TextAlign.start,
), ),
AppText( Text(
TranslationBase.of(context).welcomeText2, TranslationBase.of(context).welcomeText2,
fontSize: 24, style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14),
textAlign: TextAlign.start,
), ),
SizedBox( SizedBox(
height: SizeConfig.realScreenHeight * .15, height: 14,
)
]),
), ),
Expanded( ],
flex: 2, ),
child: Column( ),
//mainAxisAlignment: MainAxisAlignment.end, Container(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, color: Colors.white,
children: <Widget>[ padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
Row( child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).yes, TranslationBase.of(context).no,
() => { () => {
Navigator.of(context).push(FadePage(page: LoginType())), Navigator.of(context).push(FadePage(page: Register())),
}, },
color: Color(0xFFc5272c), color: Color(0xffEAEAEA),
textColor: Colors.white, textColor: Color(0xff000000),
))
],
), ),
Row( ),
children: <Widget>[ SizedBox(width: 8),
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).no, TranslationBase.of(context).yes,
() => { () => {
Navigator.of(context).push(FadePage(page: Register())), Navigator.of(context).push(FadePage(page: LoginType())),
}, },
)) color: Color(0xff359846),
], ),
), ),
], ],
)) ),
),
], ],
))); ),
);
} }
} }

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -16,72 +17,56 @@ import 'package:provider/provider.dart';
import 'laboratory_result_page.dart'; import 'laboratory_result_page.dart';
class LabsHomePage extends StatelessWidget { class LabsHomePage extends StatelessWidget {
List<ImagesInfo> imagesInfo =List(); List<ImagesInfo> imagesInfo = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png')); imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png'));
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLabs(), onModelReady: (model) => model.getLabs(),
builder: (context, LabsViewModel model, widget) => AppScaffold( builder: (context, LabsViewModel model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
description: TranslationBase.of(context).infoLab, description: TranslationBase.of(context).infoLab,
appBarTitle: TranslationBase.of(context).labOrders, appBarTitle: TranslationBase.of(context).labResults,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8),
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
body: SingleChildScrollView( body: Column(
physics: BouncingScrollPhysics(), children: [
child: FractionallySizedBox(
widthFactor: 1.0,
child: Center(
child: Column(
children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, model.filterType, () {
flex: 1, model.setFilterType(FilterType.Clinic);
child: InkWell( }),
onTap: () => model.setFilterType(FilterType.Clinic), MyTabView(TranslationBase.of(context).byHospital, FilterType.Hospital, model.filterType, () {
child: ListTile( model.setFilterType(FilterType.Hospital);
title: Text(TranslationBase.of(context).clinic), }),
leading: Radio(
value: FilterType.Clinic,
groupValue: model.filterType,
onChanged: (FilterType value) {
model.setFilterType(value);
},
),
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => model.setFilterType(FilterType.Hospital),
child: ListTile(
title: Text(TranslationBase.of(context).hospital),
leading: Radio(
value: FilterType.Hospital,
groupValue: model.filterType,
onChanged: (FilterType value) =>
model.setFilterType(value),
),
),
),
)
], ],
), ),
...List.generate( Expanded(
model.patientLabOrdersList.length, child: FractionallySizedBox(
(index) => AppExpandableNotifier( widthFactor: 1.0,
child: ListView.separated(
physics: BouncingScrollPhysics(),
separatorBuilder: (context, index) {
return Container(
height: 1,
color: Colors.grey,
);
},
itemBuilder: (context, index) {
return AppExpandableNotifier(
title: model.patientLabOrdersList[index].filterName, title: model.patientLabOrdersList[index].filterName,
bodyWidget: Column( bodyWidget: ListView.separated(
crossAxisAlignment: CrossAxisAlignment.start, shrinkWrap: true,
mainAxisAlignment: MainAxisAlignment.spaceBetween, physics: NeverScrollableScrollPhysics(),
children: model padding: EdgeInsets.only(left: 21, right: 21),
.patientLabOrdersList[index].patientLabOrdersList itemBuilder: (context, _index) {
.map((labOrder) { PatientLabOrders labOrder = model.patientLabOrdersList[index].patientLabOrdersList[_index];
return DoctorCard( return DoctorCard(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -90,22 +75,70 @@ class LabsHomePage extends StatelessWidget {
patientLabOrders: labOrder, patientLabOrders: labOrder,
), ),
), ),
),isInOutPatient: labOrder.isInOutPatient, ),
isInOutPatient: labOrder.isInOutPatient,
name: labOrder.doctorName, name: labOrder.doctorName,
billNo: ' ${labOrder.invoiceNo}', billNo: labOrder.projectName,
profileUrl: labOrder.doctorImageURL, profileUrl: labOrder.doctorImageURL,
subName: labOrder.projectName, subName: labOrder.clinicDescription,
isLiveCareAppointment: labOrder.isLiveCareAppointment, isLiveCareAppointment: labOrder.isLiveCareAppointment,
date: projectViewModel.isArabic?DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate):DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate), date: labOrder.orderDate
//projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate) : DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate),
); );
}).toList(), },
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: model.patientLabOrdersList[index].patientLabOrdersList.length));
},
itemCount: model.patientLabOrdersList.length),
), ),
), ),
)
], ],
), ),
), ),
), );
}
}
// todo 'Sikander' move this widget to separate file, so can find easily
class MyTabView extends StatelessWidget {
final String title;
final FilterType value;
final FilterType groupValue;
final VoidCallback onPressed;
MyTabView(
this.title,
this.value,
this.groupValue,
this.onPressed, {
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Expanded(
child: InkWell(
onTap: onPressed,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 15),
Text(
title,
style: TextStyle(
fontSize: 16,
fontFamily: "Poppins",
fontWeight: FontWeight.w600,
color: value == groupValue ? Color(0xff2B353E) : Color(0xff575757),
letterSpacing: -0.48,
),
),
Container(
margin: EdgeInsets.only(top: 13),
height: 3,
color: value == groupValue ? Color(0xffD02127) : Colors.transparent,
)
],
), ),
), ),
); );

@ -69,7 +69,9 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
onModelReady: (model) => model.getAppointmentHistory(), onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
showNewAppBar: false,
isHelp: true, isHelp: true,
body: Container( body: Container(
child: SingleChildScrollView( child: SingleChildScrollView(

@ -21,7 +21,7 @@ class _MyAdmissionsPageState extends State<MyAdmissionsPage> {
children: <Widget>[ children: <Widget>[
DoctorCard( DoctorCard(
name: 'Dr Mohammad Aljammal', name: 'Dr Mohammad Aljammal',
date: 'Feb 14, 2020', date:DateTime.now(),// 'Feb 14, 2020',
profileUrl: profileUrl:
'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB', 'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB',
rat: 3.8, rat: 3.8,
@ -29,7 +29,7 @@ class _MyAdmissionsPageState extends State<MyAdmissionsPage> {
), ),
DoctorCard( DoctorCard(
name: 'Dr Mohammad Aljammal', name: 'Dr Mohammad Aljammal',
date: 'Feb 14, 2020', date: DateTime.now(),//'Feb 14, 2020',
profileUrl: profileUrl:
'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB', 'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB',
rat: 3.8, rat: 3.8,
@ -46,7 +46,7 @@ class _MyAdmissionsPageState extends State<MyAdmissionsPage> {
//TODO when we need it //TODO when we need it
}, },
name: 'Dr Mohammad Aljammal', name: 'Dr Mohammad Aljammal',
date: 'Feb 14, 2020', date: DateTime.now(),//'Feb 14, 2020',
profileUrl: profileUrl:
'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB', 'https://scontent.famm4-1.fna.fbcdn.net/v/t31.0-8/30425660_1862582094040824_7851633779570222226_o.jpg?_nc_cat=101&_nc_sid=09cbfe&_nc_eui2=AeF3TI6D2_tFS5QoQsqyaCKd2zBfzh74hOzbMF_OHviE7PQdLHRwmBoIOiKyWmK9MskOshPjkU73a5EdQMA3dqnV&_nc_ohc=1feou2fDCuIAX_Ra9qB&_nc_ht=scontent.famm4-1.fna&oh=709d34d1c284de1d0aa08ed37b0ac09a&oe=5F3C5ACB',
rat: 4.8, rat: 4.8,

@ -22,9 +22,8 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
@override @override
void initState() { void initState() {
imagesInfo.add(ImagesInfo( imagesInfo.add(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png', ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png'));
imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png'));
super.initState(); super.initState();
} }
@ -47,7 +46,9 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
itemBuilder: (context, index) => DoctorCard( itemBuilder: (context, index) => DoctorCard(
isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment, isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment,
name: model.sickLeaveList[index].doctorName, name: model.sickLeaveList[index].doctorName,
date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.sickLeaveList[index].requestDate):DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].requestDate), date: model.sickLeaveList[index].requestDate,
// projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.sickLeaveList[index].requestDate):DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].requestDate),
profileUrl: model.sickLeaveList[index].doctorImageURL, profileUrl: model.sickLeaveList[index].doctorImageURL,
rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), rat: model.sickLeaveList[index].actualDoctorRate.toDouble(),
subName: model.sickLeaveList[index].projectName, subName: model.sickLeaveList[index].projectName,

@ -91,7 +91,7 @@ class PrescriptionsPage extends StatelessWidget {
subName: prescriptions.name, subName: prescriptions.name,
isInOutPatient: prescriptions.isInOutPatient, isInOutPatient: prescriptions.isInOutPatient,
isLiveCareAppointment: prescriptions.isLiveCareAppointment, isLiveCareAppointment: prescriptions.isLiveCareAppointment,
date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)), date:DateUtil.convertStringToDate(prescriptions.appointmentDate)//projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
), ),
); );
}).toList(), }).toList(),

@ -97,7 +97,7 @@ class RadiologyHomePage extends StatelessWidget {
profileUrl: radiology.doctorImageURL, profileUrl: radiology.doctorImageURL,
billNo: '${radiology.invoiceNo}', billNo: '${radiology.invoiceNo}',
subName: '${radiology.projectName}', subName: '${radiology.projectName}',
date: projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(radiology.orderDate):DateUtil.getMonthDayYearDateFormatted(radiology.orderDate), date: radiology.orderDate//projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(radiology.orderDate):DateUtil.getMonthDayYearDateFormatted(radiology.orderDate),
), ),
); );
}).toList(), }).toList(),

@ -52,6 +52,14 @@ class DateUtil {
return start + "$milliseconds" + end; return start + "$milliseconds" + end;
} }
static String formatDateToDate(DateTime date) {
return DateFormat('dd MMM yyy').format(date);
}
static String formatDateToTime(DateTime date) {
return DateFormat('kk:mm a').format(date);
}
static String yearMonthDay(DateTime dateTime) { static String yearMonthDay(DateTime dateTime) {
String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}'; String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}';
return dateFormat; return dateFormat;

@ -48,6 +48,10 @@ class TranslationBase {
String get clinic => localizedValues['clinic'][locale.languageCode]; String get clinic => localizedValues['clinic'][locale.languageCode];
String get byClinic => localizedValues['by-clinic'][locale.languageCode];
String get byHospital => localizedValues['by-hospital'][locale.languageCode];
String get name => localizedValues['name'][locale.languageCode]; String get name => localizedValues['name'][locale.languageCode];
String get doctor => localizedValues['doctor'][locale.languageCode]; String get doctor => localizedValues['doctor'][locale.languageCode];

@ -58,19 +58,19 @@ class LargeAvatar extends StatelessWidget {
onTap: disableProfileView ? null : onTap, onTap: disableProfileView ? null : onTap,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( // gradient: LinearGradient(
begin: Alignment(-1, -1), // begin: Alignment(-1, -1),
end: Alignment(1, 1), // end: Alignment(1, 1),
colors: [ // colors: [
Colors.grey[100], // Colors.grey[100],
Colors.grey[800], // Colors.grey[800],
]), // ]),
boxShadow: [ // boxShadow: [
BoxShadow( // BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.08), // color: Color.fromRGBO(0, 0, 0, 0.08),
offset: Offset(0.0, 5.0), // offset: Offset(0.0, 5.0),
blurRadius: 16.0) // blurRadius: 16.0)
], // ],
borderRadius: BorderRadius.all(Radius.circular(radius)), borderRadius: BorderRadius.all(Radius.circular(radius)),
), ),
width: width, width: width,

@ -1,29 +1,31 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class DefaultButton extends StatelessWidget { class DefaultButton extends StatelessWidget {
final String text; final String text;
final Function onPress; final Function onPress;
final Color textColor; final Color textColor;
final Color color; final Color color;
PermissionService permission = new PermissionService(); DefaultButton(this.text, this.onPress, {this.color, this.textColor = Colors.white});
DefaultButton(this.text, this.onPress, {this.color, this.textColor});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return SizedBox(
height: 60, height: 43,
child: RaisedButton( width: double.infinity,
shape: child: FlatButton(
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), onPressed: () {
color: color != null ? color : Colors.grey[900], onPress();
textColor: color != null ? textColor : Colors.white, },
child: Text( child: Text(
this.text, text,
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48),
),
// color: Color(0xffD02127),
color: color ?? const Color(0xffD02127),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
), ),
onPressed: () =>{ this.onPress(), })); );
} }
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -13,7 +14,7 @@ class DoctorCard extends StatelessWidget {
final String name; final String name;
final String subName; final String subName;
final double rat; final double rat;
final String date; final DateTime date;
final String profileUrl; final String profileUrl;
final String billNo; final String billNo;
final Function onTap; final Function onTap;
@ -21,46 +22,40 @@ class DoctorCard extends StatelessWidget {
final bool isInOutPatient; final bool isInOutPatient;
final bool isLiveCareAppointment; final bool isLiveCareAppointment;
DoctorCard( DoctorCard({this.name, this.subName, this.rat, this.date, this.profileUrl, this.billNo, this.onTap, this.onEmailTap, this.isInOutPatient, this.isLiveCareAppointment = false});
{this.name,
this.subName,
this.rat,
this.date,
this.profileUrl,
this.billNo,
this.onTap,
this.onEmailTap,
this.isInOutPatient,
this.isLiveCareAppointment = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.all(10), height: 108,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Theme.of(context).primaryColor,
),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(8.0), Radius.circular(10.0),
), ),
boxShadow: [
BoxShadow(
color: Color(0x0000000D),
//spreadRadius: 5,
blurRadius: 27,
offset: Offset(0, -3),
),
],
color: Colors.white), color: Colors.white),
child: InkWell( child: InkWell(
onTap: onTap, onTap: onTap,
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min,
children: <Widget>[
Row(
children: <Widget>[ children: <Widget>[
Container( Container(
width: projectViewModel.isArabic ? 27 : 20, width: 16, // projectViewModel.isArabic ? 27 : 20,
height: date == null height: double.infinity,
? projectViewModel.isArabic alignment: Alignment.center,
? 185 // height: date == null
: 100 // ? projectViewModel.isArabic
: 180, // ? 185
// : 100
// : 180,
decoration: BoxDecoration( decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545) //Colors.red[900] Color(0xff404545)
color: isLiveCareAppointment color: isLiveCareAppointment
@ -69,86 +64,76 @@ class DoctorCard extends StatelessWidget {
? Colors.red[900] ? Colors.red[900]
: Theme.of(context).primaryColor, : Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10),
? Radius.circular(0) bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10),
: Radius.circular(8), topRight: projectViewModel.isArabic ? Radius.circular(10) : Radius.circular(0),
bottomLeft: projectViewModel.isArabic bottomRight: projectViewModel.isArabic ? Radius.circular(10) : Radius.circular(0),
? Radius.circular(0)
: Radius.circular(8),
topRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
), ),
), ),
child: RotatedBox( child: RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Center(
child: Text( child: Text(
isLiveCareAppointment isLiveCareAppointment
? TranslationBase.of(context) ? TranslationBase.of(context).liveCare.toUpperCase()
.liveCare
.toUpperCase()
: !isInOutPatient : !isInOutPatient
? TranslationBase.of(context) ? TranslationBase.of(context).inPatient.toUpperCase()
.inPatient : TranslationBase.of(context).outpatient.toUpperCase(),
.toUpperCase() style: TextStyle(fontSize: 10, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4, height: 16 / 10),
: TranslationBase.of(context) ),
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white),
), ),
)),
), ),
Expanded( Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Padding( Row(
padding: const EdgeInsets.all(10.0), mainAxisSize: MainAxisSize.min,
child: Row( children: [
children: <Widget>[
Expanded( Expanded(
flex: 1, child: Text(
child: LargeAvatar( TranslationBase.of(context).dr + " " + name,
name: name, style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
url: profileUrl,
), ),
), ),
Expanded( Column(
flex: 4, mainAxisSize: MainAxisSize.min,
child: Container( crossAxisAlignment: CrossAxisAlignment.end,
margin: EdgeInsets.all(10), children: [
child: Column( Text(
crossAxisAlignment: CrossAxisAlignment.start, DateUtil.formatDateToDate(date),
children: <Widget>[ style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
Texts(
TranslationBase.of(context).dr +
" " +
name,
bold: true,
), ),
Texts( Text(
subName, DateUtil.formatDateToTime(date),
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48, height: 18 / 12),
), ),
if (billNo != null) ],
Row(
children: <Widget>[
Texts(
'${TranslationBase.of(context).billNo}: ',
),
Texts(
billNo,
) )
], ],
), ),
if (rat != null) Row(
StarRating( mainAxisSize: MainAxisSize.min,
totalAverage: rat, forceStars: true), children: <Widget>[
], LargeAvatar(
name: name,
url: profileUrl,
width: 48,
height: 48,
), ),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
myRichText(TranslationBase.of(context).clinic + ":", subName),
myRichText(TranslationBase.of(context).billNo, billNo ?? ""),
//if (rat != null) StarRating(totalAverage: rat, forceStars: true),
],
), ),
), ),
if (onEmailTap != null && projectViewModel.havePrivilege(17)) if (onEmailTap != null && projectViewModel.havePrivilege(17))
@ -161,37 +146,27 @@ class DoctorCard extends StatelessWidget {
), ),
], ],
), ),
),
if (date != null)
Divider(
height: 8,
color: Colors.grey[400],
),
if (date != null)
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/images/Icon-awesome-calendar.png',
width: 30,
height: 30,
),
Expanded(
child: Texts(
date,
variant: 'bodyText',
),
)
],
)
], ],
), ),
)
],
), ),
)
], ],
), ),
), ),
); );
} }
Widget myRichText(String title, String value) {
return RichText(
text: TextSpan(
text: title,
style: TextStyle(fontSize: 10, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 18 / 10),
children: <TextSpan>[
TextSpan(
text: " $value",
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
)
]),
);
}
} }

@ -18,18 +18,12 @@ class AppExpandableNotifier extends StatefulWidget {
final bool isExpand; final bool isExpand;
bool expandFlag = false; bool expandFlag = false;
var controller = new ExpandableController(); var controller = new ExpandableController();
AppExpandableNotifier( AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false});
{this.headerWidget,
this.bodyWidget,
this.title,
this.collapsed,
this.isExpand = false});
_AppExpandableNotifier createState() => _AppExpandableNotifier(); _AppExpandableNotifier createState() => _AppExpandableNotifier();
} }
class _AppExpandableNotifier extends State<AppExpandableNotifier> { class _AppExpandableNotifier extends State<AppExpandableNotifier> {
@override @override
void initState() { void initState() {
setState(() { setState(() {
@ -43,12 +37,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ExpandableNotifier( return ExpandableNotifier(
child: Padding(
padding: const EdgeInsets.only(left: 10, right: 10, top: 4),
child: Card(
clipBehavior: Clip.antiAlias,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
@ -63,9 +52,7 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
headerAlignment: ExpandablePanelHeaderAlignment.center, headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true, tapBodyToCollapse: true,
), ),
header: Row( header: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded( Expanded(
child: Padding( child: Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -79,22 +66,10 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
), ),
), ),
IconButton( IconButton(
icon: new Container( icon: Icon(
height: 28.0, widget.expandFlag ? Icons.remove : Icons.add,
width: 30.0, color: Color(0xff2E303A),
decoration: new BoxDecoration( // size: 30.0,
color: secondaryColor,
shape: BoxShape.circle,
),
child: new Center(
child: new Icon(
widget.expandFlag
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.white,
size: 30.0,
),
),
), ),
onPressed: () { onPressed: () {
setState(() { setState(() {
@ -106,22 +81,17 @@ class _AppExpandableNotifier extends State<AppExpandableNotifier> {
collapsed: widget.collapsed ?? Container(), collapsed: widget.collapsed ?? Container(),
expanded: widget.bodyWidget, expanded: widget.bodyWidget,
builder: (_, collapsed, expanded) { builder: (_, collapsed, expanded) {
return Padding( return Expandable(
padding: EdgeInsets.only(left: 5, right: 5, bottom: 5),
child: Expandable(
controller: widget.controller, controller: widget.controller,
collapsed: collapsed, collapsed: collapsed,
expanded: expanded, expanded: expanded,
theme: const ExpandableThemeData(crossFadePoint: 0), theme: const ExpandableThemeData(crossFadePoint: 0),
),
); );
}, },
), ),
), ),
], ],
), ),
),
),
); );
} }
} }

@ -161,7 +161,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppBar( return AppBar(
elevation: 0, elevation: 0,
backgroundColor: Colors.transparent, backgroundColor: showTitle ? Colors.white : Colors.transparent,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
title: Row( title: Row(
children: [ children: [

Loading…
Cancel
Save