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.
hmg_nurses/lib/ui/patient/widgets/patient_profile_header.dart

74 lines
2.8 KiB
Dart

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:hmg_nurses/classes/date-utils.dart';
import 'package:hmg_nurses/extensions/int_extensions.dart';
import 'package:hmg_nurses/extensions/string_extensions.dart';
import 'package:hmg_nurses/model/patient/patient_file_information_prm_list.dart';
import 'package:hmg_nurses/widgets/circular_avatar.dart';
import 'package:hmg_nurses/widgets/commen/cusom_row.dart';
class PatientProfileHeader extends StatelessWidget {
GetPatientFileInformationPrmList patientProfile;
PatientProfileHeader(this.patientProfile);
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
color: Colors.white,
padding: const EdgeInsets.only(top: 12, right: 21, left: 21, bottom: 21),
child: Row(
children: [
Expanded(
child: Row(
children: [
showGenderAvator(patientProfile.gender ?? 1),
12.width,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(patientProfile.patientStatusType != null && patientProfile.patientStatusType == 43)
? "Arrived P".toText10(isBold: true)
: "Not Arrived".toText10(isBold: true, color: Colors.red[800]),
CustomRow(
label: "File Number:",
value: patientProfile.patientId.toString(),
),
CustomRow(
label: "Age : ",
value: AppDateUtils.getAgeByBirthday(patientProfile.dateofBirth ?? "", context, isServerFormat: true),
),
],
)
],
),
),
if (patientProfile.nationalityId != null)
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
(patientProfile.nationalityId ?? "").toTextAuto(
fontSize: 9,
color: const Color(0xFF2E303A),
textOverflow: TextOverflow.ellipsis,
),
if (patientProfile.nationalityFlagUrl != null && patientProfile.nationalityFlagUrl!.isNotEmpty)
ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: CachedNetworkImage(
imageUrl: patientProfile.nationalityFlagUrl ?? "",
height: 16,
width: 22,
errorWidget: (context, url, error) => "No Image".toText10(),
),
)
],
),
],
),
);
}
}