Merge branch 'new_design_sikander' into development_new_design_2.0

merge-requests/390/head
Sikander Saleem 5 years ago
commit 1c020134e8

@ -12,30 +12,30 @@ class ContactUsPage extends StatefulWidget {
} }
class _ContactUsPageState extends State<ContactUsPage> { class _ContactUsPageState extends State<ContactUsPage> {
LocationUtils locationUtils; LocationUtils locationUtils;
@override @override
void initState() { void initState() {
locationUtils = locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
new LocationUtils(isShowConfirmDialog: true, context: context); WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
WidgetsBinding.instance
.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).hMGServiceLabel, appBarTitle: TranslationBase.of(context).hMGServiceLabel,
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8),
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -46,16 +46,10 @@ class _ContactUsPageState extends State<ContactUsPage> {
text: TranslationBase.of(context).findUs, text: TranslationBase.of(context).findUs,
subText: "", subText: "",
type: 0, type: 0,
), ),
), ),
Expanded( Expanded(
child: CardCommonContact( child: CardCommonContact(image: 'assets/images/new-design/feedback_icon.png', text: TranslationBase.of(context).feedback, subText: "", type: 1),
image: 'assets/images/new-design/feedback_icon.png',
text: TranslationBase.of(context).feedback,
subText: "",
type: 1),
), ),
], ],
), ),
@ -69,12 +63,10 @@ class _ContactUsPageState extends State<ContactUsPage> {
text: TranslationBase.of(context).liveChat, text: TranslationBase.of(context).liveChat,
subText: TranslationBase.of(context).service, subText: TranslationBase.of(context).service,
type: 2, type: 2,
), ),
), ),
Expanded( Expanded(
child: Container(), child: Container(),
), ),
], ],
), ),
@ -84,4 +76,3 @@ class _ContactUsPageState extends State<ContactUsPage> {
); );
} }
} }

@ -268,7 +268,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
list.add( list.add(
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).bookNow, TranslationBase.of(context).reviewAppointment,
DocAvailableAppointments.areSlotsAvailable ? goToBookConfirm : null, DocAvailableAppointments.areSlotsAvailable ? goToBookConfirm : null,
color: Color(0xFFD02127), color: Color(0xFFD02127),
disabledColor: Color(0xff28323A).withOpacity(0.3), disabledColor: Color(0xff28323A).withOpacity(0.3),

@ -323,7 +323,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(
TranslationBase.of(context).noBookedAppo, _currentPage == 0 ? TranslationBase.of(context).noBookedAppo : (_currentPage == 1 ? TranslationBase.of(context).noConfirmedAppo : TranslationBase.of(context).noArrivedAppo),
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
), ),
@ -362,12 +362,14 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
return DoctorCard( return DoctorCard(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(
page: AppointmentDetails( page: AppointmentDetails(
appo: _appointmentResult, appo: _appointmentResult,
parentIndex: _currentPage, parentIndex: _currentPage,
))).then((value) { ),
),
).then((value) {
getPatientAppointmentHistory(); getPatientAppointmentHistory();
}), }),
isInOutPatient: _appointmentResult.isInOutPatient, isInOutPatient: _appointmentResult.isInOutPatient,
@ -410,35 +412,42 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} }
Widget myRadioButton(String _label, int _value) { Widget myRadioButton(String _label, int _value) {
return Row( return InkWell(
mainAxisSize: MainAxisSize.min, onTap: () {
children: [ setState(() {
SizedBox( _currentPage = _value;
width: 22, });
height: 22, },
child: Radio( child: Row(
value: _value, mainAxisSize: MainAxisSize.min,
activeColor: _value == _currentPage ? Color(0xffD02127) : Color(0xffE8E8E8), children: [
groupValue: _currentPage, SizedBox(
onChanged: (index) { width: 22,
setState(() { height: 22,
_currentPage = index; child: Radio(
}); value: _value,
//_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); activeColor: _value == _currentPage ? Color(0xffD02127) : Color(0xffE8E8E8),
}, groupValue: _currentPage,
onChanged: (index) {
setState(() {
_currentPage = index;
});
//_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut);
},
),
), ),
), SizedBox(width: 10),
SizedBox(width: 10), Text(
Text( _label,
_label, style: TextStyle(
style: TextStyle( fontSize: 14,
fontSize: 14, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600, color: Color(0xff575757),
color: Color(0xff575757), letterSpacing: -0.56,
letterSpacing: -0.56, ),
), ),
), ],
], ),
); );
} }
} }

@ -1,5 +1,6 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_h
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.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';
@ -19,10 +21,11 @@ class AskDoctorHomPage extends StatefulWidget {
_AskDoctorHomPageState createState() => _AskDoctorHomPageState(); _AskDoctorHomPageState createState() => _AskDoctorHomPageState();
} }
class _AskDoctorHomPageState extends State<AskDoctorHomPage> class _AskDoctorHomPageState extends State<AskDoctorHomPage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
int filterType = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -40,83 +43,34 @@ class _AskDoctorHomPageState extends State<AskDoctorHomPage>
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).askDoctor, appBarTitle: TranslationBase.of(context).askDoctor,
body: Scaffold( showNewAppBar: true,
extendBodyBehindAppBar: true, showNewAppBarTitle: true,
appBar: PreferredSize( backgroundColor: Color(0xffF8F8F8),
preferredSize: Size.fromHeight(65.0), body: Column(
child: Stack( children: [
children: <Widget>[ Row(
Positioned( children: [
bottom: 1, MyTabView(TranslationBase.of(context).askDoctor, FilterType.Clinic, filterType == 0 ? FilterType.Clinic : FilterType.Hospital, () {
left: 0, if (filterType != 0)
right: 0, setState(() {
child: BackdropFilter( filterType = 0;
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), });
child: Container( }),
color: Theme.of(context) MyTabView(TranslationBase.of(context).doctorResponses, FilterType.Hospital, filterType != 0 ? FilterType.Hospital : FilterType.Clinic, () {
.scaffoldBackgroundColor if (filterType == 0)
.withOpacity(0.8), setState(() {
height: 70.0, filterType = 1;
), });
), }),
),
Center(
child: Container(
height: 60.0,
margin: EdgeInsets.only(top: 10.0),
width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 0.9),
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: true,
controller: _tabController,
indicatorWeight: 5.0,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Tab(
child: Container(
width: MediaQuery.of(context).size.width * 0.36,
child: Center(
child: Texts(TranslationBase.of(context).askDoctor),
),
),
),
Tab(child: Container(
width: MediaQuery.of(context).size.width * 0.36,
child: Center(
child: Texts(TranslationBase.of(context).doctorResponses,textAlign: TextAlign.start,),
),
),)
],
),
),
),
),
], ],
), ),
), Expanded(
body: Column( child: IndexedStack(
children: <Widget>[ index: filterType,
Expanded( children: [AskDoctorPage(), DoctorResponse()],
child: TabBarView( ),
physics: BouncingScrollPhysics(), )
controller: _tabController, ],
children: <Widget>[
AskDoctorPage(),
DoctorResponse()
],
),
)
],
),
), ),
); );
} }

@ -20,191 +20,61 @@ class AskDoctorPage extends StatelessWidget {
onModelReady: (model) => model.getMyDoctor(), onModelReady: (model) => model.getMyDoctor(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: _appointmentExpandableList(model.patientDoctorAppointmentListHospital),
child: Container(
margin: EdgeInsets.all(10),
child: Column(
children: [
SizedBox(
height: 70,
),
...List.generate(
model.patientDoctorAppointmentListHospital.length,
(index) => AppExpandableNotifier(
title:
model.patientDoctorAppointmentListHospital[index].filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:
model.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.map((doctor) {
return InkWell(
onTap: () {
model
.getCallInfoHoursResult(
doctorId: doctor.doctorID,
projectId: doctor.projectID)
.then((value) {
if (model.state != ViewState.ErrorLocal &&
model.state != ViewState.Error) {
// Navigator.pop(context);
Navigator.push(
context,
FadePage(
page: RequestTypePage(doctorList: doctor,),
),
);
} else {
AppToast.showErrorToast(message: model.error);
}
});
///.showProgressBar(
// text: "Loading",
// backgroundColor:
// Colors.blue.withOpacity(0.6))
},
child: Card(
margin:
EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
decoration: BoxDecoration(),
padding: EdgeInsets.all(7.0),
width: MediaQuery.of(context).size.width,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 1,
child: ClipRRect(
borderRadius:
BorderRadius.circular(100.0),
child: Image.network(
doctor.doctorImageURL,
fit: BoxFit.fill,
height: 60.0,
width: 60.0),
),
),
Expanded(
flex: 4,
child: Container(
width:
MediaQuery.of(context).size.width *
0.55,
margin: EdgeInsets.fromLTRB(
20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
if (doctor.doctorTitle != null)
Text(
doctor.doctorTitle +
" " +
doctor.name,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(doctor.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(doctor.projectName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
if (doctor.speciality != null)
Container(
margin: EdgeInsets.only(
top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(
doctor.speciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
doctor.nearestFreeSlot != null
? Container(
margin: EdgeInsets.only(
top: 3.0, bottom: 3.0),
child: Text(
getDate(doctor
.nearestFreeSlot),
style: TextStyle(
fontSize: 14.0,
fontWeight:
FontWeight.bold,
color: Colors
.green[600],
letterSpacing:
1.0)),
)
: Container(),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: doctor
.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor:
Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon:
Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Container(
child: Image.network(
doctor.nationalityFlagURL,
width: 25.0,
height: 25.0),
),
],
),
],
),
),
),
],
),
),
),
);
}).toList(),
)),
)
],
),
),
),
), ),
); );
} }
Widget _appointmentExpandableList(List<PatientDoctorAppointmentList> _patientDoctorAppointmentList) {
return ListView.separated(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(top: 12),
separatorBuilder: (context, index) {
return Container(
height: 1,
margin: EdgeInsets.only(left: 21, right: 21),
color: Color(0xffD9D9D9),
);
},
itemBuilder: (context, index) {
List<DoctorList> _doctorList = _patientDoctorAppointmentList[index].patientDoctorAppointmentList;
return AppExpandableNotifier(
title: _patientDoctorAppointmentList[index].filterName,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
DoctorList _doctor = _doctorList[_index];
DoctorList doctorList = DoctorList(
projectID: _doctor.projectID,
setupID: _doctor.setupID,
clinicID: _doctor.clinicID,
projectName: _doctor.projectName,
clinicName: _doctor.clinicName,
actualDoctorRate: _doctor.actualDoctorRate,
doctorID: _doctor.doctorID,
doctorRate: _doctor.doctorRate,
gender: _doctor.gender,
doctorTitle: _doctor.doctorTitle,
name: _doctor.name,
speciality: _doctor.speciality,
doctorImageURL: _doctor.doctorImageURL,
nationalityFlagURL: _doctor.nationalityFlagURL);
return DoctorView(
doctor: doctorList,
isLiveCareAppointment: false,
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: _doctorList.length),
);
},
itemCount: _patientDoctorAppointmentList.length,
);
}
// todo 'sikander' remove this later
String getDoctorSpeciality(List<String> docSpecial) { String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = ""; String docSpeciality = "";
docSpecial.forEach((v) { docSpecial.forEach((v) {
@ -236,4 +106,3 @@ class AskDoctorPage extends StatelessWidget {
} }
} }
} }

@ -18,8 +18,7 @@ class HomePrescriptionsPage extends StatefulWidget {
_HomePrescriptionsPageState createState() => _HomePrescriptionsPageState(); _HomePrescriptionsPageState createState() => _HomePrescriptionsPageState();
} }
class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@ -27,8 +26,10 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage>
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png')); imagesInfo.add(ImagesInfo(
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png')); imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png'));
imagesInfo.add(ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png'));
} }
@override @override
@ -50,48 +51,43 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage>
showNewAppBar: true, showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8), backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: Scaffold( body: Column(
extendBodyBehindAppBar: true, children: <Widget>[
appBar: PreferredSize( TabBar(
preferredSize: Size.fromHeight(65.0), // isScrollable: true,
child: Column( controller: _tabController,
children: <Widget>[ indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
TabBar( labelColor: Color(0xff2B353E),
tabs: [ unselectedLabelColor: Color(0xff575757),
Tab(child: Text(TranslationBase.of(context).prescriptions, style: TextStyle(color: Colors.black))), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
Tab( labelStyle: TextStyle(
child: Text(TranslationBase.of(context).history, style: TextStyle(color: Colors.black)), fontSize: 16,
), fontWeight: FontWeight.w600,
letterSpacing: -0.48,
], ),
controller: _tabController, unselectedLabelStyle: TextStyle(
), fontSize: 16,
Divider( fontWeight: FontWeight.w600,
color: Colors.grey[600], letterSpacing: -0.48,
thickness: 0.5, ),
), tabs: [Text(TranslationBase.of(context).prescriptions), Text(TranslationBase.of(context).history)],
],
), ),
), Expanded(
body: Column( child: TabBarView(
children: <Widget>[ physics: BouncingScrollPhysics(),
Expanded( controller: _tabController,
child: TabBarView( children: <Widget>[
physics: BouncingScrollPhysics(), PrescriptionsPage(
controller: _tabController, prescriptionsViewModel: model,
children: <Widget>[ ),
PrescriptionsPage( PrescriptionsHistoryPage(
prescriptionsViewModel: model, prescriptionsViewModel: model,
), )
PrescriptionsHistoryPage( ],
prescriptionsViewModel: model, ),
) )
], ],
),
)
],
),
), ),
), ),
); );

@ -7,7 +7,8 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -20,8 +21,7 @@ class HomeReportPage extends StatefulWidget {
_HomeReportPageState createState() => _HomeReportPageState(); _HomeReportPageState createState() => _HomeReportPageState();
} }
class _HomeReportPageState extends State<HomeReportPage> class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@ -41,20 +41,11 @@ class _HomeReportPageState extends State<HomeReportPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png'));
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png'));
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png'));
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png'));
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png'));
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png'));
return BaseView<ReportsViewModel>( return BaseView<ReportsViewModel>(
onModelReady: (model) => model.getReports(), //model.getPrescriptions(), onModelReady: (model) => model.getReports(), //model.getPrescriptions(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
@ -63,129 +54,71 @@ class _HomeReportPageState extends State<HomeReportPage>
title: TranslationBase.of(context).medReport, title: TranslationBase.of(context).medReport,
description: TranslationBase.of(context).infoMonthReport, description: TranslationBase.of(context).infoMonthReport,
baseViewModel: model, baseViewModel: model,
showNewAppBar: true,
showNewAppBarTitle: true,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
body: Scaffold( body: Column(
extendBodyBehindAppBar: true, children: [
appBar: PreferredSize( TabBar(
preferredSize: Size.fromHeight(65.0), isScrollable: true,
child: Stack( controller: _tabController,
children: <Widget>[ indicatorWeight: 3.0,
Positioned( indicatorSize: TabBarIndicatorSize.tab,
bottom: 1, labelColor: Color(0xff2B353E),
left: 0, unselectedLabelColor: Color(0xff575757),
right: 0, labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
child: BackdropFilter( labelStyle: TextStyle(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), fontSize: 16,
child: Container( fontWeight: FontWeight.w600,
color: Theme.of(context) letterSpacing: -0.48,
.scaffoldBackgroundColor ),
.withOpacity(0.8), unselectedLabelStyle: TextStyle(
height: 70.0, fontSize: 16,
), fontWeight: FontWeight.w600,
), letterSpacing: -0.48,
),
tabs: [
Text(
TranslationBase.of(context).requested,
), ),
Center( Text(
child: Container( TranslationBase.of(context).ready,
height: 60.0, ),
margin: EdgeInsets.only(top: 10.0), Text(
width: MediaQuery.of(context).size.width * 0.9, TranslationBase.of(context).completed,
decoration: BoxDecoration( ),
border: Border( Text(
bottom: BorderSide( TranslationBase.of(context).cancelled,
color: Theme.of(context).dividerColor,
width: 0.7),
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: true,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.20,
child: Center(
child: Texts(TranslationBase.of(context).requested,fontSize: 11,),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.20,
child: Center(
child: Texts(TranslationBase.of(context).ready,fontSize: 11,),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.20,
child: Center(
child:
Texts(TranslationBase.of(context).completed,fontSize: 11,),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.20,
child: Center(
child:
Texts(TranslationBase.of(context).cancelled,fontSize: 11,),
),
),
],
),
),
),
), ),
], ],
), ),
), if (model.user != null)
body: Column(
children: <Widget>[
if(model.user!=null)
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
ReportListWidget( ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress),
reportList: model.reportsOrderRequestList, ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress),
emailAddress: model.user.emailAddress ReportListWidget(reportList: model.reportsOrderCompletedList, emailAddress: model.user.emailAddress),
), ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress),
ReportListWidget(
reportList: model.reportsOrderReadyList,
emailAddress: model.user.emailAddress
),
ReportListWidget(
reportList: model.reportsOrderCompletedList,
emailAddress: model.user.emailAddress
),
ReportListWidget(
reportList: model.reportsOrderCanceledList,
emailAddress: model.user.emailAddress
),
], ],
), ),
), ),
SizedBox( if (projectViewModel.havePrivilege(21))
height: 110, Padding(
) padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
], child: DefaultButton(
), TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach,
bottomSheet: projectViewModel.havePrivilege(21) ?Container( () => Navigator.push(
width: double.infinity, context,
height: 90, FadePage(
margin: EdgeInsets.all(8.0), page: MedicalReports(),
child: Button( ),
label: TranslationBase.of(context).requestMedicalReport, ),
backgroundColor: Colors.grey[800],
onTap: () => Navigator.push(
context,
FadePage(
page: MedicalReports(),
), ),
), )
), ],
):null,
), ),
), ),
); );

@ -7,10 +7,12 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
class ReportListWidget extends StatelessWidget { class ReportListWidget extends StatelessWidget {
final List<Reports> reportList; final List<Reports> reportList;
@ -20,83 +22,92 @@ class ReportListWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return ListView.separated(
child: ListView.builder( physics: BouncingScrollPhysics(),
itemBuilder: (context, index) => Padding( padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
padding: const EdgeInsets.all(8.0), separatorBuilder: (context, index) => SizedBox(height: 14),
child: Container( itemBuilder: (context, index) {
width: double.infinity, Reports report = reportList[index];
margin: EdgeInsets.only(left: 8, right: 8, top: 3), return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.all(
border: Border.all(color: Colors.white, width: 2), Radius.circular(10.0),
shape: BoxShape.rectangle, ),
borderRadius: BorderRadius.all( boxShadow: [
Radius.circular(8.0), BoxShadow(
)), color: Color(0xff000000).withOpacity(.05),
child: Row( //spreadRadius: 5,
children: <Widget>[ blurRadius: 27,
Expanded( offset: Offset(0, -3),
flex: 1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: LargeAvatar(
name: reportList[index].doctorName,
url: reportList[index].doctorImageURL,
),
),
), ),
Expanded( ],
flex: 4, color: Colors.white),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12),
child: Row( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.min,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, if (report.doctorName != null)
children: <Widget>[ Text(
SizedBox( report.doctorName,
height: 12, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
Texts(reportList[index].projectName), if (report.doctorName != null) SizedBox(height: 6),
Container( Row(
//height: MediaQuery.of(context).size.height * 0.07, mainAxisSize: MainAxisSize.min,
width: MediaQuery.of(context).size.width * 0.35, children: <Widget>[
child: Texts(reportList[index].clinicDescription), LargeAvatar(
), name: report.doctorName,
Texts(TranslationBase.of(context).invoiceNo + ': ${reportList[index].invoiceNo}'), url: report.doctorImageURL,
SizedBox(height: 12), width: 48,
], height: 48,
), ),
reportList[index].status == 2 SizedBox(width: 11),
? Expanded( Expanded(
child: Container( child: Column(
margin: EdgeInsets.only(left: 15.0, right: 15.0), crossAxisAlignment: CrossAxisAlignment.start,
child: InkWell( mainAxisSize: MainAxisSize.min,
onTap: () { children: <Widget>[
if (report.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", report.projectName),
if (report.clinicDescription != null) myRichText(TranslationBase.of(context).hospital + ":", report.clinicDescription),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingBar.readOnly(
initialRating: report.actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
if (reportList[index].status == 2)
IconButton(
icon: Icon(Icons.email),
color: Color(0xff28323A),
constraints: BoxConstraints(),
padding: EdgeInsets.zero,
onPressed: () {
showConfirmMessage(reportList[index]); showConfirmMessage(reportList[index]);
// sendReportEmail(reportList[index]); })
}, ],
child: Icon( ),
Icons.email, ],
color: Theme.of(context).primaryColor, ),
size: 30.0,
),
),
),
)
: Container(),
],
), ),
), ],
) ),
], ],
), ),
), ),
), );
itemCount: reportList.length, },
), itemCount: reportList.length,
); );
} }
@ -116,15 +127,8 @@ class ReportListWidget extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
ReportsService _reportsService = locator<ReportsService>(); ReportsService _reportsService = locator<ReportsService>();
_reportsService _reportsService
.sendEmailForMedicalReport( .sendEmailForMedicalReport(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), report.invoiceNo.toString(), report.projectID,
report.projectName, DateUtil.convertDateToString(report.requestDate), report.setupId)
report.clinicDescription,
report.doctorName,
DateUtil.convertDateToString(report.requestDate),
report.invoiceNo.toString(),
report.projectID,
DateUtil.convertDateToString(report.requestDate),
report.setupId)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully); AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully);

@ -132,7 +132,7 @@ class DoctorCard extends StatelessWidget {
), ),
Text( Text(
// DateUtil.formatDateToTime(date), // DateUtil.formatDateToTime(date),
appointmentTime, appointmentTime ?? "",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48, height: 18 / 12),
), ),
], ],

@ -64,7 +64,7 @@ class _NotAutPageState extends State<NotAutPage> {
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24),
), ),
Text( Text(
widget.description, widget.description??"",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14),
), ),
SizedBox( SizedBox(

Loading…
Cancel
Save