merger DQ live and fix some issues on Child Vaccines

merge-requests/224/merge
Mohammad Aljammal 5 years ago
parent a556e8c1f8
commit fa01d132c7

@ -123,7 +123,16 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/new-design/my_file_bottom_bar.png', 'assets/images/new-design/my_file_bottom_bar.png',
title: TranslationBase.of(context).myMedicalFile, title: TranslationBase.of(context).myMedicalFile,
), ),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: LiveCareHome(),
),
),
imageLocation: 'assets/images/new-design/liveCare_ar_bg.png',
title: TranslationBase.of(context).livecare,
),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -148,7 +157,15 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/al-habib_online_payment_service_icon.png', 'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).onlinePaymentService, title: TranslationBase.of(context).onlinePaymentService,
), ),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(),
),
imageLocation:
'assets/images/al-habib_online_payment_service_icon.png',
title: 'Covid-19- Drive-Thru Test',
),
ServicesContainer( ServicesContainer(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -163,7 +180,37 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
imageLocation: 'assets/images/emergency_service_image.png', imageLocation: 'assets/images/emergency_service_image.png',
title: TranslationBase.of(context).emergencyService, title: TranslationBase.of(context).emergencyService,
), ),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: ParkingPage(),
),
),
imageLocation: 'assets/images/pharmacy_logo.png',
title: 'Pharmacy'),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: InsuranceUpdate(),
),
),
imageLocation:
'assets/images/medical/insurance_card_icon.png',
title: TranslationBase.of(context).updateInsurance,
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: authUser.patientID == null
? EReferralIndexPage()
: EReferralPage()),
),
imageLocation: 'assets/images/ereferral_service_icon.png',
title: 'E-Referral',
),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -175,7 +222,15 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/new-design/family_menu_icon_red.png', 'assets/images/new-design/family_menu_icon_red.png',
title: 'My Family', title: 'My Family',
), ),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: ChildVaccinesPage()),
),
imageLocation:
'assets/images/new-design/children_vaccines_icon.png',
title: 'Child Vaccines',
),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -187,7 +242,61 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/new-design/upcoming_icon_bottom_bar.png', 'assets/images/new-design/upcoming_icon_bottom_bar.png',
title: TranslationBase.of(context).todoList, title: TranslationBase.of(context).todoList,
), ),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: SymptomInfo()),
),
imageLocation: 'assets/images/new-design/body_icon.png',
title: 'Symptom Checker'),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: BloodDonationPage()),
),
imageLocation: 'assets/images/new-design/blood_icon.png',
title: 'Blood Donation',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: (HealthCalculators()),
),
),
imageLocation:
'assets/images/new-design/health_calculator_icon.png',
title: 'Health Calculators',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: HealthConverter(),
),
),
imageLocation:
'assets/images/new-design/health_convertor_icon.png',
title: 'Health Converter',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(
page: H2OPageIndexPage(),
),
),
imageLocation: 'assets/images/new-design/water_icon.png',
title: 'H2O',
),
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(),
),
imageLocation: 'assets/images/new-design/smartwatch_icon.png',
title: TranslationBase.of(context).smartWatches,
),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,

@ -0,0 +1,111 @@
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ChildDetailsWidget extends StatelessWidget {
final ChildVaccinesViewModel model;
final List_BabyInformationModel babyInfo;
DeleteBaby deleteBaby = DeleteBaby();
ChildDetailsWidget({this.model, this.babyInfo});
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 5, right: 5, bottom: 10),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.white,
),
padding: EdgeInsets.all(12),
width: 200,
//double.infinity,
child: Column(
children: [
Row(children: [
Texts("CHILD NAME"),
]),
Row(children: [
Texts(babyInfo.babyName.trim()),
]),
Row(children: [
IconButton(
icon: Image.asset(babyInfo.gender == 1
? 'assets/images/new-design/male.png'
: 'assets/images/new-design/female.png'),
tooltip: '',
onPressed: () {
// setState(() {
// // _volume += 10;
// // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
// });
},
),
Texts(babyInfo.genderDescription),
IconButton(
icon: Icon(
Icons.remove_red_eye,
color: Colors.red,
),
tooltip: '',
onPressed: () {
Navigator.push(
context,
FadePage(
page: VaccinationTablePage(),
),
);
},
)
]),
Row(children: [
Texts("Birthday"),
]),
Row(
children: [
IconButton(
icon: new Image.asset(
'assets/images/new-design/calender-secondary.png'),
tooltip: '',
),
Texts(
DateUtil.yearMonthDay(babyInfo.dOB),
),
],
),
Row(children: [
IconButton(
icon: new Image.asset('assets/images/new-design/garbage.png'),
tooltip: '',
onPressed: () async {
await model.deleteBabyOrders(newChild: deleteBaby);
deleteBaby.babyID = babyInfo.babyID;
await model.deleteBabyOrders(newChild: deleteBaby);
if (model.isDeleted) {
AppToast.showSuccessToast(message: "Record Deleted");
Navigator.pop(context, model.isDeleted);
} else {
//TODO handling error
}
},
),
Texts("Delete"),
]),
SizedBox(
height: 12,
),
],
),
);
}
}

@ -13,6 +13,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'ChidDetailsWidget.dart';
import 'dialogs/delete_child.dart'; import 'dialogs/delete_child.dart';
class ChildPage extends StatefulWidget { class ChildPage extends StatefulWidget {
@ -22,181 +23,75 @@ class ChildPage extends StatefulWidget {
class _ChildPageState extends State<ChildPage> class _ChildPageState extends State<ChildPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
DeleteBaby deleteBaby = DeleteBaby(); DeleteBaby deleteBaby = DeleteBaby();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var checkedValue = true; var checkedValue = true;
return BaseView<ChildVaccinesViewModel>( return BaseView<ChildVaccinesViewModel>(
onModelReady: (model) => model.getNewUserOrders(), onModelReady: (model) => model.getNewUserOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: " Vaccination", appBarTitle: " Vaccination",
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 15, right: 15, top: 70), margin: EdgeInsets.only(left: 10, right: 10, top: 10),
child: Column( child: Column(
children: [ children: [
...List.generate( GridView.builder(
model.babyInformationModelList.length, shrinkWrap: true,
(index) => Container( primary: false,
margin: EdgeInsets.only( physics: NeverScrollableScrollPhysics(),
left: 0, right: 0, bottom: 20), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
decoration: BoxDecoration( childAspectRatio: MediaQuery.of(context).size.width /
shape: BoxShape.rectangle, (MediaQuery.of(context).size.height / 1.25),
border: Border.all( ),
color: Colors.white, width: 0.5), itemCount: model.babyInformationModelList.length,
borderRadius: itemBuilder: (BuildContext context, int index) {
BorderRadius.all(Radius.circular(5)), return ChildDetailsWidget(
color: Colors.white, model: model,
), babyInfo: model.babyInformationModelList[index],
padding: EdgeInsets.all(12), );
width: 200,//double.infinity,
child: Column(
children: [
Row(children: [
Texts("CHILD NAME"),
]),
Row(children: [
Texts(model
.babyInformationModelList[index]
.babyName
.trim()),
]),
Row(children: [
IconButton(
icon: Image.asset(model
.babyInformationModelList[
index]
.gender ==
1
? 'assets/images/new-design/male.png'
: 'assets/images/new-design/female.png'),
tooltip: '',
onPressed: () {
setState(() {
// _volume += 10;
// launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
});
},
),
Texts(model
.babyInformationModelList[index]
.genderDescription),
IconButton(
icon: Icon(
Icons.remove_red_eye,
color: Colors.red,
),
tooltip: '',
onPressed: () {
Navigator.push(
context,
FadePage(
page: VaccinationTablePage(),
),
);
},
)
]),
Row(children: [
Texts("Birthday"),
]),
Row(children: [
IconButton(
icon: new Image.asset(
'assets/images/new-design/calender-secondary.png'),
tooltip: '',
onPressed: () {
setState(() {
});
},
),
Texts(DateUtil.yearMonthDay(model
.babyInformationModelList[index]
.dOB)),
]),
Row(children: [
IconButton(
icon: new Image.asset(
'assets/images/new-design/garbage.png'),
tooltip: '',
onPressed: ()async {
//=====================
await model.deleteBabyOrders(newChild:deleteBaby );
deleteBaby.babyID=model.babyInformationModelList[index]
.babyID;
await model.deleteBabyOrders(newChild:deleteBaby );
if(model.isDeleted){
AppToast.showSuccessToast(message: "Record Deleted");
Navigator.pop(context,model.isDeleted);
}else{
//TODO handling error
}
},
),
Texts("Delete"),
]),
SizedBox(
height: 12,
),
],
),
),
)
],
))
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue == false
? Colors.white24
: Color.fromRGBO(
63,
72,
74,
1,
),
label: "ADD NEW CHILD ",
//
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddNewChildPage(),
),
).then((value) {
if (value) model.getNewUserOrders();
});
}, },
), ),
), SizedBox(
)); height: 15,
),
],
),
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue == false
? Colors.white24
: Color.fromRGBO(
63,
72,
74,
1,
),
label: "ADD NEW CHILD ",
//
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddNewChildPage(),
),
).then((value) {
if (value) model.getNewUserOrders();
});
},
),
),
),
);
} }
} }

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
@ -13,214 +12,150 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ChildVaccinesPage extends StatefulWidget { class ChildVaccinesPage extends StatefulWidget {
@override @override
_ChildVaccinesPageState createState() => _ChildVaccinesPageState(); _ChildVaccinesPageState createState() => _ChildVaccinesPageState();
} }
class _ChildVaccinesPageState extends State<ChildVaccinesPage> class _ChildVaccinesPageState extends State<ChildVaccinesPage>
with SingleTickerProviderStateMixin{ with SingleTickerProviderStateMixin {
TextEditingController titleController = TextEditingController(); TextEditingController titleController = TextEditingController();
var checkedValue=false; var checkedValue = false;
String addEmail=""; String addEmail = "";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<UserInformationViewModel>( return BaseView<UserInformationViewModel>(
onModelReady: (model) => model.getUserInformationRequestOrders(), onModelReady: (model) => model.getUserInformationRequestOrders(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, appBarTitle: " Vaccination",
body: SingleChildScrollView( //TranslationBase.of(context).advancePayment,
physics: ScrollPhysics(), body: SingleChildScrollView(
child: Column( physics: ScrollPhysics(),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.spaceAround,
SizedBox( children: [
height: 20, SizedBox(
), height: 20,
),
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child:Container( child: Container(
child: Texts("Welcome back",fontSize: 20,), child: Texts(
) , "Welcome back",
fontSize: 20,
), ),
Divider(color:Colors.black , indent: 10, ),
endIndent: 10,), ),
SizedBox( Divider(
height: 20, color: Colors.black,
), indent: 10,
Padding( endIndent: 10,
padding: const EdgeInsets.all(10.0), ),
child:Container( SizedBox(
child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,), height: 20,
) , ),
), Padding(
padding: const EdgeInsets.all(10.0),
Divider(color:Colors.black , indent: 10, child: Container(
endIndent: 10,), child: Texts(
Padding( "Please ensure that the email address is up-to-date and process to view the schedule",
padding: const EdgeInsets.all(10.0), fontSize: 20,
child:Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
fillColor: Colors.red,
hintText: model.user.emailAddress,
controller: titleController,
fontSize: 20,
hintColor: Colors.black,
fontWeight: FontWeight.w600,
onChanged: (text) {
addEmail=text;
model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true;
},
validator: (value) {
if (value == null)
{
return model.user.emailAddress;
}
else
{
return model.user.emailAddress;}
},
),
),
), ),
Container( ),
height: MediaQuery.of(context).size.height * 0.12, ),
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,),
label: "UPDATE EMAIL",
//
onTap: (){
model.user.emailAddress=addEmail.toString();
AppToast.showSuccessToast(
message: "Email updated");
// bloodDetails.city=_selectedHospital.toString();
// bloodDetails.
},
), Divider(
color: Colors.black,
indent: 10,
endIndent: 10,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
fillColor: Colors.red,
hintText: model.user.emailAddress,
controller: titleController,
fontSize: 20,
hintColor: Colors.black,
fontWeight: FontWeight.w600,
onChanged: (text) {
addEmail = text;
model.user.emailAddress == addEmail
? checkedValue = false
: checkedValue = true;
},
validator: (value) {
if (value == null) {
return model.user.emailAddress;
} else {
return model.user.emailAddress;
}
},
), ),
Container( ),
height: MediaQuery.of(context).size.height * 0.12, ),
width: double.infinity, Container(
height: MediaQuery.of(context).size.height * 0.10,
padding: EdgeInsets.all(15), width: double.infinity,
child: SecondaryButton( padding: EdgeInsets.all(15),
textColor: Colors.white, child: SecondaryButton(
color: Color.fromRGBO(63, 72, 74, 1,), textColor: Colors.white,
label: " VIEW LIST OF CHILDREN", color: checkedValue == false
// ? Colors.white24
onTap: () => Navigator.push( : Color.fromRGBO(
context, 63,
FadePage( 72,
page: ChildPage(), 74,
1,
),
), ),
label: "UPDATE EMAIL",
//
), onTap: () {
), model.user.emailAddress = addEmail.toString();
AppToast.showSuccessToast(message: "Email updated");
// Texts( // bloodDetails.city=_selectedHospital.toString();
// // TranslationBase.of(context).advancePaymentLabel,
// model.user.emailAddress, // bloodDetails.
// textAlign: TextAlign.center, },
// ), ),
SizedBox( ),
height: 12, Container(
), height: MediaQuery.of(context).size.height * 0.10,
SizedBox( width: double.infinity,
height: 12, padding: EdgeInsets.all(15),
), child: SecondaryButton(
SizedBox( textColor: Colors.white,
height: 12, color: Color.fromRGBO(
), 63,
72,
SizedBox( 74,
height: 12, 1,
),
SizedBox(
height: 12,
), ),
label: " VIEW LIST OF CHILDREN",
SizedBox( //
height: 10, onTap: () => Navigator.push(
context,
FadePage(
page: ChildPage(),
),
), ),
// Row( ),
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Center(
// child: Container(
// color: Colors.white,
// width: 350,
// child: InkWell(
// onTap: () {
// showDialog(
// context: context,
// builder: (_) =>
// AssetGiffyDialog(
// title: Text(
// "",
// style: TextStyle(
// fontSize: 22.0,
// fontWeight:
// FontWeight
// .w600),
// ),
// image: Image.asset(
// 'assets/images/BloodChrt_EN.png'),
// buttonCancelText:
// Text('cancel'),
// buttonCancelColor:
// Colors.grey,
// onlyCancelButton: true,
// ));
// },
// child: Container(
// width: 250,
// height: 200,
// child:Image.asset(
// 'assets/images/BloodChrt_EN.png')),
// ),
// ),
// ),
// ],
// ),
SizedBox(
height: MediaQuery.of(context).size.height * 0.15,
)
],
), ),
SizedBox(
height: MediaQuery.of(context).size.height * 0.15,
)
],
), ),
), ),
),
); );
} }
} }

@ -1,8 +1,6 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.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/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
@ -24,8 +22,6 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../locator.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
final Function goToMyProfile; final Function goToMyProfile;
@ -36,22 +32,9 @@ class HomePage extends StatefulWidget {
} }
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
ToDoCountProviderModel toDoProvider;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getToDoCount();
});
super.initState();
}
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getPatientRadOrders(), onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
@ -72,7 +55,7 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage(
'assets/images/dq_home_page_bg_image.png'), 'assets/images/dashboard_top_bg.png'),
fit: BoxFit.cover), fit: BoxFit.cover),
), ),
child: Stack( child: Stack(
@ -83,7 +66,7 @@ class _HomePageState extends State<HomePage> {
right: 5, right: 5,
child: Container( child: Container(
width: width:
MediaQuery.of(context).size.width * 0.8, MediaQuery.of(context).size.width * 0.8,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -98,7 +81,7 @@ class _HomePageState extends State<HomePage> {
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
color: color:
Colors.white.withOpacity(0.3), Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5))), Radius.circular(5))),
child: Container( child: Container(
@ -109,17 +92,17 @@ class _HomePageState extends State<HomePage> {
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
fontSize: 18.0)), fontSize: 18.0)),
Row( Row(
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 15.0, left: 3.5, right: 3.5), top: 15.0, left: 3.5, right: 3.5),
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg', 'assets/images/new-design/covid-19-car.svg',
width: 45.0, width: 45.0,
height: 45.0), height: 45.0),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
@ -132,34 +115,34 @@ class _HomePageState extends State<HomePage> {
color: Colors color: Colors
.white, .white,
fontWeight: fontWeight:
FontWeight FontWeight
.bold, .bold,
fontSize: fontSize:
16.0)), 16.0)),
ButtonTheme( ButtonTheme(
shape: shape:
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius BorderRadius
.circular( .circular(
5.0), 5.0),
), ),
minWidth: MediaQuery.of( minWidth: MediaQuery.of(
context) context)
.size .size
.width * .width *
0.15, 0.15,
height: 25.0, height: 25.0,
child: RaisedButton( child: RaisedButton(
color: Colors color: Colors
.red[800], .red[800],
textColor: textColor:
Colors.white, Colors.white,
disabledTextColor: disabledTextColor:
Colors.white, Colors.white,
disabledColor: disabledColor:
new Color( new Color(
0xFFbcc2c4), 0xFFbcc2c4),
onPressed: () { onPressed: () {
navigateToCovidDriveThru(); navigateToCovidDriveThru();
}, },
@ -167,7 +150,7 @@ class _HomePageState extends State<HomePage> {
"BOOK NOW", "BOOK NOW",
style: TextStyle( style: TextStyle(
fontSize: fontSize:
12.0)), 12.0)),
), ),
), ),
], ],
@ -193,11 +176,11 @@ class _HomePageState extends State<HomePage> {
.withOpacity(0.3), .withOpacity(0.3),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5))), Radius.circular(5))),
child: SvgPicture.asset( child: SvgPicture.asset(
projectViewModel.isArabic projectViewModel.isArabic
? 'assets/images/new-design/livecare_arabic_logo.svg' ? 'assets/images/new-design/livecare_arabic_logo.svg'
: 'assets/images/new-design/liveCare_white_logo.svg', : 'assets/images/new-design/liveCare_white_logo.svg',
), ),
), ),
), ),
), ),
@ -215,245 +198,240 @@ class _HomePageState extends State<HomePage> {
top: 155, top: 155,
left: MediaQuery.of(context).size.width * left: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation ==
Orientation.landscape Orientation.landscape
? 0.02 ? 0.02
: 0.03), : 0.03),
right: MediaQuery.of(context).size.width * right: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation ==
Orientation.landscape Orientation.landscape
? 0.02 ? 0.02
: 0.03), : 0.03),
child: (!model.isLogin ) child: (!model.isLogin && projectViewModel.user == null)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: 160, height: 125,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
color: Colors.transparent, width: 0.5), color: Colors.transparent, width: 0.5),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(9)), BorderRadius.all(Radius.circular(9)),
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage(
'assets/images/bg_graphic.png'), 'assets/images/bg_graphic.png'),
fit: BoxFit.cover)), fit: BoxFit.cover)),
child: Container( child: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( Texts(
TranslationBase.of(context).myMedicalFile, TranslationBase.of(context).myMedicalFile,
color: Colors.black87, color: Colors.black87,
bold: true, bold: true,
fontSize: 23, fontSize: 23,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
),
Texts(
TranslationBase.of(context)
.myMedicalFileSubTitle,
color: Colors.black,
fontSize: 16,
),
Align(
alignment: projectViewModel.isArabic
? Alignment.bottomRight
: Alignment.bottomLeft,
child: InkWell(
onTap: () {
widget.goToMyProfile();
},
child: Container(
margin: EdgeInsets.all(2),
width: 90,
height: 30,
decoration: BoxDecoration(
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(9)),
), ),
Texts( child: Center(
TranslationBase.of(context) child: Texts(
.myMedicalFileSubTitle, TranslationBase.of(context)
color: Colors.black, .viewMore,
fontSize: 16, color: Colors.white,
fontSize: 12,
),
), ),
Align( ),
alignment: projectViewModel.isArabic ),
? Alignment.bottomLeft )
: Alignment.bottomRight, ],
child: InkWell( ),
onTap: () { ),
widget.goToMyProfile(); )
}, : Container(
child: Container( width: double.infinity,
margin: EdgeInsets.all(2), height: 130,
width: MediaQuery.of(context) decoration: BoxDecoration(
.size color: HexColor('#A59E9E'),
.width * shape: BoxShape.rectangle,
0.30, border: Border.all(
height: 30, color: Colors.transparent, width: 0.5),
decoration: BoxDecoration( borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage(
image: ExactAssetImage(
'assets/images/bg_graphic.png'),
fit: BoxFit.cover),
),
child: Container(
margin: EdgeInsets.all(5),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
if (model.user != null)
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 8,
),
Texts(
model.user.firstName +
" " +
model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
Texts(
'${model.user.patientID}',
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, fontSize: 14,
border: Border.all(
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(4)),
), ),
child: Center( SizedBox(
child: Texts( height: 5,
TranslationBase.of(context)
.viewMore,
color: Theme.of(context)
.primaryColor,
fontSize: 14,
),
), ),
Texts(
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}',
color: Colors.grey[100],
fontWeight: FontWeight.normal,
fontSize: 14,
),
],
),
),
InkWell(
onTap: () {
widget.goToMyProfile();
},
child: Container(
margin: EdgeInsets.all(2),
width: 90,
height: 30,
decoration: BoxDecoration(
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(5),
), ),
), ),
) child: Center(
], child: Texts(
), TranslationBase.of(context)
), .viewMore,
) color: Colors.white,
: Container( fontSize: 12,
width: double.infinity, ),
height: projectViewModel.isArabic ? 180 : 150, ),
decoration: BoxDecoration( ),
color: Theme.of(context).primaryColor, )
shape: BoxShape.rectangle, ],
border: Border.all(
color: Colors.transparent, width: 0.5),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage(
image: ExactAssetImage(
'assets/images/bg_graphic.png'),
fit: BoxFit.cover),
), ),
child: Container( Row(
margin: EdgeInsets.all(5), //crossAxisAlignment: CrossAxisAlignment.center,
child: Column( //mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Row( Expanded(
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
if (model.user != null) Image.asset(
Expanded( 'assets/images/height_icon.png',
child: Column( width: 35,
crossAxisAlignment: height: 40,
CrossAxisAlignment.start, ),
children: <Widget>[ Texts(
SizedBox( "${model.heightCm}",
height: 8, color: Colors.white,
),
Texts(
model.user.firstName +
" " +
model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
Texts(
'${model.user.patientID}',
color: Colors.white,
fontSize: 14,
),
SizedBox(
height: 5,
),
Texts(
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}',
color: Colors.grey[100],
fontWeight: FontWeight.normal,
fontSize: 14,
),
],
),
),
InkWell(
onTap: () {
widget.goToMyProfile();
},
child: Container(
margin: EdgeInsets.all(2),
width: 90,
height: 30,
decoration: BoxDecoration(
color: HexColor('#D81A2E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(5),
),
),
child: Center(
child: Texts(
TranslationBase.of(context)
.viewMore,
color: Colors.white,
fontSize: 12,
),
),
),
) )
], ],
), ),
Row( ),
//crossAxisAlignment: CrossAxisAlignment.center, SizedBox(
//mainAxisAlignment: MainAxisAlignment.spaceAround, width: 3,
),
Expanded(
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Expanded( Image.asset(
child: Row( 'assets/images/weight_icon.png',
mainAxisAlignment: width: 25,
MainAxisAlignment.spaceBetween, height: 40,
children: <Widget>[
Image.asset(
'assets/images/height_icon.png',
width: 35,
height: 40,
),
Texts(
"${model.heightCm}",
color: Colors.white,
)
],
),
),
SizedBox(
width: 3,
),
Expanded(
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Image.asset(
'assets/images/weight_icon.png',
width: 25,
height: 40,
),
Texts(
'${model.weightKg}',
color: Colors.white,
)
],
),
), ),
SizedBox( Texts(
width: 3, '${model.weightKg}',
), color: Colors.white,
Expanded( )
child: Row( ],
mainAxisAlignment: ),
MainAxisAlignment.spaceBetween, ),
children: <Widget>[ SizedBox(
Image.asset( width: 3,
'assets/images/blood_icon.png', ),
width: 35, Expanded(
height: 40, child: Row(
), mainAxisAlignment:
Texts( MainAxisAlignment.spaceBetween,
'${model.bloadType}', children: <Widget>[
color: Colors.white, Image.asset(
) 'assets/images/blood_icon.png',
], width: 35,
), height: 40,
), ),
Texts(
'${model.bloadType}',
color: Colors.white,
)
], ],
) ),
], ),
), ],
), )
), ],
),
),
),
), ),
], ],
), ),
@ -652,8 +630,8 @@ class _HomePageState extends State<HomePage> {
context, context,
FadePage( FadePage(
page: ErOptions( page: ErOptions(
isAppbar: true, isAppbar: true,
))), ))),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -721,23 +699,25 @@ class _HomePageState extends State<HomePage> {
child: Container(), child: Container(),
), ),
Texts( Texts(
TranslationBase.of(context).viewAll, TranslationBase.of(context).viewMore,
color: Colors.white, color: Colors.white,
bold: true, //fontWeight: FontWeight.normal,
) )
], ],
), ),
), ),
height: 100, height: 100,
imageName: 'ask_doctor_bg.png', imageName: 'contact_us_bg.png',
//color: Colors.grey[700], opacity: 0.5,
color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, FadePage(page: AllHabibMedicalService())), context, FadePage(page: AllHabibMedicalService())),
), ),
DashboardItem( DashboardItem(
opacity:1.0,
onTap: () { onTap: () {
// Navigator.push(
// context, FadePage(page: FeedbackHomePage()));
Navigator.push( Navigator.push(
context, FadePage(page: ContactUsPage())); context, FadePage(page: ContactUsPage()));
}, },
@ -762,15 +742,16 @@ class _HomePageState extends State<HomePage> {
child: Container(), child: Container(),
), ),
Texts( Texts(
TranslationBase.of(context).viewAll, TranslationBase.of(context).viewMore,
color: Colors.white, color: Colors.white,
bold: true, fontWeight: FontWeight.normal,
) )
], ],
), ),
), ),
height: 100, height: 100,
imageName: 'rectangle.png', imageName: 'contact_us_bg.png',
opacity: 0.5,
color: Colors.grey[700], color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
), ),
@ -792,37 +773,20 @@ class _HomePageState extends State<HomePage> {
Navigator.push(context, Navigator.push(context,
MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); 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 { class DashboardItem extends StatelessWidget {
const DashboardItem( const DashboardItem(
{this.hasBorder = false, {this.hasBorder = false,
this.imageName, this.imageName,
@required this.child, @required this.child,
this.onTap, this.onTap,
Key key, Key key,
this.width, this.width,
this.height, this.height,
this.color, this.color,
this.opacity = 0.4, this.opacity = 0.4,
this.hasColorFilter = true, this.margin, this.icon}) this.hasColorFilter = true})
: super(key: key); : super(key: key);
final bool hasBorder; final bool hasBorder;
final String imageName; final String imageName;
@ -832,8 +796,6 @@ class DashboardItem extends StatelessWidget {
final double height; final double height;
final Color color; final Color color;
final double opacity; final double opacity;
final double margin;
final Widget icon;
final bool hasColorFilter; final bool hasColorFilter;
@override @override
@ -845,13 +807,13 @@ class DashboardItem extends StatelessWidget {
height: height != null height: height != null
? height ? height
: MediaQuery.of(context).orientation == Orientation.portrait : MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.height * 0.19 ? MediaQuery.of(context).size.height * 0.19
: MediaQuery.of(context).size.height * 0.35, : MediaQuery.of(context).size.height * 0.35,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder
? color != null ? color != null
? color ? color
: Colors.black.withOpacity(opacity) : HexColor('#050705').withOpacity(opacity)
: Colors.white, : Colors.white,
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
border: hasBorder border: hasBorder
@ -859,14 +821,13 @@ class DashboardItem extends StatelessWidget {
: Border.all(width: 0.0, color: Colors.transparent), : Border.all(width: 0.0, color: Colors.transparent),
image: imageName != null image: imageName != null
? DecorationImage( ? DecorationImage(
image: ExactAssetImage('assets/images/$imageName'), image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: new ColorFilter.mode( colorFilter: hasColorFilter ? new ColorFilter.mode(
Colors.black.withOpacity(opacity), BlendMode.dstIn), Colors.black.withOpacity(0.2), BlendMode.dstIn) : null,
) )
: icon, : null,
), ),
margin: EdgeInsets.all(margin),
child: Center( child: Center(
child: child, child: child,
), ),

Loading…
Cancel
Save