Merge branch 'in-patient-medication' into 'development'

In patient medication

See merge request Cloud_Solution/doctor_app_flutter!830
merge-requests/829/merge
Mohammad Aljammal 5 years ago
commit 02109a40e1

@ -9,6 +9,7 @@ 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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'ShowTimer.dart'; import 'ShowTimer.dart';
@ -81,8 +82,7 @@ class PatientCard extends StatelessWidget {
? Row( ? Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).arrivedP,
.arrivedP,
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -102,12 +102,8 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
AppText( AppText(
patientInfo.status == 2 patientInfo.status == 2 ? 'Confirmed' : 'Booked',
? 'Confirmed' color: patientInfo.status == 2 ? Colors.green : Colors.grey,
: 'Booked',
color: patientInfo.status == 2
? Colors.green
: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 10, fontSize: 10,
@ -118,8 +114,7 @@ class PatientCard extends StatelessWidget {
? Row( ? Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).notArrived,
.notArrived,
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -139,27 +134,19 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
AppText( AppText(
patientInfo.status == 2 patientInfo.status == 2 ? 'Confirmed' : 'Booked',
? 'Confirmed' color: patientInfo.status == 2 ? Colors.green : Colors.grey,
: 'Booked',
color: patientInfo.status == 2
? Colors.green
: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 10, fontSize: 10,
), ),
], ],
) )
: !isFromSearch && : !isFromSearch && !isFromLiveCare && patientInfo.patientStatusType == null
!isFromLiveCare &&
patientInfo.patientStatusType ==
null
? Row( ? Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context).notArrived,
.notArrived,
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -179,13 +166,8 @@ class PatientCard extends StatelessWidget {
width: 8, width: 8,
), ),
AppText( AppText(
patientInfo.status == 2 patientInfo.status == 2 ? 'Booked' : 'Confirmed',
? 'Booked' color: patientInfo.status == 2 ? Colors.grey : Colors.green,
: 'Confirmed',
color:
patientInfo.status == 2
? Colors.grey
: Colors.green,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
@ -195,17 +177,13 @@ class PatientCard extends StatelessWidget {
: 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,
) )
: patientInfo.arrivedOn != null : patientInfo.arrivedOn != null
? AppText( ? AppText(
AppDateUtils.getDayMonthYearDate( AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
AppDateUtils
.convertStringToDate(
patientInfo.arrivedOn, patientInfo.arrivedOn,
)) + )) +
" " + " " +
@ -214,10 +192,8 @@ class PatientCard extends StatelessWidget {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 15, fontSize: 15,
) )
: (patientInfo.appointmentDate != : (patientInfo.appointmentDate != null &&
null && patientInfo.appointmentDate.isNotEmpty)
patientInfo
.appointmentDate.isNotEmpty)
? AppText( ? AppText(
"${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(
patientInfo.appointmentDate, patientInfo.appointmentDate,
@ -256,13 +232,10 @@ class PatientCard extends StatelessWidget {
// width: MediaQuery.of(context).size.width*0.51, // width: MediaQuery.of(context).size.width*0.51,
child: AppText( child: AppText(
isFromLiveCare isFromLiveCare
? Helpers.capitalize( ? Helpers.capitalize(patientInfo.fullName)
patientInfo.fullName) : (Helpers.capitalize(patientInfo.firstName) +
: (Helpers.capitalize(
patientInfo.firstName) +
" " + " " +
Helpers.capitalize( Helpers.capitalize(patientInfo.lastName)),
patientInfo.lastName)),
fontSize: 16, fontSize: 16,
color: Color(0xff2e303a), color: Color(0xff2e303a),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -300,25 +273,19 @@ class PatientCard extends StatelessWidget {
fontSize: 14, fontSize: 14,
textOverflow: TextOverflow.ellipsis, textOverflow: TextOverflow.ellipsis,
), ),
patientInfo.nationality != null || patientInfo.nationality != null || patientInfo.nationalityId != null
patientInfo.nationalityId != null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(20.0),
BorderRadius.circular(20.0), child: CachedNetworkImage(
child: Image.network( imageUrl: patientInfo.nationalityFlagURL != null
patientInfo.nationalityFlagURL != null
? patientInfo.nationalityFlagURL ? patientInfo.nationalityFlagURL
: '', : '',
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorWidget: (context, url, error) => AppText(
Object exception, 'No Image',
StackTrace stackTrace) { fontSize: 10,
return AppText( ),
'No Image',
fontSize: 10,
);
},
)) ))
: SizedBox() : SizedBox()
], ],
@ -349,61 +316,55 @@ class PatientCard extends StatelessWidget {
), ),
Expanded( Expanded(
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
crossAxisAlignment: CrossAxisAlignment.start, CustomRow(
children: [ label: TranslationBase.of(context).fileNumber,
CustomRow( value: patientInfo.patientId.toString(),
label: TranslationBase.of(context).fileNumber, ),
value: patientInfo.patientId.toString(), CustomRow(
), label: TranslationBase.of(context).age + " : ",
CustomRow( value:
label: TranslationBase.of(context).age + " : ", "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}",
value: ),
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", if (isInpatient)
), CustomRow(
label: patientInfo.admissionDate == null
if (isInpatient) ? ""
CustomRow( : TranslationBase.of(context).admissionDate + " : ",
label: patientInfo.admissionDate == null value: patientInfo.admissionDate == null
? "" ? ""
: TranslationBase.of(context) : "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}",
.admissionDate + ),
" : ", if (patientInfo.admissionDate != null)
value: patientInfo.admissionDate == null CustomRow(
? "" label: TranslationBase.of(context).numOfDays + " : ",
: "${AppDateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", value:
), "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
if (patientInfo.admissionDate != null) ),
CustomRow( if (patientInfo.admissionDate != null)
label: TranslationBase.of(context).numOfDays + CustomRow(
" : ", label: TranslationBase.of(context).roomNo + " : ",
value: value: "${patientInfo.roomId}",
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", ),
), if (isFromLiveCare)
if (patientInfo.admissionDate != null) Column(
children: [
CustomRow( CustomRow(
label: label: TranslationBase.of(context).clinic + " : ",
TranslationBase.of(context).roomNo + " : ", value: patientInfo.clinicName,
value: "${patientInfo.roomId}",
),
if (isFromLiveCare)
Column(
children: [
CustomRow(
label: TranslationBase.of(context).clinic +
" : ",
value: patientInfo.clinicName,
),
],
), ),
]), ],
), ),
Icon(Icons.arrow_forward, size: 24,), ]),
], ),
)) Icon(
Icons.arrow_forward,
size: 24,
),
],
))
]), ]),
isFromLiveCare isFromLiveCare
? Row( ? Row(
@ -420,36 +381,29 @@ class PatientCard extends StatelessWidget {
], ],
) )
: !isInpatient && !isFromSearch : !isInpatient && !isFromSearch
? Row( ? Row(mainAxisAlignment: MainAxisAlignment.end, children: [
mainAxisAlignment: MainAxisAlignment.end, Container(
children: [ padding: EdgeInsets.all(4),
child: Image.asset(
patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100
? 'assets/images/livecare.png'
: patientInfo.appointmentType == 'Walkin'
? 'assets/images/walkin.png'
: 'assets/images/booked.png',
height: 25,
width: 35,
)),
])
: (isInpatient == true)
? Row(mainAxisAlignment: MainAxisAlignment.end, children: [
Container( Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
child: Image.asset( child: Image.asset(
patientInfo.appointmentType == 'assets/images/inpatient.png',
'Regular' &&
patientInfo.visitTypeId == 100
? 'assets/images/livecare.png'
: patientInfo.appointmentType ==
'Walkin'
? 'assets/images/walkin.png'
: 'assets/images/booked.png',
height: 25, height: 25,
width: 35, width: 35,
)), )),
]) ])
: (isInpatient == true)
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.all(4),
child: Image.asset(
'assets/images/inpatient.png',
height: 25,
width: 35,
)),
])
: SizedBox() : SizedBox()
], ],
), ),
@ -458,5 +412,3 @@ class PatientCard extends StatelessWidget {
)); ));
} }
} }

@ -1,13 +1,14 @@
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:cached_network_image/cached_network_image.dart';
class ProfileWelcomeWidget extends StatelessWidget { class ProfileWelcomeWidget extends StatelessWidget {
final Widget clinicWidget; final Widget clinicWidget;
final double height; final double height;
final bool isClinic; final bool isClinic;
ProfileWelcomeWidget(this.clinicWidget,
{this.height = 150, this.isClinic = false}); ProfileWelcomeWidget(this.clinicWidget, {this.height = 150, this.isClinic = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -27,24 +28,23 @@ class ProfileWelcomeWidget extends StatelessWidget {
SizedBox( SizedBox(
width: 20, width: 20,
), ),
if(authenticationViewModel.doctorProfile!=null) if (authenticationViewModel.doctorProfile != null)
CircleAvatar( CircleAvatar(
// radius: (52) // radius: (52)
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
child: Image.network( child: CachedNetworkImage(
authenticationViewModel.doctorProfile.doctorImageURL, imageUrl: authenticationViewModel.doctorProfile.doctorImageURL,
fit: BoxFit.fill, fit: BoxFit.fill,
width: 75, width: 75,
height: 75, height: 75,
),
), ),
backgroundColor: Colors.transparent,
), ),
backgroundColor: Colors.transparent,
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
], ],
)), )),
); );

@ -141,6 +141,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "7.1.0" version: "7.1.0"
cached_network_image:
dependency: "direct main"
description:
name: cached_network_image
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
@ -433,6 +440,20 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_blurhash:
dependency: transitive
description:
name: flutter_blurhash
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
flutter_cache_manager:
dependency: transitive
description:
name: flutter_cache_manager
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
flutter_device_type: flutter_device_type:
dependency: "direct main" dependency: "direct main"
description: description:
@ -595,6 +616,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.4" version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.19"
imei_plugin: imei_plugin:
dependency: "direct main" dependency: "direct main"
description: description:
@ -664,7 +692,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -693,6 +721,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
octo_image:
dependency: transitive
description:
name: octo_image
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
open_iconic_flutter: open_iconic_flutter:
dependency: transitive dependency: transitive
description: description:
@ -728,6 +763,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.4" version: "0.1.4"
path_provider:
dependency: transitive
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.28"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
@ -735,6 +777,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.1+2" version: "0.0.1+2"
path_provider_macos:
dependency: transitive
description:
name: path_provider_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+8"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -854,6 +903,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.5" version: "2.1.5"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.25.0"
scratch_space: scratch_space:
dependency: transitive dependency: transitive
description: description:
@ -950,13 +1006,27 @@ packages:
relative: true relative: true
source: path source: path
version: "0.0.0" version: "0.0.0"
sqflite:
dependency: transitive
description:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2+4"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3+3"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -985,6 +1055,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0-nullsafety.1" version: "1.1.0-nullsafety.1"
synchronized:
dependency: transitive
description:
name: synchronized
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0+2"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@ -1154,5 +1231,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.2 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.2 <2.0.0"

@ -96,6 +96,10 @@ dependencies:
# Html Editor Enhanced # Html Editor Enhanced
html_editor_enhanced: ^1.3.0 html_editor_enhanced: ^1.3.0
#Network Image
cached_network_image: ^2.5.0
# Badges # Badges
badges: ^1.1.4 badges: ^1.1.4

Loading…
Cancel
Save