adding cashed network image

merge-requests/830/head
hussam al-habibeh 3 years ago
parent 763686fc76
commit ba275eaed4

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

@ -141,6 +141,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
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:
dependency: transitive
description:
@ -433,6 +440,20 @@ packages:
description: flutter
source: sdk
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:
dependency: "direct main"
description:
@ -595,6 +616,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.19"
imei_plugin:
dependency: "direct main"
description:
@ -664,7 +692,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0-nullsafety.4"
mime:
dependency: transitive
description:
@ -693,6 +721,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
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:
dependency: transitive
description:
@ -728,6 +763,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
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:
dependency: transitive
description:
@ -735,6 +777,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
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:
dependency: transitive
description:
@ -854,6 +903,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.5"
rxdart:
dependency: transitive
description:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.25.0"
scratch_space:
dependency: transitive
description:
@ -950,13 +1006,27 @@ packages:
relative: true
source: path
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:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0-nullsafety.2"
sticky_headers:
dependency: "direct main"
description:
@ -985,6 +1055,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
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:
dependency: transitive
description:
@ -1154,5 +1231,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0"
dart: ">=2.10.2 <=2.11.0-213.1.beta"
flutter: ">=1.22.2 <2.0.0"

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

Loading…
Cancel
Save