You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
139 lines
5.9 KiB
Dart
139 lines
5.9 KiB
Dart
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.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/medical/doctor_card.dart';
|
|
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
import 'package:rating_bar/rating_bar.dart';
|
|
|
|
class DoctorHeader extends StatelessWidget {
|
|
final PatientLabOrders patientLabOrder;
|
|
final String invoiceNo;
|
|
final String email;
|
|
final VoidCallback onTap;
|
|
DoctorHeader({Key key, @required this.patientLabOrder, @required this.email, @required this.invoiceNo, @required this.onTap}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
color: Colors.white,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Padding(
|
|
padding: EdgeInsets.only(left: 21, right: 21, bottom: 21),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
LargeAvatar(
|
|
name: patientLabOrder.doctorName,
|
|
url: patientLabOrder.doctorImageURL,
|
|
width: 51,
|
|
height: 51,
|
|
),
|
|
SizedBox(width: 10),
|
|
Expanded(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
(patientLabOrder?.speciality?.toString()?.toLowerCase()?.capitalizeFirstofEach ?? ""),
|
|
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
|
|
),
|
|
myRichText(TranslationBase.of(context).invoiceNo + ":", invoiceNo),
|
|
myRichText(TranslationBase.of(context).branch, patientLabOrder.projectName),
|
|
],
|
|
),
|
|
),
|
|
Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: [
|
|
Text(
|
|
DateUtil.formatDateToDate(patientLabOrder.orderDate),
|
|
style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
|
|
),
|
|
Text(
|
|
DateUtil.formatDateToTime(patientLabOrder.orderDate),
|
|
style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 8.0),
|
|
child: Image.network(patientLabOrder.nationalityFlagURL, height: 16),
|
|
),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
SizedBox(width: 21),
|
|
RatingBar.readOnly(
|
|
initialRating: patientLabOrder.doctorRate + 0.0,
|
|
size: 15.0,
|
|
filledColor: Color(0XFFD02127),
|
|
emptyColor: Color(0XFFD02127),
|
|
isHalfAllowed: true,
|
|
halfFilledIcon: Icons.star_half,
|
|
filledIcon: Icons.star,
|
|
emptyIcon: Icons.star_border,
|
|
),
|
|
SizedBox(width: 6),
|
|
Text(
|
|
"${patientLabOrder.actualDoctorRate} ${TranslationBase.of(context).reviews}",
|
|
style: TextStyle(fontSize: 12, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
|
|
),
|
|
],
|
|
),
|
|
InkWell(
|
|
onTap: () {
|
|
showConfirmMessage(context, onTap, email);
|
|
},
|
|
child: Container(
|
|
padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15),
|
|
decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: BorderRadius.only(topLeft: Radius.circular(10))),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
// todo: 'change icon for send email'
|
|
SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 19.0),
|
|
SizedBox(width: 6),
|
|
Text(
|
|
TranslationBase.of(context).sendEmail,
|
|
style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 25 / 16),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
)
|
|
],
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) {
|
|
showDialog(
|
|
context: context,
|
|
child: ConfirmSendEmailDialog(
|
|
email: email,
|
|
onTapSendEmail: () {
|
|
onTap();
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|