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.
doctor_app_flutter/lib/widgets/patients/patient-referral-item-widge...

305 lines
13 KiB
Dart

import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
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:provider/provider.dart';
class PatientReferralItemWidget extends StatelessWidget {
4 years ago
final String? referralStatus;
final int? referralStatusCode;
final String? patientName;
final int? patientGender;
final String? referredDate;
final String? referredTime;
final String? patientID;
final isSameBranch;
4 years ago
final bool? isReferral;
final bool? isReferralClinic;
final String? referralClinic;
final String? remark;
final String? nationality;
final String? nationalityFlag;
final String? doctorAvatar;
final String? referralDoctorName;
final String? clinicDescription;
final Widget? infoIcon;
PatientReferralItemWidget(
{this.referralStatus,
this.referralStatusCode,
this.patientName,
this.patientGender,
this.referredDate,
this.referredTime,
this.patientID,
this.isSameBranch,
this.isReferral,
this.remark,
this.nationality,
this.nationalityFlag,
this.doctorAvatar,
this.referralDoctorName,
this.clinicDescription,
this.infoIcon,
this.isReferralClinic = false,
this.referralClinic});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
4 years ago
margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0),
child: Column(
children: [
Container(
child: CardWithBgWidget(
bgColor: referralStatusCode == 1
? Color(0xffc4aa54)
4 years ago
: referralStatusCode == 2
? AppGlobal.appGreenColor
4 years ago
: referralStatusCode == 46
? AppGlobal.appGreenColor
4 years ago
: referralStatusCode == 4
4 years ago
? Colors.red[700]!
: Colors.red[900]!,
hasBorder: false,
widget: Container(
// padding: EdgeInsets.only(left: 20, right: 0, bottom: 0),
child: InkWell(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
4 years ago
referralStatus != null ? referralStatus! : "",
fontFamily: 'Poppins',
fontSize: 10.0,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
color: referralStatusCode == 1
? Color(0xffc4aa54)
4 years ago
: referralStatusCode == 2
? AppGlobal.appGreenColor
4 years ago
: referralStatusCode == 46
? AppGlobal.appGreenColor
4 years ago
: referralStatusCode == 4
4 years ago
? Colors.red[700]!
: Colors.red[900]!,
),
AppText(
4 years ago
referredDate!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
fontSize: 12.0,
color: Color(0XFF28353E),
)
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: AppText(
4 years ago
patientName!,
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
fontFamily: 'Poppins',
letterSpacing: -0.64,
),
),
SizedBox(
width: 0,
),
patientGender == 1
? Icon(
DoctorApp.male_2,
color: Colors.blue,
)
: Icon(DoctorApp.female_1,
color: Color(0xffF0448D)),
SizedBox(
width: 4,
),
AppText(
4 years ago
referredTime!,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 12.0,
color: Color(0XFF575757),
letterSpacing: 0.48,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
CustomRow(
label:
4 years ago
TranslationBase.of(context).fileNumber!,
value: patientID!,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
5 years ago
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomRow(
label: isSameBranch
4 years ago
? TranslationBase.of(context)
4 years ago
.referredFrom!
: TranslationBase.of(context).refClinic!,
value: !isReferralClinic!
? isSameBranch
? TranslationBase.of(context)
4 years ago
.sameBranch!
: TranslationBase.of(context)
4 years ago
.otherBranch!
: " " + referralClinic!,
),
],
),
],
),
),
Row(
children: [
AppText(
4 years ago
nationality != null ? nationality! : "",
fontWeight: FontWeight.w600,
color: Color(0xFF2E303A),
fontSize: 10.0,
letterSpacing: -0.4,
),
nationalityFlag != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
4 years ago
nationalityFlag!,
height: 25,
width: 30,
4 years ago
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
4 years ago
return Text('');
},
))
: SizedBox()
],
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CustomRow(
4 years ago
label: TranslationBase.of(context).remarks! + " : ",
value: remark ?? "",
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset(
4 years ago
isReferral!
? 'assets/images/patient/ic_ref_arrow_up.png'
: 'assets/images/patient/ic_ref_arrow_left.png',
height: 50,
width: 30,
),
),
Container(
margin: EdgeInsets.only(
left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: Container(
width: 40,
height: 40,
child: doctorAvatar != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
4 years ago
doctorAvatar!,
height: 25,
width: 30,
4 years ago
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image');
},
))
: Container(
child: Image.asset(
patientGender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10, top: 25, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
referralDoctorName ?? "",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 14.0,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
if (clinicDescription != null)
AppText(
4 years ago
clinicDescription??"",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 10.0,
color: Color(0xff575757),
letterSpacing: -0.4,
),
],
),
),
),
],
),
Container(
width: double.infinity,
alignment: Alignment.centerRight,
child: infoIcon ?? Container())
],
),
// onTap: onTap,
)),
),
),
],
),
);
}
}