Home page 1.2

merge-requests/390/head
Mirza.Shafique 4 years ago
parent 090556f4d1
commit d37f225c1b

Before

Width:  |  Height:  |  Size: 843 B

After

Width:  |  Height:  |  Size: 843 B

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="20.446" height="30.29" viewBox="0 0 20.446 30.29">
<path id="man_4_" data-name="man (4)" d="M96.552,5.524c0,6.413,0,6.013,0,6.08a.283.283,0,0,1-.566-.019V9.165a4.549,4.549,0,0,0-4.543-4.543H85a4.549,4.549,0,0,0-4.543,4.543v2.421a.283.283,0,0,1-.566.019c0-.067,0,.345,0-6.241a2.212,2.212,0,0,1,1.866-2.182,5.5,5.5,0,0,1,5-3.182h4.266a5.524,5.524,0,0,1,5.524,5.524Zm-5.111.107H85a3.538,3.538,0,0,0-3.534,3.534c0,.015,0,4.187,0,4.2a6.752,6.752,0,0,0,13.5-.054V9.165a3.538,3.538,0,0,0-3.534-3.534Zm2.146,16.26v1.874a.5.5,0,0,0,.344.478A2.718,2.718,0,0,1,95.8,26.819v2.318a.516.516,0,0,1-.471.521.5.5,0,0,1-.538-.5v-2.3a1.728,1.728,0,0,0-1.652-1.739,1.706,1.706,0,0,0-1.755,1.7v2.318a.516.516,0,0,1-.471.521.5.5,0,0,1-.538-.5V26.819a2.718,2.718,0,0,1,1.864-2.577.5.5,0,0,0,.344-.478V21.59a.147.147,0,0,0-.235-.116c-4.129,3.148-3.884,3.011-4.119,3.01s.036.158-4.12-3.01a.146.146,0,0,0-.234.116v2.866a.5.5,0,0,0,.288.456,1.893,1.893,0,1,1-1.591,0,.505.505,0,0,0,.293-.457V21.882a.252.252,0,0,0-.28-.251A5.208,5.208,0,0,0,78,26.8v2.982a.5.5,0,0,0,.5.5H97.941a.5.5,0,0,0,.5-.5V26.779a5.21,5.21,0,0,0-4.577-5.139.252.252,0,0,0-.282.251Zm-5.058,1.221,2.693-2.053a.3.3,0,0,0-.28-.529,7.775,7.775,0,0,1-5.429,0,.3.3,0,0,0-.29.525l2.694,2.053a.5.5,0,0,0,.612,0ZM82.48,26.63a.883.883,0,1,0,.883-.883A.884.884,0,0,0,82.48,26.63Z" transform="translate(-78 0)" fill="#28323a"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -480,7 +480,7 @@ const Map localizedValues = {
"locationa": {"en": "location:", "ar": "الموقع"},
"ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "},
"requestA": {"en": "Request:", "ar": "اسعاف"},
"MyAppointments": {"en": "Appointments", "ar": "مواعيدي"},
"MyAppointments": {"en": "My", "ar": "مواعيدي"},
"NoBookedAppointments": {
"en": "No Booked Appointments",
"ar": "لا توجد مواعيد محجوزة"
@ -493,7 +493,7 @@ const Map localizedValues = {
"en": "No Arrived Appointments",
"ar": "لم تصل المواعيد"
},
"MyAppointmentsList": {"en": "List", "ar": "قائمة بمواعدي"},
"MyAppointmentsList": {"en": "Appointments", "ar": "قائمة بمواعدي"},
"Radiology": {"en": "Radiology", "ar": "الأشعة"},
"RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"},
"Lab": {"en": "Lab", "ar": "تحليل المختبر"},

@ -0,0 +1,108 @@
import 'package:diplomaticquarterapp/models/hmg_services.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/pharmacy_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart';
class HomePageFragment extends StatefulWidget {
@override
_HomePageFragmentState createState() => _HomePageFragmentState();
}
class _HomePageFragmentState extends State<HomePageFragment> {
List<HmgServices> hmgServices = [];
@override
void initState() {
// TODO: implement initState
super.initState();
initialiseHmgServices(false);
// getFamilyFiles();
}
initialiseHmgServices(bool isLogin) {
hmgServices.add(new HmgServices(0, "LiveCare ", "Online Consulting", "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(new HmgServices(1, "Covid Test", "Drive-Thru", "assets/images/new/covid_test_drive_thru.svg", isLogin));
hmgServices.add(new HmgServices(2, "Checkup", "Comprehensive", "assets/images/new/comprehensive_checkup.svg", isLogin));
hmgServices.add(new HmgServices(3, "HHC Home", "Health Care", "assets/images/new/HHC.svg", isLogin));
hmgServices.add(new HmgServices(4, "E-Refferal", "Services", "assets/images/new/E_Refferal.svg", isLogin));
hmgServices.add(new HmgServices(5, "RRT", "Emergency", "assets/images/new/RRT.svg", isLogin));
}
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
child: Column(
children: [
AspectRatio(
aspectRatio: 2,
child: Container(
margin: EdgeInsets.all(14),
child: SliderView(),
// height: MediaQuery.of(context).size.width / 2.6,
),
),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Image.asset("assets/images/bn_offer.png"),
),
mHeight(20),
Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 20,
),
child: Column(
children: [
Row(
children: [
Expanded(
child: Text(
"HMG Services",
style: TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
Text(
"View All Services",
style: TextStyle(
color: CustomColors.accentColor,
fontSize: 14,
),
),
],
),
mHeight(20),
GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: hmgServices.length,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int index) {
return ServicesView(hmgServices[index],index);
}),
],
),
),
Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 20,
),
child: PharmacyView(),
),
mHeight(140),
],
),
);
}
}

@ -0,0 +1,231 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/models/gradient_color.dart';
import 'package:diplomaticquarterapp/models/hmg_services.dart';
import 'package:diplomaticquarterapp/models/slider_data.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/pharmacy_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' as s;
import 'package:provider/provider.dart';
class LoggedHomePageFragment extends StatefulWidget {
ProjectViewModel projectViewModel;
LoggedHomePageFragment(this.projectViewModel);
@override
_HomePageFragmentState createState() => _HomePageFragmentState();
}
class _HomePageFragmentState extends State<LoggedHomePageFragment> {
List<HmgServices> hmgServices = [];
var familyFileProvider = FamilyFilesProvider();
@override
void initState() {
// TODO: implement initState
super.initState();
initialiseHmgServices(false);
// getFamilyFiles();
}
initialiseHmgServices(bool isLogin) {
hmgServices.add(new HmgServices(0, "LiveCare ", "Online Consulting", "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(new HmgServices(1, "Covid Test", "Drive-Thru", "assets/images/new/covid_test_drive_thru.svg", isLogin));
hmgServices.add(new HmgServices(2, "Checkup", "Comprehensive", "assets/images/new/comprehensive_checkup.svg", isLogin));
hmgServices.add(new HmgServices(3, "HHC Home", "Health Care", "assets/images/new/HHC.svg", isLogin));
hmgServices.add(new HmgServices(4, "E-Refferal", "Services", "assets/images/new/E_Refferal.svg", isLogin));
hmgServices.add(new HmgServices(5, "RRT", "Emergency", "assets/images/new/RRT.svg", isLogin));
}
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
if (widget.projectViewModel.user != null) {
print("calling_family");
if (await s.sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE));
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await s.sharedPref.getObject(FAMILY_FILE)));
} else {
return familyFileProvider.getSharedRecordByStatus();
}
}
}
@override
Widget build(BuildContext context) {
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: widget.projectViewModel, context: context, count: appoCountProvider.count, isLogin: widget.projectViewModel.isLogin);
return Container(
width: double.infinity,
child: Column(
children: [
FutureBuilder(
future: getFamilyFiles(), // async work
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(padding: EdgeInsets.all(10), child: Text(''));
default:
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error));
else {
List<SliderData> sliderData = [];
sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + widget.projectViewModel.user.patientID.toString(),
widget.projectViewModel.user.firstName + ' ' + widget.projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor));
for (int i = 0; i < snapshot.data.getAllSharedRecordsByStatusList.length; i++) {
if (snapshot.data.getAllSharedRecordsByStatusList[i].status == 3)
sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + snapshot.data.getAllSharedRecordsByStatusList[i].responseID.toString(),
snapshot.data.getAllSharedRecordsByStatusList[i].patientName, "", bannerColor[i + 1].darkColor, bannerColor[i + 1].lightColor));
}
return AspectRatio(
aspectRatio: 2,
child: CarouselSlider(
options: CarouselOptions(
autoPlay: false,
enlargeCenterPage: true,
initialPage: 0,
aspectRatio: 2.5,
viewportFraction: 0.9,
enableInfiniteScroll: false,
onPageChanged: (index, reason) {
print("onPageChanged");
}),
items: [
for (int i = 0; i < sliderData.length; i++)
Builder(
builder: (BuildContext context) {
return LoggedSliderView(sliderData[i]);
},
)
],
),
);
}
}
},
),
Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.143,
child: ListView.separated(
itemCount: 4,
padding: EdgeInsets.zero,
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
itemBuilder: (context, index) {
return Container(
child: myMedicalList[index],
margin: EdgeInsets.only(left: index == 0 ? 20 : 0, right: index == 3 ? 20 : 0),
);
},
separatorBuilder: (BuildContext context, int index) {
return mWidth(12);
},
),
),
Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 16,
),
child: Row(
children: [
mFlex(1),
Text(
"View Medical File",
style: TextStyle(
color: CustomColors.accentColor,
fontSize: 14,
decoration: TextDecoration.underline,
),
),
],
),
),
mHeight(16),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Image.asset("assets/images/bn_offer.png"),
),
mHeight(14),
Column(
children: [
Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 20,
),
child: Row(
children: [
Expanded(
child: Text(
"HMG Services",
style: TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
Text(
"View All Services",
style: TextStyle(
color: CustomColors.accentColor,
decoration: TextDecoration.underline,
fontSize: 14,
),
),
],
),
),
mHeight(20),
Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.143,
child: ListView.separated(
itemCount: hmgServices.length,
padding: EdgeInsets.zero,
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return Container(
width: MediaQuery.of(context).size.height * 0.143,
margin: EdgeInsets.only(left: index == 0 ? 20 : 0, right: index == hmgServices.length - 1 ? 20 : 0),
child: ServicesView(hmgServices[index], index),
);
},
separatorBuilder: (BuildContext context, int index) {
return mWidth(12);
},
),
),
],
),
Padding(
padding: const EdgeInsets.only(
left: 20,
right: 20,
top: 20,
),
child: PharmacyView(),
),
mHeight(140),
],
),
);
}
}

@ -15,6 +15,8 @@ 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/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/fragments/home_page_fragment.dart';
import 'package:diplomaticquarterapp/pages/landing/fragments/logged_home_page_fragment.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/offer_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/pharmacy_view.dart';
@ -55,38 +57,6 @@ class HomePage2 extends StatefulWidget {
class _HomePageState2 extends State<HomePage2> {
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
ProjectViewModel projectViewModel;
var familyFileProvider = FamilyFilesProvider();
List<HmgServices> hmgServices = [];
@override
void initState() {
// TODO: implement initState
super.initState();
initialiseHmgServices(false);
// getFamilyFiles();
}
initialiseHmgServices(bool isLogin) {
hmgServices.add(new HmgServices(0, "LiveCare ", "Online Consulting", "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(new HmgServices(1, "Covid Test", "Drive-Thru", "assets/images/new/covid_test_drive_thru.svg", isLogin));
hmgServices.add(new HmgServices(2, "Checkup", "Comprehensive", "assets/images/new/comprehensive_checkup.svg", isLogin));
hmgServices.add(new HmgServices(3, "HHC Home", "Health Care", "assets/images/new/HHC.svg", isLogin));
hmgServices.add(new HmgServices(4, "E-Refferal", "Services", "assets/images/new/E_Refferal.svg", isLogin));
hmgServices.add(new HmgServices(5, "RRT", "Emergency", "assets/images/new/RRT.svg", isLogin));
}
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
if (projectViewModel.user != null) {
print("calling_family");
if (await s.sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE));
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await s.sharedPref.getObject(FAMILY_FILE)));
} else {
return familyFileProvider.getSharedRecordByStatus();
}
}
}
@override
Widget build(BuildContext context) {
@ -94,218 +64,13 @@ class _HomePageState2 extends State<HomePage2> {
return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, wi) => Container(
color: Color(0xFFFF7F7F7),
color: CustomColors.backgroudGreyColor,
// color: Colors.yellow,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
!model.isLogin
? AspectRatio(
aspectRatio: 2,
child: Container(
margin: EdgeInsets.all(14),
child: SliderView(),
// height: MediaQuery.of(context).size.width / 2.6,
),
)
: FutureBuilder(
future: getFamilyFiles(), // async work
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(padding: EdgeInsets.all(10), child: Text(''));
default:
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error));
else {
List<SliderData> sliderData = [];
sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(),
projectViewModel.user.firstName + ' ' + projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor));
for (int i = 0; i < snapshot.data.getAllSharedRecordsByStatusList.length; i++) {
if (snapshot.data.getAllSharedRecordsByStatusList[i].status == 3)
sliderData.add(new SliderData(TranslationBase.of(context).fileno + ": " + snapshot.data.getAllSharedRecordsByStatusList[i].responseID.toString(),
snapshot.data.getAllSharedRecordsByStatusList[i].patientName, "", bannerColor[i + 1].darkColor, bannerColor[i + 1].lightColor));
}
return CarouselSlider(
options: CarouselOptions(
autoPlay: false,
enlargeCenterPage: true,
initialPage: 0,
aspectRatio: 2.5,
viewportFraction: 0.9,
enableInfiniteScroll: false,
onPageChanged: (index, reason) {
print("onPageChanged");
}),
items: [
for (int i = 0; i < sliderData.length; i++)
Builder(
builder: (BuildContext context) {
return LoggedSliderView(sliderData[i]);
},
)
],
);
}
}
},
),
// CarouselSlider(
// options: CarouselOptions(
// autoPlay: false,
// enlargeCenterPage: true,
// initialPage: 0,
// aspectRatio: 2.5,
// viewportFraction: 0.9,
// enableInfiniteScroll: false,
// onPageChanged: (index, reason) {
// print("onPageChanged");
// }),
// items: [
// for (int i = 0; i < bannerColor.length; i++)
// Builder(
// builder: (BuildContext context) {
// return LoggedSliderView(bannerColor[i].darkColor, bannerColor[i].lightColor);
// },
// )
// ],
// ),
model.isLogin
? FutureBuilder(
future: getFamilyFiles(), // async work
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(padding: EdgeInsets.all(10), child: Text(''));
default:
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error));
else
return Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
// <--- left side
color: Colors.grey[200],
width: 1.0,
),
)),
child: Column(
children: [
// projectViewModel.user.isFamily == true
// ?
Container(
padding: EdgeInsets.only(bottom: 5),
child: InkWell(
onTap: () {
// switchUser(
// mainUser,
// context);
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: Icon(Icons.person),
),
Expanded(
flex: 7,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
AppText(projectViewModel.user.firstName + ' ' + projectViewModel.user.lastName, color: Theme.of(context).textTheme.bodyText1.color),
AppText(
TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(),
color: Theme.of(context).textTheme.bodyText1.color,
),
])),
],
))),
// : SizedBox(),
Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
return result.status == 3
? Container(
padding: EdgeInsets.only(bottom: 5),
child: InkWell(
onTap: () {
// switchUser(result,
// context);
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: Icon(Icons.person, color: result.responseID == model.user.patientID ? Color(0xFF40ACC9) : Colors.black),
),
Expanded(
flex: 7,
child: Padding(
padding: EdgeInsets.only(left: 5, right: 5),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
AppText(result.patientName, color: result.responseID == model.user.patientID ? Color(0xFF40ACC9) : Colors.black),
AppText(TranslationBase.of(context).fileno + ": " + result.responseID.toString(),
color: result.responseID == projectViewModel.user.patientID ? Color(0xFF40ACC9) : Colors.black),
]))),
],
)))
: SizedBox();
}).toList())
],
));
}
},
)
: Container(),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Image.asset("assets/images/bn_offer.png"),
),
mHeight(20),
Padding(
padding: const EdgeInsets.only(left:20,right: 20,top: 20,),
child: Column(
children: [
Row(
children: [
Expanded(
child: Text(
"HMG Services",
style: TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
),
Text(
"View All Services",
style: TextStyle(
color: CustomColors.accentColor,
fontSize: 14,
),
),
],
),
mHeight(20),
GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3,childAspectRatio: 2/2 ,crossAxisSpacing: 12,mainAxisSpacing: 12),
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: hmgServices.length,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int index) {
return ServicesView(hmgServices[index]);
}
),
],
),
),
Padding(
padding: const EdgeInsets.only(left:20,right: 20,top: 20,),
child: PharmacyView(),
),
mHeight(140),
!model.isLogin ? HomePageFragment() : LoggedHomePageFragment(projectViewModel),
],
),
),

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart';
import 'dart:math';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/models/slider_data.dart';
class LoggedSliderView extends StatelessWidget {
@ -13,8 +13,8 @@ class LoggedSliderView extends StatelessWidget {
Widget build(BuildContext context) {
return Card(
shape: cardRadius(20),
elevation: 3,
margin: EdgeInsets.all(6),
elevation: 0,
margin: EdgeInsets.all(0),
child: Card(
shape: cardRadius(20),
clipBehavior: Clip.antiAlias,
@ -58,7 +58,7 @@ class LoggedSliderView extends StatelessWidget {
),
),
mWidth(MediaQuery.of(context).size.width / 50),
circularAviator(MediaQuery.of(context).size.width / 14, brColor: Colors.white),
//circularAviator(MediaQuery.of(context).size.width / 14, brColor: Colors.white),
mFlex(1),
Text(
"Verified",
@ -70,12 +70,12 @@ class LoggedSliderView extends StatelessWidget {
),
mFlex(2),
Padding(
padding: const EdgeInsets.only(left: 20,right: 20),
padding: const EdgeInsets.only(left: 20, right: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
sliderData.pateintName,
sliderData.pateintName.toLowerCase().capitalizeFirstofEach,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
@ -89,7 +89,7 @@ class LoggedSliderView extends StatelessWidget {
],
),
),
mFlex(2),
mFlex(3),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Text(
@ -97,11 +97,20 @@ class LoggedSliderView extends StatelessWidget {
style: TextStyle(color: Colors.white, fontSize: 14),
),
),
mFlex(3),
mFlex(4),
],
),
),
),
Positioned(
child: Icon(
Icons.arrow_forward_rounded,
color: Colors.white,
size: 20,
),
bottom: 8,
right: 8,
),
],
),
),

@ -1,4 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/models/hmg_services.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
@ -7,8 +8,9 @@ import 'package:flutter_svg/flutter_svg.dart';
class ServicesView extends StatelessWidget {
HmgServices hmgServices;
int index;
ServicesView(this.hmgServices);
ServicesView(this.hmgServices, this.index);
@override
Widget build(BuildContext context) {
@ -59,12 +61,15 @@ class ServicesView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
mFlex(1),
SvgPicture.asset(hmgServices.icon),
SvgPicture.asset(
hmgServices.icon,
height: index == 0 ? MediaQuery.of(context).size.width / 18 : MediaQuery.of(context).size.width / 14,
),
mFlex(2),
Text(
hmgServices.title,
style: TextStyle(
fontSize: 16,
fontSize: SizeConfig.textMultiplier * 1.9,
fontWeight: FontWeight.bold,
),
),
@ -77,7 +82,7 @@ class ServicesView extends StatelessWidget {
hmgServices.subTitle,
maxLines: 1,
style: TextStyle(
fontSize: 10,
fontSize: SizeConfig.textMultiplier * 1.2,
),
),
),

@ -8,9 +8,9 @@ class CustomColors {
static const Color darkGrey = Color(0xFF222222);
static const Color black = Color(0xFF141414);
static const Color white = Color(0xFFFFFFFF);
static const Color accentColor=Color(0xFFFBF2E31);
static const Color lightGreyColor=Color(0xFFFEDEDED);
static const Color darkGreyColor=Color(0xFFFC9C9C9);
static const Color pharmacyGreyColor=Color(0xFFFE5E5E5);
static const Color backgroudGreyColor=Color(0xFFFF7F7F7);
static const Color accentColor = Color(0xFFD02127);
static const Color lightGreyColor = Color(0xFFE2E2E2);
static const Color darkGreyColor = Color(0xFFC9C9C9);
static const Color pharmacyGreyColor = Color(0xFFDBDBDB);
static const Color backgroudGreyColor = Color(0xFF7F7F7);
}

@ -62,7 +62,7 @@ class Utils {
/// Check The Internet Connection
static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult =
await (Connectivity().checkConnectivity());
await (Connectivity().checkConnectivity());
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true;
@ -199,59 +199,54 @@ class Utils {
static validEmail(email) {
return RegExp(
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
.hasMatch(email);
}
static List<Widget> myMedicalList(
{ProjectViewModel projectViewModel,
BuildContext context,
bool isLogin,
count}) {
BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List();
if (projectViewModel.havePrivilege(5)) {
medical.add(InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: MyAppointments(),
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5)
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin
? Stack(children: [
MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
isEnable: projectViewModel.havePrivilege(5)),
Positioned(
right: 0.0,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(count.toString(),
style: TextStyle(color: Colors.white, fontSize: 16.0)),
),
);
},
child: isLogin
? Stack(children: [
MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
),
Positioned(
right: 0.0,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(count.toString(),
style:
TextStyle(color: Colors.white, fontSize: 16.0)),
),
),
),
])
: MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
),
));
}
),
),
])
: MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
isEnable: projectViewModel.havePrivilege(5),
),
));
if (projectViewModel.havePrivilege(10)) {
medical.add(InkWell(
onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())),
@ -263,106 +258,97 @@ class Utils {
));
}
if (projectViewModel.havePrivilege(7)) {
medical.add(InkWell(
onTap: () =>
Navigator.push(context, FadePage(page: RadiologyHomePage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology_icon.png',
subTitle: TranslationBase.of(context).radiologySubtitle,
),
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7)
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology_icon.png',
subTitle: TranslationBase.of(context).radiologySubtitle,
isEnable: projectViewModel.havePrivilege(7),
),
));
if (projectViewModel.havePrivilege(12)) {
medical.add(InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: HomePrescriptionsPage(),
),
);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).medicines,
imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context).medicinesSubtitle,
),
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12)
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).medicines,
imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context).medicinesSubtitle,
isEnable: projectViewModel.havePrivilege(12),
),
));
if (projectViewModel.havePrivilege(25)) {
medical.add(InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: VitalSignDetailsScreen(),
),
),
child: MedicalProfileItem(
title: TranslationBase.of(context).vitalSigns,
imagePath: 'vital_signs.png',
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
),
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(25)
? Navigator.push(
context,
FadePage(page: VitalSignDetailsScreen()),
)
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).vitalSigns,
imagePath: 'vital_signs.png',
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
isEnable: projectViewModel.havePrivilege(25),
),
));
if (projectViewModel.havePrivilege(48)) {
medical.add(InkWell(
onTap: () =>
Navigator.push(context, FadePage(page: ActiveMedicationsPage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png',
subTitle: TranslationBase.of(context).myMedicalSubtitle,
),
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(48)
? Navigator.push(context, FadePage(page: ActiveMedicationsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png',
subTitle: TranslationBase.of(context).myMedicalSubtitle,
isEnable: false,
),
));
if (projectViewModel.havePrivilege(6)) {
medical.add(InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
);
},
child: MedicalProfileItem(
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(6)
? Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
)
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myDoctor,
imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
),
));
}
isEnable: projectViewModel.havePrivilege(6)),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14)
? Navigator.push(context, FadePage(page: EyeMeasurementsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
subTitle: TranslationBase.of(context).eyeSubtitle,
isEnable: projectViewModel.havePrivilege(14),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22)
? Navigator.push(context, FadePage(page: InsuranceCard()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).insuranceSubtitle,
isEnable: projectViewModel.havePrivilege(22),
),
));
if (projectViewModel.havePrivilege(14)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: EyeMeasurementsPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
subTitle: TranslationBase.of(context).eyeSubtitle,
),
));
}
if (projectViewModel.havePrivilege(22)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceCard()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).insuranceSubtitle,
),
));
}
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceUpdate()));
@ -374,137 +360,467 @@ class Utils {
),
));
if (projectViewModel.havePrivilege(18)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceApproval()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
),
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18)
? Navigator.push(context, FadePage(page: InsuranceApproval()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
isEnable: projectViewModel.havePrivilege(18),
),
));
if (projectViewModel.havePrivilege(23)) {
medical.add(InkWell(
onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context).allergiesSubtitle,
),
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(23)
? Navigator.push(context, FadePage(page: AllergiesPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context).allergiesSubtitle,
isEnable: projectViewModel.havePrivilege(23),
),
));
if (projectViewModel.havePrivilege(26)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyVaccines()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines,
imagePath: 'my_vaccines_icon.png',
subTitle: TranslationBase.of(context).myVaccinesSubtitle,
),
));
}
if (projectViewModel.havePrivilege(20))
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: HomeReportPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png',
subTitle: TranslationBase.of(context).medicalSubtitle,
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(26)
? Navigator.push(context, FadePage(page: MyVaccines()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines,
imagePath: 'my_vaccines_icon.png',
subTitle: TranslationBase.of(context).myVaccinesSubtitle,
isEnable: projectViewModel.havePrivilege(26),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(20)
? Navigator.push(context, FadePage(page: HomeReportPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png',
subTitle: TranslationBase.of(context).medicalSubtitle,
isEnable: projectViewModel.havePrivilege(20),
),
));
if (projectViewModel.havePrivilege(19)) {
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(19)
? Navigator.push(context, FadePage(page: MonthlyReportsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png',
subTitle: TranslationBase.of(context).monthlySubtitle,
isEnable: projectViewModel.havePrivilege(19),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(16)
? Navigator.push(context, FadePage(page: PatientSickLeavePage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context).sickSubtitle,
isEnable: projectViewModel.havePrivilege(16),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(47)
? Navigator.push(context, FadePage(page: MyBalancePage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance,
imagePath: 'check-in.png',
subTitle: TranslationBase.of(context).myBalanceSubtitle,
isEnable: projectViewModel.havePrivilege(47),
),
));
medical.add(MedicalProfileItem(
title: TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png',
subTitle: TranslationBase.of(context).patientCallSubtitle,
isEnable: projectViewModel.havePrivilege(61),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(24)
? Navigator.push(context, FadePage(page: MyTrackers()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers,
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context).myTrackersSubtitle,
isEnable: projectViewModel.havePrivilege(24),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(30)
? Navigator.push(context, FadePage(page: SmartWatchInstructions()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
isEnable: projectViewModel.havePrivilege(30),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(28)
? Navigator.push(context, FadePage(page: AskDoctorHomPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png',
subTitle: TranslationBase.of(context).askYourSubtitle,
isEnable: projectViewModel.havePrivilege(28)),
));
if (projectViewModel.havePrivilege(32) || true) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MonthlyReportsPage()));
userData().then((userData_) {
if (projectViewModel.isLogin && userData_ != null) {
String patientID = userData_.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context);
projectViewModel
.platformBridge()
.connectHMGInternetWifi(patientID)
.then((value) => {GifLoaderDialogUtils.hideDialog(context)});
} else {
AlertDialogBox(
context: context,
confirmMessage:
"Please login with your account first to use this feature",
okText: "OK",
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
}).showAlertDialog(context);
}
});
},
child: MedicalProfileItem(
title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png',
subTitle: TranslationBase.of(context).monthlySubtitle,
title: TranslationBase.of(context).internet,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).internetSubtitle,
),
));
}
if (projectViewModel.havePrivilege(16)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: PatientSickLeavePage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context).sickSubtitle,
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(40)
? launch('whatsapp://send?phone=18885521858&text=')
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).chatbotSubtitle,
isEnable: projectViewModel.havePrivilege(40),
),
));
return medical;
}
static List<Widget> myMedicalListHomePage(
{ProjectViewModel projectViewModel,
BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List();
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5)
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin
? Stack(children: [
MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'appointment_list.svg',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
isEnable: projectViewModel.havePrivilege(5)),
Positioned(
right: 8,
top: 4,
child: Badge(
toAnimate: false,
elevation: 0,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(count.toString(),
style: TextStyle(color: Colors.white, fontWeight:FontWeight.bold,fontSize: 12.0)),
),
),
),
));
}
])
: MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'appointment_list.svg',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
isEnable: projectViewModel.havePrivilege(5),
),
));
if (projectViewModel.havePrivilege(47)) {
if (projectViewModel.havePrivilege(10)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyBalancePage()));
},
onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance,
imagePath: 'check-in.png',
subTitle: TranslationBase.of(context).myBalanceSubtitle,
title: TranslationBase.of(context).lab,
imagePath: 'lab_result.svg',
subTitle: TranslationBase.of(context).labSubtitle,
),
));
}
if (projectViewModel.havePrivilege(61)) {
medical.add(MedicalProfileItem(
title: TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png',
subTitle: TranslationBase.of(context).patientCallSubtitle,
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7)
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg',
subTitle: TranslationBase.of(context).radiologySubtitle,
isEnable: projectViewModel.havePrivilege(7),
),
));
if (projectViewModel.havePrivilege(24)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyTrackers()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers,
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context).myTrackersSubtitle,
),
));
}
if (projectViewModel.havePrivilege(30))
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: SmartWatchInstructions()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(6)
? Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
));
)
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myDoctor,
imagePath: 'my_doc.svg',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
isEnable: projectViewModel.havePrivilege(6)),
));
if (projectViewModel.havePrivilege(28)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AskDoctorHomPage()));
},
child: MedicalProfileItem(
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12)
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).medicines,
imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context).medicinesSubtitle,
isEnable: projectViewModel.havePrivilege(12),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(25)
? Navigator.push(
context,
FadePage(page: VitalSignDetailsScreen()),
)
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).vitalSigns,
imagePath: 'vital_signs.png',
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
isEnable: projectViewModel.havePrivilege(25),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(48)
? Navigator.push(context, FadePage(page: ActiveMedicationsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png',
subTitle: TranslationBase.of(context).myMedicalSubtitle,
isEnable: false,
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14)
? Navigator.push(context, FadePage(page: EyeMeasurementsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
subTitle: TranslationBase.of(context).eyeSubtitle,
isEnable: projectViewModel.havePrivilege(14),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22)
? Navigator.push(context, FadePage(page: InsuranceCard()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).insuranceSubtitle,
isEnable: projectViewModel.havePrivilege(22),
),
));
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).updateInsurance,
imagePath: 'insurance_update_icon_.png',
subTitle: TranslationBase.of(context).updateInsuranceSubtitle,
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18)
? Navigator.push(context, FadePage(page: InsuranceApproval()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
isEnable: projectViewModel.havePrivilege(18),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(23)
? Navigator.push(context, FadePage(page: AllergiesPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context).allergiesSubtitle,
isEnable: projectViewModel.havePrivilege(23),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(26)
? Navigator.push(context, FadePage(page: MyVaccines()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines,
imagePath: 'my_vaccines_icon.png',
subTitle: TranslationBase.of(context).myVaccinesSubtitle,
isEnable: projectViewModel.havePrivilege(26),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(20)
? Navigator.push(context, FadePage(page: HomeReportPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png',
subTitle: TranslationBase.of(context).medicalSubtitle,
isEnable: projectViewModel.havePrivilege(20),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(19)
? Navigator.push(context, FadePage(page: MonthlyReportsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png',
subTitle: TranslationBase.of(context).monthlySubtitle,
isEnable: projectViewModel.havePrivilege(19),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(16)
? Navigator.push(context, FadePage(page: PatientSickLeavePage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context).sickSubtitle,
isEnable: projectViewModel.havePrivilege(16),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(47)
? Navigator.push(context, FadePage(page: MyBalancePage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance,
imagePath: 'check-in.png',
subTitle: TranslationBase.of(context).myBalanceSubtitle,
isEnable: projectViewModel.havePrivilege(47),
),
));
medical.add(MedicalProfileItem(
title: TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png',
subTitle: TranslationBase.of(context).patientCallSubtitle,
isEnable: projectViewModel.havePrivilege(61),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(24)
? Navigator.push(context, FadePage(page: MyTrackers()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers,
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context).myTrackersSubtitle,
isEnable: projectViewModel.havePrivilege(24),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(30)
? Navigator.push(context, FadePage(page: SmartWatchInstructions()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
isEnable: projectViewModel.havePrivilege(30),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(28)
? Navigator.push(context, FadePage(page: AskDoctorHomPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png',
subTitle: TranslationBase.of(context).askYourSubtitle,
),
));
}
isEnable: projectViewModel.havePrivilege(28)),
));
if (projectViewModel.havePrivilege(32) || true) {
medical.add(InkWell(
onTap: () {
@ -520,7 +836,7 @@ class Utils {
AlertDialogBox(
context: context,
confirmMessage:
"Please login with your account first to use this feature",
"Please login with your account first to use this feature",
okText: "OK",
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
@ -536,43 +852,46 @@ class Utils {
));
}
if (projectViewModel.havePrivilege(40)) {
medical.add(InkWell(
onTap: () {
launch('whatsapp://send?phone=18885521858&text=');
},
child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).chatbotSubtitle,
),
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(40)
? launch('whatsapp://send?phone=18885521858&text=')
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).chatbotSubtitle,
isEnable: projectViewModel.havePrivilege(40),
),
));
return medical;
}
static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}){
static Widget loadNetworkImage(
{@required String url, BoxFit fitting = BoxFit.cover}) {
return CachedNetworkImage(
placeholderFadeInDuration: Duration(milliseconds: 250),
fit: fitting,
imageUrl: url,
placeholder: (context, url) => Container(
child: Center(
child: CircularProgressIndicator()
)
),
errorWidget: (context, url, error){
return Icon(Icons.error, color: Colors.red, size: 50,);
}
);
placeholderFadeInDuration: Duration(milliseconds: 250),
fit: fitting,
imageUrl: url,
placeholder: (context, url) =>
Container(child: Center(child: CircularProgressIndicator())),
errorWidget: (context, url, error) {
return Icon(
Icons.error,
color: Colors.red,
size: 50,
);
});
}
}
Widget applyShadow({ Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}){
Widget applyShadow(
{Color color = Colors.grey,
double shadowOpacity = 0.5,
double spreadRadius = 2,
double blurRadius = 7,
Offset offset = const Offset(2, 2),
@required Widget child}) {
return Container(
decoration: BoxDecoration(
boxShadow: [
@ -588,7 +907,6 @@ Widget applyShadow({ Color color = Colors.grey, double shadowOpacity = 0.5, doub
);
}
Future<AuthenticatedUser> userData() async {
var userData = AuthenticatedUser.fromJson(
await AppSharedPreferences().getObject(MAIN_USER));
@ -603,15 +921,15 @@ extension IndexedIterable<E> on Iterable<E> {
}
}
openAppStore({String androidPackageName, String iOSAppID}) async{
if(Platform.isAndroid){
assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter");
if((await FlutterHmsGmsAvailability.isGmsAvailable))
openAppStore({String androidPackageName, String iOSAppID}) async {
if (Platform.isAndroid) {
assert(!(androidPackageName == null),
"Should have valid value in androidPackageName parameter");
if ((await FlutterHmsGmsAvailability.isGmsAvailable))
launch("market://details?id=com.ejada.hmg");
if((await FlutterHmsGmsAvailability.isHmsAvailable))
if ((await FlutterHmsGmsAvailability.isHmsAvailable))
launch("appmarket://details?id=com.ejada.hmg");
}else if(Platform.isIOS){
} else if (Platform.isIOS) {
assert((iOSAppID == null), "Should have valid value in iOSAppID parameter");
launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)");
}

@ -1,52 +1,101 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import '../../../Constants.dart';
import '../text.dart';
class MedicalProfileItem extends StatelessWidget {
MedicalProfileItem(
{@required this.imagePath,
@required this.title,
@required this.subTitle,
hasBadge});
final String imagePath;
final String title;
final String subTitle;
final bool hasBadge = false;
bool isEnable;
MedicalProfileItem({
@required this.imagePath,
@required this.title,
@required this.subTitle,
hasBadge,
this.isEnable = true,
});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
height: MediaQuery.of(context).size.height * 0.14,
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white
),
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(title,
fontSize: 1.5 * SizeConfig.textMultiplier,
color: secondaryColor,
fontWeight: FontWeight.bold),
Texts(subTitle,fontSize: 1.4 * SizeConfig.textMultiplier,),
Align(
alignment:projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
child: Image.asset(
"assets/images/medical/$imagePath",
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
height: MediaQuery.of(context).size.height * 0.143,
width: MediaQuery.of(context).size.height * 0.143,
margin: EdgeInsets.all(0),
decoration: containerColorRadiusBorderWidth(Colors.white, 20, CustomColors.pharmacyGreyColor, 1),
clipBehavior: Clip.antiAlias,
child: Stack(
children: [
Padding(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Align(
// alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
// child: Image.asset(
// "assets/images/medical/$imagePath",
// height: SizeConfig.heightMultiplier * 5,
// width: SizeConfig.heightMultiplier * 5,
// ),
// ),
mFlex(1),
SvgPicture.asset(
"assets/images/new/services/$imagePath",
height: SizeConfig.heightMultiplier * 4,
width: SizeConfig.heightMultiplier * 4,
),
mFlex(2),
Text(
title,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
Container(
width: double.infinity,
child: Row(
children: [
Expanded(
child: AutoSizeText(
subTitle,
maxLines: 1,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
),
],
),
),
mFlex(1),
],
),
)
),
isEnable
? Container()
: Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.withOpacity(0.7),
child: Icon(
Icons.lock_outline,
size: 40,
),
)
],
),
);

@ -222,6 +222,7 @@ flutter:
- assets/images/pharmacy_module/payment/
- assets/images/pharmacy_module/lakum/
- assets/images/new/
- assets/images/new/services/
fonts:
- family: WorkSans

Loading…
Cancel
Save