|
|
|
|
@ -1,19 +1,13 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/d_q_icons_icons.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/active_medications/ActiveMedicationsPage.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
|
|
|
|
|
@ -21,6 +15,8 @@ import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/medicine_search_screen.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
|
|
|
|
|
@ -29,8 +25,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
class HomePage extends StatefulWidget {
|
|
|
|
|
@ -43,9 +37,20 @@ class HomePage extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _HomePageState extends State<HomePage> {
|
|
|
|
|
var toDoProvider;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
|
|
|
|
getToDoCount();
|
|
|
|
|
});
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
|
|
|
|
|
return BaseView<DashboardViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getPatientRadOrders(),
|
|
|
|
|
builder: (_, model, wi) => AppScaffold(
|
|
|
|
|
@ -69,6 +74,20 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
'assets/images/dq_home_page_bg_image.png'),
|
|
|
|
|
fit: BoxFit.cover),
|
|
|
|
|
),
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 15,
|
|
|
|
|
left: 5,
|
|
|
|
|
right: 5,
|
|
|
|
|
child: Container(
|
|
|
|
|
width:
|
|
|
|
|
MediaQuery.of(context).size.width * 0.8,
|
|
|
|
|
child: Container(),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
Container(width: double.infinity, height:projectViewModel.isArabic ? 120:110),
|
|
|
|
|
@ -76,8 +95,16 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 40,
|
|
|
|
|
left: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
|
|
|
|
|
right: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
|
|
|
|
|
left: MediaQuery.of(context).size.width *
|
|
|
|
|
(MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.landscape
|
|
|
|
|
? 0.02
|
|
|
|
|
: 0.03),
|
|
|
|
|
right: MediaQuery.of(context).size.width *
|
|
|
|
|
(MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.landscape
|
|
|
|
|
? 0.02
|
|
|
|
|
: 0.03),
|
|
|
|
|
child: (!model.isLogin && projectViewModel.user == null)
|
|
|
|
|
? Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
@ -126,7 +153,10 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(2),
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.30,
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.30,
|
|
|
|
|
height: 30,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
@ -141,7 +171,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.viewMore,
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
color: Theme.of(context)
|
|
|
|
|
.primaryColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -154,7 +185,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: projectViewModel.isArabic ? 175: 160,
|
|
|
|
|
height: projectViewModel.isArabic ? 180 : 150,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
@ -172,7 +203,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
child: Column(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
@ -204,7 +235,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
Texts(
|
|
|
|
|
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}',
|
|
|
|
|
color: Colors.grey[100],
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.normal,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -216,7 +248,10 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(2),
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.30,
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.30,
|
|
|
|
|
height: 30,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
@ -230,8 +265,10 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).viewMore,
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.viewMore,
|
|
|
|
|
color: Theme.of(context)
|
|
|
|
|
.primaryColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
bold: true,
|
|
|
|
|
),
|
|
|
|
|
@ -244,17 +281,19 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
'assets/images/height_icon.png',
|
|
|
|
|
width: 30,
|
|
|
|
|
height: 55,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"${model.heightCm}",
|
|
|
|
|
@ -276,8 +315,10 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
'assets/images/test-weight.png',
|
|
|
|
|
@ -290,7 +331,6 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
'${model.weightKg}',
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
bold: true,
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase.of(context).weight,
|
|
|
|
|
@ -711,6 +751,23 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => CovidDrivethruLocation()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getToDoCount() {
|
|
|
|
|
toDoProvider.setState(0);
|
|
|
|
|
ClinicListService service = new ClinicListService();
|
|
|
|
|
service.getActiveAppointmentNo(context).then((res) {
|
|
|
|
|
print(res['AppointmentActiveNumber']);
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
setState(() {
|
|
|
|
|
toDoProvider.setState(res['AppointmentActiveNumber']);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class DashboardItem extends StatelessWidget {
|
|
|
|
|
@ -761,7 +818,8 @@ class DashboardItem extends StatelessWidget {
|
|
|
|
|
? DecorationImage(
|
|
|
|
|
image: ExactAssetImage('assets/images/$imageName'),
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(opacity), BlendMode.dstIn),
|
|
|
|
|
colorFilter: new ColorFilter.mode(
|
|
|
|
|
Colors.black.withOpacity(opacity), BlendMode.dstIn),
|
|
|
|
|
)
|
|
|
|
|
: icon,
|
|
|
|
|
),
|
|
|
|
|
|