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/screens/patients/profile/referral/my-referral-inpatient-scree...

93 lines
4.5 KiB
Dart

import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import '../../../../routes.dart';
class MyReferralInPatientScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getMyReferralPatientService(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referPatient,
body: model.myReferralPatients.isEmpty
? Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(
TranslationBase.of(context).referralEmptyMsg,
color: Theme.of(context).errorColor,
),
)
],
),
)
: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(top: 70),
// color: Colors.white,
// height: MediaQuery.of(context).size.height,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// SizedBox(height: 50),
...List.generate(
model.myReferralPatients.length,
(index) => InkWell(
onTap: () {
//TODO build the nwe page
},
child: PatientReferralItemWidget(
referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context),
referralStatusCode: model.myReferralPatients[index].referralStatus,
patientName: model.myReferralPatients[index].patientName,
patientGender: model.myReferralPatients[index].gender,
referredDate: DateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate),
referredTime: DateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate),
patientID: "${model.myReferralPatients[index].patientID}",
isSameBranch: false,
isReferral: true,
isReferralClinic: true,
referralClinic:"${model.myReferralPatients[index].referringClinicDescription}",
remark: model.myReferralPatients[index].referringDoctorRemarks,
nationality: model.myReferralPatients[index].nationalityName,
nationalityFlag: model.myReferralPatients[index].nationalityFlagURL,
doctorAvatar: model.myReferralPatients[index].doctorImageURL,
referralDoctorName: model.myReferralPatients[index].referringDoctorName,
clinicDescription: model.myReferralPatients[index].referringClinicDescription,
infoIcon: Icon(FontAwesomeIcons.arrowRight,
size: 25, color: Colors.black),
),
),
),
],
),
),
),
),
);
}
}