|
|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'
|
|
|
|
|
as DoctorListResponse;
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart' as DoctorListResponse;
|
|
|
|
|
import 'package:diplomaticquarterapp/models/MyInvoices/DentalInvoiceDetailResponse.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/my_invoices/invoice_detail_page.dart';
|
|
|
|
|
@ -10,6 +9,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
@ -30,11 +30,11 @@ class _MyInvoicesState extends State<MyInvoices> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/ar/0.png'));
|
|
|
|
|
imagesInfo
|
|
|
|
|
.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/ar/0.png'));
|
|
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
if(projectViewModel.isLogin)
|
|
|
|
|
getDentalAppointments();
|
|
|
|
|
if (projectViewModel.isLogin) getDentalAppointments();
|
|
|
|
|
});
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
@ -55,140 +55,25 @@ class _MyInvoicesState extends State<MyInvoices> {
|
|
|
|
|
child: isDataLoaded
|
|
|
|
|
? Column(
|
|
|
|
|
children: [
|
|
|
|
|
...List.generate(
|
|
|
|
|
getDentalAppointmentsResponse
|
|
|
|
|
.listDentalAppointments.length,
|
|
|
|
|
(index) => InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
openInvoiceDetailsPage(getDentalAppointmentsResponse
|
|
|
|
|
.listDentalAppointments[index]);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(Radius.circular(8.0)),
|
|
|
|
|
),
|
|
|
|
|
margin: EdgeInsets.all(10.0),
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
|
20.0, 10.0, 20.0, 10.0),
|
|
|
|
|
child: ClipRRect(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(100.0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
"assets/images/new-design/ViewDetailsIco.png",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
height: 60.0,
|
|
|
|
|
width: 60.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).appointmentNo + ": ",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: 0.5)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).appointmentDate + ": ",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: 0.5)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 10.0, bottom: 10.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).clinic + ": ",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
letterSpacing: 0.5)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
getDentalAppointmentsResponse
|
|
|
|
|
.listDentalAppointments[index]
|
|
|
|
|
.appointmentNo
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
letterSpacing: 0.5)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
DateUtil.getMonthDayYearDateFormatted(
|
|
|
|
|
DateUtil.convertStringToDate(
|
|
|
|
|
getDentalAppointmentsResponse
|
|
|
|
|
.listDentalAppointments[
|
|
|
|
|
index]
|
|
|
|
|
.appointmentDate)),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
letterSpacing: 0.5)),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: 10.0, bottom: 10.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
getDentalAppointmentsResponse
|
|
|
|
|
.listDentalAppointments[index]
|
|
|
|
|
.clinicName,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
letterSpacing: 0.5)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
projectViewModel.isArabic
|
|
|
|
|
? Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 15.0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
"assets/images/new-design/arrow_menu_black-ar.png",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
height: 20.0,
|
|
|
|
|
width: 12.0),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 15.0),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
"assets/images/new-design/arrow_menu_black-en.png",
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
height: 20.0,
|
|
|
|
|
width: 12.0),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return DoctorCard(
|
|
|
|
|
onTap: () => openInvoiceDetailsPage(getDentalAppointmentsResponse.listDentalAppointments[index]),
|
|
|
|
|
isInOutPatient: true,
|
|
|
|
|
name: TranslationBase.of(context).dr + " " + getDentalAppointmentsResponse.listDentalAppointments[index].doctorName,
|
|
|
|
|
billNo: getDentalAppointmentsResponse.listDentalAppointments[index].invoiceNo.toString(),
|
|
|
|
|
profileUrl: getDentalAppointmentsResponse.listDentalAppointments[index].doctorImageURL,
|
|
|
|
|
subName: getDentalAppointmentsResponse.listDentalAppointments[index].projectName,
|
|
|
|
|
isLiveCareAppointment: false,
|
|
|
|
|
date: DateUtil.convertStringToDate(getDentalAppointmentsResponse.listDentalAppointments[index].appointmentDate),
|
|
|
|
|
isSortByClinic: true,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemCount: getDentalAppointmentsResponse.listDentalAppointments.length,
|
|
|
|
|
separatorBuilder: (context, index) => SizedBox(height: 14),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
@ -216,17 +101,8 @@ class _MyInvoicesState extends State<MyInvoices> {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
setState(() {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
dentalInvoiceDetailResponse =
|
|
|
|
|
DentalInvoiceDetailResponse.fromJson(res);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: InvoiceDetail(
|
|
|
|
|
doctor,
|
|
|
|
|
listDentalAppointments,
|
|
|
|
|
dentalInvoiceDetailResponse,
|
|
|
|
|
context
|
|
|
|
|
)));
|
|
|
|
|
dentalInvoiceDetailResponse = DentalInvoiceDetailResponse.fromJson(res);
|
|
|
|
|
Navigator.push(context, FadePage(page: InvoiceDetail(doctor, listDentalAppointments, dentalInvoiceDetailResponse, context)));
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
@ -247,8 +123,7 @@ class _MyInvoicesState extends State<MyInvoices> {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
setState(() {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
getDentalAppointmentsResponse =
|
|
|
|
|
GetDentalAppointmentsResponse.fromJson(res);
|
|
|
|
|
getDentalAppointmentsResponse = GetDentalAppointmentsResponse.fromJson(res);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
|