|
|
|
@ -1,34 +1,36 @@
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.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/avatar/large_avatar.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class MedicalReports extends StatelessWidget {
|
|
|
|
class MedicalReports extends StatelessWidget {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
void confirmBox(
|
|
|
|
void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) {
|
|
|
|
AppointmentHistory model, ReportsViewModel reportsViewModel) {
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
child: ConfirmDialog(
|
|
|
|
child: ConfirmDialog(
|
|
|
|
appointmentHistory: model,
|
|
|
|
appointmentHistory: model,
|
|
|
|
onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model),
|
|
|
|
onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model,TranslationBase.of(context).successSendReport),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
return BaseView<ReportsViewModel>(
|
|
|
|
return BaseView<ReportsViewModel>(
|
|
|
|
onModelReady: (model) => model.getPatentAppointmentHistory(),
|
|
|
|
onModelReady: (model) => model.getPatentAppointmentHistory(),
|
|
|
|
builder: (_, model, widget) => AppScaffold(
|
|
|
|
builder: (_, model, widget) => AppScaffold(
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
appBarTitle: 'Medical Reports',
|
|
|
|
appBarTitle: TranslationBase.of(context).medReport,
|
|
|
|
body: ListView.builder(
|
|
|
|
body: ListView.builder(
|
|
|
|
itemCount: model.appointHistoryList.length,
|
|
|
|
itemCount: model.appointHistoryList.length,
|
|
|
|
itemBuilder: (context, index) => Padding(
|
|
|
|
itemBuilder: (context, index) => Padding(
|
|
|
|
@ -69,8 +71,7 @@ class MedicalReports extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(model.appointHistoryList[index].projectName),
|
|
|
|
Texts(model.appointHistoryList[index].projectName),
|
|
|
|
Texts(model.appointHistoryList[index].clinicName),
|
|
|
|
Texts(model.appointHistoryList[index].clinicName),
|
|
|
|
Texts(DateUtil.getMonthDayYearDateFormatted(
|
|
|
|
Texts(projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate):DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)),
|
|
|
|
model.appointHistoryList[index].appointmentDate)),
|
|
|
|
|
|
|
|
StarRating(
|
|
|
|
StarRating(
|
|
|
|
totalAverage: model
|
|
|
|
totalAverage: model
|
|
|
|
.appointHistoryList[index].actualDoctorRate
|
|
|
|
.appointHistoryList[index].actualDoctorRate
|
|
|
|
@ -89,7 +90,7 @@ class MedicalReports extends StatelessWidget {
|
|
|
|
onTap: () =>
|
|
|
|
onTap: () =>
|
|
|
|
confirmBox(model.appointHistoryList[index], model),
|
|
|
|
confirmBox(model.appointHistoryList[index], model),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
width: 80,
|
|
|
|
width: 85,
|
|
|
|
height: 50,
|
|
|
|
height: 50,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.black54,
|
|
|
|
color: Colors.black54,
|
|
|
|
@ -102,7 +103,7 @@ class MedicalReports extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
'Request',
|
|
|
|
TranslationBase.of(context).requestReport,
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -137,13 +138,13 @@ class _ConfirmDialogState extends State<ConfirmDialog> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return SimpleDialog(
|
|
|
|
return SimpleDialog(
|
|
|
|
title: Text('Confirm'),
|
|
|
|
title: Texts(TranslationBase.of(context).confirm),
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Texts('Request a medical report'),
|
|
|
|
Texts(TranslationBase.of(context).confirmMsgReport),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 5.0,
|
|
|
|
height: 5.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -166,7 +167,7 @@ class _ConfirmDialogState extends State<ConfirmDialog> {
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
'cancel',
|
|
|
|
TranslationBase.of(context).cancel,
|
|
|
|
color: Colors.red,
|
|
|
|
color: Colors.red,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -190,7 +191,7 @@ class _ConfirmDialogState extends State<ConfirmDialog> {
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
'ok',
|
|
|
|
TranslationBase.of(context).ok,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|