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.
264 lines
11 KiB
Dart
264 lines
11 KiB
Dart
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
class ProcedureCard extends StatelessWidget {
|
|
final Function onTap;
|
|
final EntityList entityList;
|
|
final String categoryName;
|
|
final int categoryID;
|
|
|
|
const ProcedureCard(
|
|
{Key key,
|
|
this.onTap,
|
|
this.entityList,
|
|
this.categoryID,
|
|
this.categoryName})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
return Container(
|
|
width: double.maxFinite,
|
|
//height: MediaQuery.of(context).size.height * .22,
|
|
margin: EdgeInsets.all(10),
|
|
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(15),
|
|
color: Colors.white,
|
|
),
|
|
child: Container(
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
height: MediaQuery.of(context).size.height * .20,
|
|
width: 5,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.only(
|
|
topLeft: Radius.circular(10),
|
|
bottomLeft: Radius.circular(10),
|
|
),
|
|
color:
|
|
entityList.orderType == 1 ? Colors.red[500] : Colors.black,
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Container(
|
|
padding: EdgeInsets.only(
|
|
left: projectViewModel.isArabic ? 0 : 15,
|
|
right: projectViewModel.isArabic ? 15 : 0),
|
|
child: InkWell(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Texts(
|
|
entityList.orderType == 0
|
|
? 'Routine'
|
|
: 'Urgent',
|
|
color: entityList.orderType == 0
|
|
? Colors.black
|
|
: Colors.red[800],
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
SizedBox(
|
|
height: 5,
|
|
),
|
|
Texts(
|
|
entityList.procedureName,
|
|
fontWeight: FontWeight.w700,
|
|
fontSize: 14,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
SizedBox(
|
|
width: 5,
|
|
),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: [
|
|
Texts(
|
|
'${DateUtils.getDayMonthYearDateFormatted(DateUtils.convertISOStringToDateTime(entityList.orderDate), isArabic: projectViewModel.isArabic)}',
|
|
color: Colors.black,
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 14,
|
|
),
|
|
Texts(
|
|
'${DateUtils.getHour(DateUtils.convertISOStringToDateTime(entityList.orderDate))}',
|
|
fontWeight: FontWeight.w600,
|
|
color: Colors.grey[700],
|
|
fontSize: 14,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Texts(
|
|
TranslationBase.of(context).orderNo,
|
|
//color: Colors.grey,
|
|
fontSize: 12,
|
|
color: Colors.grey,
|
|
),
|
|
Texts(
|
|
entityList.orderNo.toString(),
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
],
|
|
),
|
|
// Row(
|
|
// children: [
|
|
// Texts(
|
|
// TranslationBase.of(context).doctorName + ": ",
|
|
// //color: Colors.grey,
|
|
// fontSize: 12,
|
|
// color: Colors.grey,
|
|
// ),
|
|
// Texts(
|
|
// entityList.doctorName.toString(),
|
|
// fontSize: 12,
|
|
// bold: true,
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// Row(
|
|
// children: [
|
|
// Texts(
|
|
// TranslationBase.of(context).clinic + ": ",
|
|
// //color: Colors.grey,
|
|
// fontSize: 12,
|
|
// color: Colors.grey,
|
|
// ),
|
|
// Texts(
|
|
// entityList.clinicDescription.toString(),
|
|
// bold: true,
|
|
// fontSize: 12,
|
|
// ),
|
|
// ],
|
|
// ),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Expanded(
|
|
child: Texts(
|
|
entityList.remarks.toString() ?? '----',
|
|
fontSize: 12,
|
|
),
|
|
),
|
|
if (entityList.categoryID == 2 ||
|
|
entityList.categoryID == 4)
|
|
InkWell(
|
|
child: Icon(Icons.edit),
|
|
onTap: onTap,
|
|
)
|
|
],
|
|
),
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
width: 30,
|
|
height: 30,
|
|
margin: EdgeInsets.only(
|
|
left:
|
|
projectViewModel.isArabic ? 5 : 5 /*10:85*/,
|
|
right:
|
|
projectViewModel.isArabic ? 5 : 5 /*85:10*/,
|
|
top: 5),
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.rectangle,
|
|
border: Border(
|
|
bottom: BorderSide(
|
|
color: Colors.grey[400], width: 2.5),
|
|
left: BorderSide(
|
|
color: Colors.grey[400], width: 2.5),
|
|
)),
|
|
),
|
|
Expanded(
|
|
flex: 4,
|
|
child: Container(
|
|
margin: EdgeInsets.only(
|
|
left: 5, top: 25, right: 10, bottom: 0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
RichText(
|
|
text: TextSpan(
|
|
style: TextStyle(
|
|
fontSize:
|
|
2.0 * SizeConfig.textMultiplier,
|
|
color: Colors.black),
|
|
children: <TextSpan>[
|
|
TextSpan(
|
|
text: "Dr.".toString(),
|
|
style: TextStyle(
|
|
fontSize: 13,
|
|
fontFamily: 'Poppins')),
|
|
TextSpan(
|
|
text: entityList.doctorName,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontFamily: 'Poppins',
|
|
fontSize: 14)),
|
|
],
|
|
),
|
|
),
|
|
RichText(
|
|
text: TextSpan(
|
|
style: TextStyle(
|
|
fontSize:
|
|
2.0 * SizeConfig.textMultiplier,
|
|
color: Colors.black),
|
|
children: <TextSpan>[
|
|
TextSpan(
|
|
text: TranslationBase.of(context)
|
|
.clinic,
|
|
style: TextStyle(
|
|
fontSize: 13,
|
|
fontFamily: 'Poppins')),
|
|
TextSpan(
|
|
text: entityList.clinicDescription,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w700,
|
|
fontFamily: 'Poppins',
|
|
fontSize: 14)),
|
|
],
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
//onTap: onTap,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|