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