child Vaccines

merge-update-with-lab-changes
Amjad amireh 5 years ago
parent 37b817e0c8
commit e14d619edd

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

@ -68,6 +68,18 @@ const GET_FINDUS_REQUEST=
///LiveChat
const GET_LIVECHAT_REQUEST=
'Services/Patients.svc/REST/GetPatientICProjects';
///babyInformation
const GET_BABYINFORMATION_REQUEST=
'Services/Community.svc/REST/GetBabyByUserID';
///userInformation
const GET_USERINFORMATION_REQUEST=
'Services/Community.svc/REST/GetUserInformation_New';
///BloodDenote
const GET_CITIES_REQUEST=
'Services/Lists.svc/REST/GetAllCities';

@ -0,0 +1,45 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class List_BabyInformationModel {
int alertBy;
int babyID;
String babyName;
DateTime dOB;
int gender;
String genderDescription;
int patientID;
int userID;
List_BabyInformationModel(
{this.alertBy,
this.babyID,
this.babyName,
this.dOB,
this.gender,
this.genderDescription,
this.patientID,
this.userID});
List_BabyInformationModel.fromJson(Map<String, dynamic> json) {
alertBy = json['AlertBy'];
babyID = json['BabyID'];
babyName = json['BabyName'];
dOB = DateUtil.convertStringToDate(json['DOB']);
gender = json['Gender'];
genderDescription = json['GenderDescription'];
patientID = json['PatientID'];
userID = json['UserID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AlertBy'] = this.alertBy;
data['BabyID'] = this.babyID;
data['BabyName'] = this.babyName;
data['DOB'] = this.dOB;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['PatientID'] = this.patientID;
data['UserID'] = this.userID;
return data;
}
}

@ -0,0 +1,48 @@
class List_UserInformationModel {
int userID;
String mobileNumber;
String nationalID;
String emailAddress;
int patientID;
int patientType;
bool patientOutSA;
int createdBy;
int editedBy;
List_UserInformationModel(
{this.userID,
this.mobileNumber,
this.nationalID,
this.emailAddress,
this.patientID,
this.patientType,
this.patientOutSA,
this.createdBy,
this.editedBy});
List_UserInformationModel.fromJson(Map<String, dynamic> json) {
userID = json['UserID'];
mobileNumber = json['MobileNumber'];
nationalID = json['NationalID'];
emailAddress = json['EmailAddress'];
patientID = json['PatientID'];
patientType = json['PatientType'];
patientOutSA = json['PatientOutSA'];
createdBy = json['CreatedBy'];
editedBy = json['EditedBy'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['UserID'] = this.userID;
data['MobileNumber'] = this.mobileNumber;
data['NationalID'] = this.nationalID;
data['EmailAddress'] = this.emailAddress;
data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType;
data['PatientOutSA'] = this.patientOutSA;
data['CreatedBy'] = this.createdBy;
data['EditedBy'] = this.editedBy;
return data;
}
}

@ -11,7 +11,7 @@ class ChildVaccinesService extends BaseService {
hasError = false;
body['isDentalAllowedBackend'] = false;
body['IsLogin'] = true;
//body['UserID'] = babyInformationModelList[0].userID;
// body['UserID'] = babyInformationModelList[0].userID;
body['UserID'] = 42843;

@ -0,0 +1,34 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import '../base_service.dart';
class UserInformationService extends BaseService{
List<List_UserInformationModel> userInformationModelList = List();
Map<String, dynamic> body = Map();
Future getUserInformationOrders() async {
hasError = false;
// body['isDentalAllowedBackend'] = false;
// body['IsLogin'] = true;
// body['UserID'] = 42843;
await baseAppClient.post(GET_USERINFORMATION_REQUEST,
onSuccess: (dynamic response, int statusCode) {
userInformationModelList.clear();
response['List_UserInformationModel_New'].forEach((vital) {
userInformationModelList.add(List_UserInformationModel.fromJson(vital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -0,0 +1,29 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
class ChildVaccinesViewModel extends BaseViewModel{
ChildVaccinesService _childVaccinesService = locator<ChildVaccinesService>();
List<List_BabyInformationModel> get babyInformationModelList=> _childVaccinesService.babyInformationModelList;//BabyInformationModelList;
getBabyInformatioRequestOrders() async {
setState(ViewState.Busy);
await _childVaccinesService.getAllBabyInformationOrders();
if (_childVaccinesService.hasError) {
error = _childVaccinesService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,25 @@
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/user_information_service.dart';
import '../../../locator.dart';
import '../base_view_model.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
class UserInformationViewModel extends BaseViewModel {
UserInformationService _userInformationService =
locator<UserInformationService>();
List<List_UserInformationModel> get userInformationModelList =>
_userInformationService.userInformationModelList;
getUserInformatioRequestOrders() async {
setState(ViewState.Busy);
await _userInformationService.getUserInformationOrders();
if (_userInformationService.hasError) {
error = _userInformationService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/service/qr_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:get_it/get_it.dart';
@ -10,6 +11,8 @@ import 'core/service/AuthenticatedUserObject.dart';
import 'core/service/appointment_rate_service.dart';
import 'core/service/blood/blood_details_servies.dart';
import 'core/service/blood/blood_donation_service.dart';
import 'core/service/childvaccines/child_vaccines_service.dart';
import 'core/service/childvaccines/user_information_service.dart';
import 'core/service/contactus/finadus_service.dart';
import 'core/service/contactus/livechat_service.dart';
import 'core/service/dashboard_service.dart';
@ -37,6 +40,7 @@ import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'core/viewModels/appointment_rate_view_model.dart';
import 'core/viewModels/blooddonation/blood_details_view_model.dart';
import 'core/viewModels/blooddonation/booddonation_view_model.dart';
import 'core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'core/viewModels/contactus/findus_view_model.dart';
import 'core/viewModels/contactus/livechat_view_model.dart';
import 'core/viewModels/er/am_request_view_model.dart';
@ -112,6 +116,8 @@ void setupLocator() {
locator.registerLazySingleton(() => BloodDonationService());
locator.registerLazySingleton(() => BloodDetailsService());
locator.registerLazySingleton(() => ChildVaccinesService());
locator.registerLazySingleton(() => UserInformationService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -139,6 +145,8 @@ void setupLocator() {
locator.registerFactory(() => LiveChatViewModel());
locator.registerFactory(() => BloodDonationViewModel());
locator.registerFactory(() => BloodDeatailsViewModel());
locator.registerFactory(() => ChildVaccinesViewModel());
locator.registerFactory(() => UserInformationViewModel());
locator.registerFactory(() => H2OViewModel());
locator.registerFactory(() => BloodSugarViewMode());

@ -87,7 +87,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
children: [
Texts(
// TranslationBase.of(context).advancePaymentLabel,
"Enter the required information, In order to register for Blood Donation Service",
"Enter the required information, In order to register for Blood Donation Service",//+model.user.firstName,
textAlign: TextAlign.center,
),
SizedBox(

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class ChildPage extends StatefulWidget {
//final List<List_BabyInformationModel> babyInformationModelList;
@ -38,14 +39,16 @@ class _ChildPageState extends State<ChildPage> with SingleTickerProviderStateMix
color: Colors.white,
),
width: 150,
child: Column(
children: [
Row(children:[Texts("CHILD NAME"),]),
Row(children:[Texts(model.babyInformationModelList[index].babyName),]),
Row(
children: [IconButton(
icon: Icon(Icons.phone,color: Colors.red,),
icon: new Image.asset('assets/images/new-design/female.png'),
tooltip: 'Increase volume by 10',
onPressed: () {
setState(() {
@ -56,7 +59,7 @@ class _ChildPageState extends State<ChildPage> with SingleTickerProviderStateMix
),
Texts(model.babyInformationModelList[index].babyName),
IconButton(
icon: Icon(Icons.phone,color: Colors.red,),
icon: Icon(Icons.remove_red_eye_outlined,color: Colors.red,),
tooltip: 'Increase volume by 10',
onPressed: () {
setState(() {
@ -68,7 +71,7 @@ class _ChildPageState extends State<ChildPage> with SingleTickerProviderStateMix
),
Row(children:[Texts("Birthday"),]),
Row(children:[IconButton(
icon: Icon(Icons.phone,color: Colors.red,),
icon: new Image.asset('assets/images/new-design/calender-secondary.png'),
tooltip: 'Increase volume by 10',
onPressed: () {
setState(() {
@ -77,9 +80,9 @@ class _ChildPageState extends State<ChildPage> with SingleTickerProviderStateMix
});
},
),
Texts(model.babyInformationModelList[index].dOB.toString()),]),
Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]),
Row(children:[IconButton(
icon: Icon(Icons.phone,color: Colors.red,),
icon: new Image.asset('assets/images/new-design/garbage.png'),
tooltip: 'Increase volume by 10',
onPressed: () {
setState(() {

@ -1,28 +1,35 @@
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/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ChildVaccinesPage extends StatefulWidget {
@override
_ChildVaccinesPageState createState() => _ChildVaccinesPageState();
}
class _ChildVaccinesPageState extends State<ChildVaccinesPage> {
class _ChildVaccinesPageState extends State<ChildVaccinesPage>
with SingleTickerProviderStateMixin{
TextEditingController titleController = TextEditingController();
var checkedValue=false;
String addEmail="";
@override
Widget build(BuildContext context) {
return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getCities(),//model.getHospitals(),
return BaseView<UserInformationViewModel>(
onModelReady: (model) => model.getUserInformatioRequestOrders(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment,
@ -98,7 +105,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage> {
label: "UPDATE EMAIL",
//
onTap: (){
model.user.emailAddress=model.user.emailAddress+addEmail.toString();
model.user.emailAddress=addEmail.toString();
AppToast.showSuccessToast(
message: "Email updated");
// bloodDetails.city=_selectedHospital.toString();
@ -119,12 +126,18 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage> {
color: Color.fromRGBO(63, 72, 74, 1,),
label: " VIEW LIST OF CHILDREN",
//
onTap: (){
onTap: () => Navigator.push(
context,
FadePage(
page: ChildPage(),
// bloodDetails.city=_selectedHospital.toString();
//ChildPage(babyInformationModelList:model.BabyInformationModelList)
// HospitalsPage(
// findusHospitalModelList: model.FindusHospitalModelList,
// )
// bloodDetails.
},
),
),
),

Loading…
Cancel
Save