Finish prescription refactoring
parent
34f658a166
commit
cdc0d2f4a9
@ -1,19 +1,19 @@
|
|||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
|
||||||
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
|
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
|
||||||
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../../core/enum/viewstate.dart';
|
|
||||||
import '../../../core/model/Prescriptions/prescription_model.dart';
|
|
||||||
import '../../../core/model/patient/patiant_info_model.dart';
|
|
||||||
import '../../../core/model/search_drug/get_medication_response_model.dart';
|
|
||||||
import '../../../core/viewModel/prescription_view_model.dart';
|
|
||||||
import '../../../util/dr_app_toast_msg.dart';
|
|
||||||
import '../../../util/helpers.dart';
|
|
||||||
import '../../patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
|
|
||||||
import 'drug_to_drug.dart';
|
import 'drug_to_drug.dart';
|
||||||
|
|
||||||
class AddDrugWidget extends StatefulWidget {
|
class AddDrugWidget extends StatefulWidget {
|
||||||
@ -1,196 +0,0 @@
|
|||||||
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/widgets/shared/app_texts_widget.dart';
|
|
||||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
class InPatientDoctorCard extends StatelessWidget {
|
|
||||||
final String doctorName;
|
|
||||||
final String branch;
|
|
||||||
final DateTime appointmentDate;
|
|
||||||
final String profileUrl;
|
|
||||||
final String invoiceNO;
|
|
||||||
final String orderNo;
|
|
||||||
final Function onTap;
|
|
||||||
final bool isPrescriptions;
|
|
||||||
final String clinic;
|
|
||||||
final createdBy;
|
|
||||||
|
|
||||||
InPatientDoctorCard(
|
|
||||||
{this.doctorName,
|
|
||||||
this.branch,
|
|
||||||
this.profileUrl,
|
|
||||||
this.invoiceNO,
|
|
||||||
this.onTap,
|
|
||||||
this.appointmentDate,
|
|
||||||
this.orderNo,
|
|
||||||
this.isPrescriptions = false,
|
|
||||||
this.clinic,
|
|
||||||
this.createdBy});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
ProjectViewModel projectViewModel = Provider.of(context);
|
|
||||||
return Container(
|
|
||||||
margin: EdgeInsets.all(10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
width: 0.5,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(15.0),
|
|
||||||
),
|
|
||||||
color: Colors.white),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(15.0),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: onTap,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: AppText(
|
|
||||||
doctorName,
|
|
||||||
bold: true,
|
|
||||||
)),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
AppText(
|
|
||||||
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
fontSize: 14,
|
|
||||||
),
|
|
||||||
if (!isPrescriptions)
|
|
||||||
AppText(
|
|
||||||
'${AppDateUtils.getHour(appointmentDate)}',
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
color: Colors.grey[700],
|
|
||||||
fontSize: 14,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
AppText(
|
|
||||||
'CreatedBy ',
|
|
||||||
//bold: true,
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: AppText(
|
|
||||||
createdBy,
|
|
||||||
bold: true,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
// Container(
|
|
||||||
// child: LargeAvatar(
|
|
||||||
// name: doctorName,
|
|
||||||
// url: profileUrl,
|
|
||||||
// ),
|
|
||||||
// width: 55,
|
|
||||||
// height: 55,
|
|
||||||
// ),
|
|
||||||
Expanded(
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
margin: EdgeInsets.all(10),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
// if (orderNo != null && !isPrescriptions)
|
|
||||||
// Row(
|
|
||||||
// children: <Widget>[
|
|
||||||
// AppText(
|
|
||||||
// TranslationBase.of(context).orderNo +
|
|
||||||
// ": ",
|
|
||||||
// color: Colors.grey[500],
|
|
||||||
// fontSize: 14,
|
|
||||||
// ),
|
|
||||||
// AppText(
|
|
||||||
// orderNo ?? '',
|
|
||||||
// fontSize: 14,
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// if (invoiceNO != null && !isPrescriptions)
|
|
||||||
// Row(
|
|
||||||
// children: <Widget>[
|
|
||||||
// AppText(
|
|
||||||
// TranslationBase.of(context)
|
|
||||||
// .invoiceNo +
|
|
||||||
// ": ",
|
|
||||||
// fontSize: 14,
|
|
||||||
// color: Colors.grey[500],
|
|
||||||
// ),
|
|
||||||
// AppText(
|
|
||||||
// invoiceNO,
|
|
||||||
// fontSize: 14,
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// if (clinic != null)
|
|
||||||
// Row(
|
|
||||||
// children: <Widget>[
|
|
||||||
// AppText(
|
|
||||||
// TranslationBase.of(context).clinic +
|
|
||||||
// ": ",
|
|
||||||
// color: Colors.grey[500],
|
|
||||||
// fontSize: 14,
|
|
||||||
// ),
|
|
||||||
// AppText(
|
|
||||||
// clinic,
|
|
||||||
// fontSize: 14,
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// if (branch != null)
|
|
||||||
// Row(
|
|
||||||
// children: <Widget>[
|
|
||||||
// AppText(
|
|
||||||
// TranslationBase.of(context).branch +
|
|
||||||
// ": ",
|
|
||||||
// fontSize: 14,
|
|
||||||
// color: Colors.grey[500],
|
|
||||||
// ),
|
|
||||||
// AppText(
|
|
||||||
// branch,
|
|
||||||
// fontSize: 14,
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Icon(
|
|
||||||
EvaIcons.eye,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue