diff --git a/lib/config/config.dart b/lib/config/config.dart index 0f92db66..36e1b086 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -69,19 +69,25 @@ const GET_FINDUS_REQUEST= const GET_LIVECHAT_REQUEST= 'Services/Patients.svc/REST/GetPatientICProjects'; -///babyInformation -const GET_BABYINFORMATION_REQUEST= - 'Services/Community.svc/REST/GetBabyByUserID'; +///Get Baby By User ID +const GET_BABY_BY_USER_ID= 'Services/Community.svc/REST/GetBabyByUserID'; ///userInformation const GET_USERINFORMATION_REQUEST= 'Services/Community.svc/REST/GetUserInformation_New'; +///newUserId +const GET_NEW_USER_REQUEST= + 'Services/Community.svc/REST/CreateNewUser_New'; ///addNewChild const GET_NEWCHILD_REQUEST= 'Services/Community.svc/REST/CreateNewBaby'; +///delteChild +const DELETE_CHILD_REQUEST= + 'Services/Community.svc/REST/DeleteBaby'; + ///addNewTABLE const GET_TABLE_REQUEST= diff --git a/lib/core/model/childvaccines/create_new_user_model.dart b/lib/core/model/childvaccines/create_new_user_model.dart new file mode 100644 index 00000000..980567e2 --- /dev/null +++ b/lib/core/model/childvaccines/create_new_user_model.dart @@ -0,0 +1,165 @@ +class CreateNewUser_New { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null htmlResult; + bool isHMGPatient; + bool isRegister; + bool isSendSMS; + Null listBabyInformationModel; + Null listBabyNeedReminderModel; + Null listCreateVaccinationTableModel; + Null listHisPatientModel; + Null listUserInformationModel; + Null listUserInformationModelNew; + Null listVaccinationTableModel; + Null tokinID; + int userID; + Null verificationCode; + + CreateNewUser_New( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.htmlResult, + this.isHMGPatient, + this.isRegister, + this.isSendSMS, + this.listBabyInformationModel, + this.listBabyNeedReminderModel, + this.listCreateVaccinationTableModel, + this.listHisPatientModel, + this.listUserInformationModel, + this.listUserInformationModelNew, + this.listVaccinationTableModel, + this.tokinID, + this.userID, + this.verificationCode}); + + CreateNewUser_New.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + htmlResult = json['HtmlResult']; + isHMGPatient = json['IsHMGPatient']; + isRegister = json['IsRegister']; + isSendSMS = json['IsSendSMS']; + listBabyInformationModel = json['List_BabyInformationModel']; + listBabyNeedReminderModel = json['List_BabyNeedReminderModel']; + listCreateVaccinationTableModel = json['List_CreateVaccinationTableModel']; + listHisPatientModel = json['List_His_PatientModel']; + listUserInformationModel = json['List_UserInformationModel']; + listUserInformationModelNew = json['List_UserInformationModel_New']; + listVaccinationTableModel = json['List_VaccinationTableModel']; + tokinID = json['TokinID']; + userID = json['UserID']; + verificationCode = json['VerificationCode']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['HtmlResult'] = this.htmlResult; + data['IsHMGPatient'] = this.isHMGPatient; + data['IsRegister'] = this.isRegister; + data['IsSendSMS'] = this.isSendSMS; + data['List_BabyInformationModel'] = this.listBabyInformationModel; + data['List_BabyNeedReminderModel'] = this.listBabyNeedReminderModel; + data['List_CreateVaccinationTableModel'] = + this.listCreateVaccinationTableModel; + data['List_His_PatientModel'] = this.listHisPatientModel; + data['List_UserInformationModel'] = this.listUserInformationModel; + data['List_UserInformationModel_New'] = this.listUserInformationModelNew; + data['List_VaccinationTableModel'] = this.listVaccinationTableModel; + data['TokinID'] = this.tokinID; + data['UserID'] = this.userID; + data['VerificationCode'] = this.verificationCode; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/childvaccines/delete_baby_model.dart b/lib/core/model/childvaccines/delete_baby_model.dart new file mode 100644 index 00000000..9274b1e8 --- /dev/null +++ b/lib/core/model/childvaccines/delete_baby_model.dart @@ -0,0 +1,76 @@ +class DeleteBaby { + bool isLogin; + int babyID; + int editedBy; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + DeleteBaby( + {this.isLogin, + this.babyID, + this.editedBy, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + DeleteBaby.fromJson(Map json) { + isLogin = json['IsLogin']; + babyID = json['BabyID']; + editedBy = json['EditedBy']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['IsLogin'] = this.isLogin; + data['BabyID'] = this.babyID; + data['EditedBy'] = this.editedBy; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/add_new_child_service.dart b/lib/core/service/childvaccines/add_new_child_service.dart index 22a081a3..5e4a4d86 100644 --- a/lib/core/service/childvaccines/add_new_child_service.dart +++ b/lib/core/service/childvaccines/add_new_child_service.dart @@ -1,26 +1,41 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import '../base_service.dart'; class CreteNewBabyService extends BaseService { List createNewBabyModelList = List(); + List userModelList = List(); + List newUserModelList = List(); - Future getCreateNewBabyOrders({ CreateNewBaby newChild}) async { + + Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async { hasError = false; + await getUser(); + Map body = Map.from(newChild.toJson()); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['UserID'] = userID; + body['AlertBy'] = 2; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_NEWCHILD_REQUEST, onSuccess: (dynamic response, int statusCode) { - createNewBabyModelList.clear(); - - response['List_UserInformationModel_New'].forEach((vital) { - createNewBabyModelList.add( - CreateNewBaby.fromJson(vital)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: newChild.toJson()); + var asd =""; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } - -} \ No newline at end of file +} diff --git a/lib/core/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart index 75a07338..09256f47 100644 --- a/lib/core/service/childvaccines/child_vaccines_service.dart +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; @@ -8,22 +9,17 @@ import '../base_service.dart'; class ChildVaccinesService extends BaseService { List babyInformationModelList = List(); List userInformationModelList = List(); + int userID = 0; - Map body = Map(); Future getAllBabyInformationOrders() async { + Map body = Map(); hasError = false; - body['isDentalAllowedBackend'] = false; body['IsLogin'] = true; - - //body['UserID'] = userInformationModelList[0].userID;//AuthenticatedUser.fromJson(json['List'][0] //babyInformationModelList[0].userID; - body['UserID'] = 46013;//42843; - - - await baseAppClient.post(GET_BABYINFORMATION_REQUEST, + body['UserID'] = userID; + await baseAppClient.post(GET_BABY_BY_USER_ID, onSuccess: (dynamic response, int statusCode) { babyInformationModelList.clear(); - response['List_BabyInformationModel'].forEach((vital) { babyInformationModelList.add(List_BabyInformationModel.fromJson(vital)); }); @@ -32,4 +28,29 @@ class ChildVaccinesService extends BaseService { super.error = error; }, body: body); } + + Future getNewUserOrders() async { + Map body = Map(); + hasError = false; + await getUser(); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['UserID'] = userID; + body['AlertBy'] = 2; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(GET_NEW_USER_REQUEST, + onSuccess: (dynamic response, int statusCode) { + userID = response['UserID']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } diff --git a/lib/core/service/childvaccines/delete_baby_service.dart b/lib/core/service/childvaccines/delete_baby_service.dart new file mode 100644 index 00000000..115d13c5 --- /dev/null +++ b/lib/core/service/childvaccines/delete_baby_service.dart @@ -0,0 +1,75 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + + + +class DeleteBabyService extends BaseService{ + + List createNewBabyModelList = List(); + List userModelList = List(); + List newUserModelList = List(); + + List deleteBabyModelList= List(); + + + Future getDeleteBabyOrder({DeleteBaby deleteChild,int babyID}) async { + hasError = false; + await getUser(); + Map body = Map.from(deleteChild.toJson()); + // body['CreatedBy'] = 102; + body['EditedBy'] = 102; + //body['BabyID'] = babyID; + //body['BabyID'] = createNewBabyModelList ; + // body['AlertBy'] = 2; + // body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(DELETE_CHILD_REQUEST, + onSuccess: (dynamic response, int statusCode) { + var asd =""; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + // Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async { + // hasError = false; + // await getUser(); + // Map body = Map.from(newChild.toJson()); + // body['CreatedBy'] = 102; + // body['EditedBy'] = 102; + // body['UserID'] = userID; + // body['AlertBy'] = 2; + // body['EmailAddress'] = user.emailAddress; + // body['IsLogin'] = true; + // body['LogInTokenID'] = await sharedPref.getString(TOKEN); + // body['MobileNumber'] = user.mobileNumber; + // body['NationalID'] = user.nationalityID; + // body['ZipCode'] = user.zipCode; + // + // body['isDentalAllowedBackend'] = false; + // + // await baseAppClient.post(GET_NEWCHILD_REQUEST, + // onSuccess: (dynamic response, int statusCode) { + // var asd =""; + // }, + // onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: body); + // } + +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/get_vaccinations_item_services.dart b/lib/core/service/childvaccines/get_vaccinations_item_services.dart index f7fe4662..5ff936af 100644 --- a/lib/core/service/childvaccines/get_vaccinations_item_services.dart +++ b/lib/core/service/childvaccines/get_vaccinations_item_services.dart @@ -11,17 +11,6 @@ class GetVccinationsItemsService extends BaseService { Future getaccinationsitemOrders() async { hasError = false; - // await getUser(); - // body['BabyName']="fffffffffff eeeeeeeeeeeeee"; - // body['DOB'] = "/Date(1585774800000+0300)/"; - // body['EmailAddress'] = user.emailAddress; - // body['isDentalAllowedBackend'] = false; - // body['SendEmail'] = false; - // body['IsLogin'] =true; - - - - await baseAppClient.post(GET_TABLE_REQUEST, onSuccess: (dynamic response, int statusCode) { getVaccinationsItemModelList.clear(); diff --git a/lib/core/service/childvaccines/user_information_service.dart b/lib/core/service/childvaccines/user_information_service.dart index 7651ef0f..0628920c 100644 --- a/lib/core/service/childvaccines/user_information_service.dart +++ b/lib/core/service/childvaccines/user_information_service.dart @@ -1,41 +1,35 @@ - import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import '../base_service.dart'; -class UserInformationService extends BaseService{ - +class UserInformationService extends BaseService { List userInformationModelList = List(); Map body = Map(); - - Future getUserInformationOrders() async { hasError = false; - await getUser(); - body['CreatedBy'] = 102; - body['EditedBy'] = 102; - body['EmailAddress'] = user.emailAddress; - body['IsLogin'] =true; - body['LogInTokenID'] = 'ZBGoQFUG50eQJd6Y7u1ykA=='; - body['MobileNumber'] = user.mobileNumber; - body['NationalID'] = user.nationalityID; - body['ZipCode'] = user.zipCode; - body['isDentalAllowedBackend'] = false; - + await getUser(); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; 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); + 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); } - - -} \ No newline at end of file +} diff --git a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart index 26355bd7..eebaca02 100644 --- a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart +++ b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart @@ -1,28 +1,42 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/delete_baby_service.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; -class AddNewChildViewModel extends BaseViewModel{ +class AddNewChildViewModel extends BaseViewModel { CreteNewBabyService _creteNewBabyService = locator(); - - - - List get creteNewBabyModelList=> _creteNewBabyService.createNewBabyModelList; - getNewBabyOrders({ CreateNewBaby newChild}) async { + ChildVaccinesService _childVaccinesService = locator(); + // DeleteBabyService _deleteBabyService = locator(); + bool isAdded = false; + ///create new baby + createNewBabyOrders({ CreateNewBaby newChild}) async { setState(ViewState.Busy); - - await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild); - - if ( _creteNewBabyService.hasError) { - error = _creteNewBabyService.error; + await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID); + if (_creteNewBabyService.hasError) { + error = _creteNewBabyService.error; setState(ViewState.Error); - } else + } else { + isAdded = true; setState(ViewState.Idle); + await _childVaccinesService.getAllBabyInformationOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else{ + + } + } } + + + + } diff --git a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart index e6a8ca60..7c4af285 100644 --- a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart +++ b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart @@ -1,24 +1,43 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; +//======== +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/delete_baby_service.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; class ChildVaccinesViewModel extends BaseViewModel{ + ChildVaccinesService _childVaccinesService = locator(); + List get babyInformationModelList=> _childVaccinesService.babyInformationModelList; - ChildVaccinesService _childVaccinesService = locator(); +//=========== + CreteNewBabyService _creteNewBabyService = locator(); + DeleteBabyService _deleteBabyService = locator(); + bool isAdded = false; + bool isDeleted = false; + //============ - List get babyInformationModelList=> _childVaccinesService.babyInformationModelList;//BabyInformationModelList; - getBabyInformatioRequestOrders() async { + + getNewUserOrders() async { setState(ViewState.Busy); + await _childVaccinesService.getNewUserOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else + getBabyInformatioRequestOrders(); + } + getBabyInformatioRequestOrders() async { await _childVaccinesService.getAllBabyInformationOrders(); - if (_childVaccinesService.hasError) { error = _childVaccinesService.error; setState(ViewState.Error); @@ -26,4 +45,29 @@ class ChildVaccinesViewModel extends BaseViewModel{ setState(ViewState.Idle); } + + + ///delete baby + deleteBabyOrders({ DeleteBaby newChild}) async { + setState(ViewState.Busy); + //await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID); + await _deleteBabyService.getDeleteBabyOrder(deleteChild: newChild,babyID: newChild.babyID); + //getDeleteBabyOrder(deleteChild: newChild,); + // getDeleteBabyOrder + if (_creteNewBabyService.hasError) { + error = _creteNewBabyService.error; + setState(ViewState.Error); + } else { + isDeleted = true; + setState(ViewState.Idle); + await _childVaccinesService.getAllBabyInformationOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else{ + + } + } + } + } \ No newline at end of file diff --git a/lib/core/viewModels/child_vaccines/user_information_view_model.dart b/lib/core/viewModels/child_vaccines/user_information_view_model.dart index c362ef73..43269f42 100644 --- a/lib/core/viewModels/child_vaccines/user_information_view_model.dart +++ b/lib/core/viewModels/child_vaccines/user_information_view_model.dart @@ -11,11 +11,9 @@ class UserInformationViewModel extends BaseViewModel { List get userInformationModelList => _userInformationService.userInformationModelList; - getUserInformatioRequestOrders() async { + getUserInformationRequestOrders() async { setState(ViewState.Busy); - await _userInformationService.getUserInformationOrders(); - if (_userInformationService.hasError) { error = _userInformationService.error; setState(ViewState.Error); diff --git a/lib/locator.dart b/lib/locator.dart index 46b97fce..e6140ce1 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -13,6 +13,7 @@ import 'core/service/blood/blood_details_servies.dart'; import 'core/service/blood/blood_donation_service.dart'; import 'core/service/childvaccines/add_new_child_service.dart'; import 'core/service/childvaccines/child_vaccines_service.dart'; +import 'core/service/childvaccines/delete_baby_service.dart'; import 'core/service/childvaccines/user_information_service.dart'; import 'core/service/childvaccines/vaccination_table_service.dart'; import 'core/service/contactus/finadus_service.dart'; @@ -123,6 +124,10 @@ void setupLocator() { locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => CreteNewBabyService()); + locator.registerLazySingleton(() => DeleteBabyService()); + + + locator.registerLazySingleton(() => VaccinationTableService()); diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart index 05d3d07a..3d287610 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -207,7 +207,7 @@ class _BmrCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, @@ -306,7 +306,7 @@ class _BmrCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, @@ -481,7 +481,7 @@ class _BmrCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart index 4a939b3f..ccc7d212 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -285,98 +285,101 @@ class _BodyFatState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(heightCm.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(heightCm.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, ), + onTap: () { + setState(() { + if (heightCm < 250) + heightCm++; + }); + }, ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (heightCm < 250) - heightCm++; + if (heightCm > 0) + heightCm--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (heightCm > 0) - heightCm--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: heightCm.toDouble(), - min: 0, - max: 250, - onChanged: (double newValue) { - setState(() { - heightCm = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: heightCm.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + heightCm = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], @@ -458,96 +461,99 @@ class _BodyFatState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(neck.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(neck.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, ), + onTap: () { + setState(() { + if (neck < 60) neck++; + }); + }, ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (neck < 60) neck++; + if (neck > 5) neck--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (neck > 5) neck--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: neck.toDouble(), - min: 5, - max: 60, - onChanged: (double newValue) { - setState(() { - neck = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: neck.toDouble(), + min: 5, + max: 60, + onChanged: (double newValue) { + setState(() { + neck = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], @@ -629,96 +635,100 @@ class _BodyFatState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(waist.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(waist.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, ), + onTap: () { + setState(() { + if (waist < 200) + waist++; + }); + }, ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (waist < 200) waist++; + if (waist > 5) waist--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (waist > 5) waist--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: waist.toDouble(), - min: 5, - max: 200, - onChanged: (double newValue) { - setState(() { - waist = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: waist.toDouble(), + min: 5, + max: 200, + onChanged: (double newValue) { + setState(() { + waist = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], @@ -800,96 +810,99 @@ class _BodyFatState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(hip.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(hip.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, ), + onTap: () { + setState(() { + if (hip < 140) hip++; + }); + }, ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (hip < 140) hip++; + if (hip > 5) hip--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (hip > 5) hip--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: hip.toDouble(), - min: 5, - max: 140, - onChanged: (double newValue) { - setState(() { - hip = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: hip.toDouble(), + min: 5, + max: 140, + onChanged: (double newValue) { + setState(() { + hip = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart index ac1aacc3..994484e7 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -181,7 +181,7 @@ class _CalorieCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, @@ -280,7 +280,7 @@ class _CalorieCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, @@ -448,7 +448,7 @@ class _CalorieCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart index 32ec9262..2dfc3f92 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -97,7 +97,7 @@ class _CarbsState extends State { Column( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart new file mode 100644 index 00000000..1e8cb50c --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:intl/intl.dart'; + +import 'delivery_due_result_page.dart'; + +class DeliveryDue extends StatefulWidget { + @override + _DeliveryDueState createState() => _DeliveryDueState(); +} + +class _DeliveryDueState extends State { + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + var dateFrom = DateTime.now(); + var dateTo = DateTime.now(); + var conceivedDate = DateTime.now(); + var deliveryDue = DateTime.now(); + var firstTrimester = DateTime.now(); + var secondTrimester = DateTime.now(); + var thirdTrimester = DateTime.now(); + var dt = DateTime.now(); + var newFormat = DateFormat("yy-MM-dd"); + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Delivery Due Date', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 35.0, vertical: 20.0), + child: SingleChildScrollView( + child: Container( + child: Column( + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts( + 'Congratulations, you are pregnant! Now when will the new baby arrive? To estimate the due date, enter the date when the last menstrual perios began (the first day), then click calculate.', + ), + Divider( + //height: 2, + thickness: 2, + ), + Column( + children: [ + Texts( + 'What was the date of the first day of the last period?', + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate == date + ? null + : bloodSugarDate = DateTime.now(); + dateFrom = date.add(Duration(days: 10)); + + dateTo = date.add(Duration(days: 20)); + conceivedDate = date.add(Duration(days: 14)); + deliveryDue = date.add(Duration(days: 280)); + firstTrimester = date.add(Duration(days: 85)); + secondTrimester = date.add(Duration(days: 190)); + thirdTrimester = date.add(Duration(days: 280)); + }); + }, + currentTime: DateTime.now(), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Icon(Icons.date_range_rounded), + Texts('Date'), + ], + ), + Texts(getDate()), + ], + ), + ), + ), + ], + ), + SizedBox( + height: 280.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DeliveryDueResult( + conceivedDate: conceivedDate, + dateFrom: dateFrom, + dateTo: dateTo, + deliveryDue: deliveryDue, + firstTrimester: firstTrimester, + secondTrimester: secondTrimester, + thirdTrimester: thirdTrimester, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart new file mode 100644 index 00000000..fc53b044 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart @@ -0,0 +1,106 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class DeliveryDueResult extends StatelessWidget { + var dateFrom; + var dateTo; + var conceivedDate; + var deliveryDue; + var firstTrimester; + var secondTrimester; + var thirdTrimester; + DeliveryDueResult( + {this.dateFrom, + this.dateTo, + this.conceivedDate, + this.deliveryDue, + this.firstTrimester, + this.secondTrimester, + this.thirdTrimester}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Delivery Due Date', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0), + child: SingleChildScrollView( + child: Container( + height: 750.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'The next ovulation period is estimated to be:', + fontWeight: FontWeight.w400, + ), + Texts( + 'From:', + fontWeight: FontWeight.w400, + ), + Texts(DateFormat.yMMMEd().format(dateFrom), + fontWeight: FontWeight.w800, + fontSize: 21.0, + color: Color(0xffC5272D)), + Texts( + 'To:', + fontWeight: FontWeight.w400, + ), + Texts(DateFormat.yMMMEd().format(dateTo), + fontWeight: FontWeight.w800, + fontSize: 21.0, + color: Color(0xffC5272D)), + Texts( + 'You have conceived on:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(conceivedDate), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'First Trimester Ends (12 weeks):', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(firstTrimester), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'Second Trimester Ends (27 weeks):', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(secondTrimester), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'Third Trimester, Estimated Due Date (40 weeks):', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(thirdTrimester), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart index f534416f..fb4f8948 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -29,7 +29,7 @@ class _IdealBodyState extends State { double overWeightBy; int weight = 0; double idealWeight = 0; - String dropdownValue; + String dropdownValue = 'Medium(fingers touch)'; double calories = 0; String textResult = ''; double maxIdealWeight; @@ -126,97 +126,100 @@ class _IdealBodyState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(height.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), ), ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) + height++; + }); + }, + ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (height < 250) - height++; + if (height > 0) height--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (height > 0) height--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: height.toDouble(), - min: 0, - max: 250, - onChanged: (double newValue) { - setState(() { - height = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], @@ -304,97 +307,100 @@ class _IdealBodyState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(weight.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), ), ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) + weight++; + }); + }, + ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (weight < 250) - weight++; + if (weight > 0) weight--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (weight > 0) weight--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: weight.toDouble(), - min: 0, - max: 250, - onChanged: (double newValue) { - setState(() { - weight = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart new file mode 100644 index 00000000..adc2f06d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart @@ -0,0 +1,350 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:intl/intl.dart'; + +class OvulationPeriod extends StatefulWidget { + @override + _OvulationPeriodState createState() => _OvulationPeriodState(); +} + +class _OvulationPeriodState extends State { + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + int cycleLength = 0; + int lutealPhaseLength = 0; + String selectedDate; + var dateFrom = DateTime.now(); + var dateTo = DateTime.now(); + var conceivedDate = DateTime.now(); + var deliveryDue = DateTime.now(); + var dt = DateTime.now(); + var newFormat = DateFormat("yy-MM-dd"); + String updatedDt; + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + // void calculate() {} + // + // void calculateFertility(DateTime selectedDate) {const diff = Date.} + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ovulation Period', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 700.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Calculates Ovulation Period'), + SizedBox( + height: 12.0, + ), + Divider( + //height: 2, + thickness: 2, + ), + SizedBox( + height: 12.0, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + dateFrom = date.add(Duration(days: 10)); + updatedDt = DateFormat.yMMMEd().format(dateFrom); + + dateTo = date.add(Duration(days: 20)); + conceivedDate = date.add(Duration(days: 14)); + deliveryDue = date.add(Duration(days: 280)); + }); + }, + currentTime: DateTime.now(), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 5.0, + ), + Texts( + 'Average Cycle Length (usually 28 days):', + fontWeight: FontWeight.w400, + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(cycleLength.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (cycleLength < 45) + cycleLength++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (cycleLength > 0) + cycleLength--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: cycleLength.toDouble(), + min: 0, + max: 45, + onChanged: (double newValue) { + setState(() { + cycleLength = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts( + 'Average Luteal Phase Length (usually 14 days):', + fontWeight: FontWeight.w400, + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: + Text(lutealPhaseLength.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (lutealPhaseLength < 15) + lutealPhaseLength++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (lutealPhaseLength > 0) + lutealPhaseLength--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: lutealPhaseLength.toDouble(), + min: 0, + max: 15, + onChanged: (double newValue) { + setState(() { + lutealPhaseLength = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + SizedBox( + height: 220.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OvulationResult( + conceivedDate: conceivedDate, + dateFrom: dateFrom, + dateTo: dateTo, + deliveryDue: deliveryDue, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart new file mode 100644 index 00000000..6669bf75 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart @@ -0,0 +1,96 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class OvulationResult extends StatelessWidget { + var dateFrom; + var dateTo; + var conceivedDate; + var deliveryDue; + OvulationResult( + {this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate}); + //var newFormat = DateFormat("yy-MM-dd"); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ovulation Period', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 750.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'The next ovulation period is estimated to be:', + fontWeight: FontWeight.w400, + ), + Texts( + 'From:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(dateFrom), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'To:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(dateTo), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'Useful Information:', + color: Color(0xffC5272D), + ), + Texts( + 'You have conceived on:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(conceivedDate), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'The baby\'s age right now:', + fontWeight: FontWeight.w400, + ), + Texts( + '5 Weeks, 2', + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'The delivery due date is estimated to be on the: ', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(deliveryDue), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart index 97141716..cdadfe98 100644 --- a/lib/pages/AlHabibMedicalService/​ health_calculators.dart +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'health_calculator/bmi_calculator/bmi_calculator.dart'; import 'health_calculator/bmr_calculator/bmr_calculator.dart'; import 'health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'health_calculator/delivery_due/delivery_due.dart'; import 'health_calculator/ideal_body/ideal_body.dart'; class HealthCalculators extends StatefulWidget { @@ -233,10 +235,10 @@ class _HealthCalculatorsState extends State flex: 1, child: InkWell( onTap: () { - // Navigator.push( - // context, - // FadePage(page: BloodSugar()), - // ); + Navigator.push( + context, + FadePage(page: OvulationPeriod()), + ); }, child: MedicalProfileItem( title: 'Ovulation', @@ -249,12 +251,12 @@ class _HealthCalculatorsState extends State flex: 1, child: InkWell( onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: BloodCholesterol(), - // ), - // ); + Navigator.push( + context, + FadePage( + page: DeliveryDue(), + ), + ); }, child: MedicalProfileItem( title: 'Delivery', diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index f2970cad..51b89f98 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -1,6 +1,7 @@ import 'package:device_calendar/device_calendar.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_child_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; @@ -19,8 +20,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; - - enum Gender { Male, Female, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } @@ -56,6 +55,7 @@ class AddNewChildPage extends StatefulWidget { DateTime.now().day, (hour * count))); } } + @override _AddNewChildPageState createState() => _AddNewChildPageState(); } @@ -75,15 +75,17 @@ class _AddNewChildPageState extends State { TextEditingController _notesTextController = TextEditingController(); BeneficiaryType beneficiaryType = BeneficiaryType.NON; Gender gender = Gender.Male; + CreateNewUser_New newUserChild = CreateNewUser_New(); + //ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel(); List_BabyInformationModel addvancedModel = List_BabyInformationModel(); - CreateNewBaby newChild=CreateNewBaby(); - List_UserInformationModel informationModel =List_UserInformationModel(); + CreateNewBaby newChild = CreateNewBaby(); + List_UserInformationModel informationModel = List_UserInformationModel(); @override Widget build(BuildContext context) { return BaseView( - builder: (_,model,w)=> AppScaffold( + builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: "Vaccintion", body: SingleChildScrollView( @@ -97,7 +99,8 @@ class _AddNewChildPageState extends State { height: 50, ), Texts( - "Add the child's information below to recieve the schedule of vaccinations.", //+model.user.firstName, + "Add the child's information below to recieve the schedule of vaccinations.", + //+model.user.firstName, textAlign: TextAlign.center, ), SizedBox( @@ -130,22 +133,25 @@ class _AddNewChildPageState extends State { height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, padding: EdgeInsets.all(12), + + child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center, children: [ Container( height: MediaQuery.of(context).size.height * 0.12, - width: 170, + width: 175, + color: Colors.white, child: SecondaryButton( textColor: - checkedValue == 1 ? Colors.white : Colors.black, + checkedValue == 1 ? Colors.white : Colors.black, color: checkedValue == 1 ? Colors.red : Colors.white, label: "Male", // onTap: () { - // bloodDetails.city=_selectedHospital.toString(); + setState(() { checkedValue = 1; print("checkedValue=" + checkedValue.toString()); @@ -157,10 +163,11 @@ class _AddNewChildPageState extends State { ), Container( height: MediaQuery.of(context).size.height * 0.12, - width: 170, + width: 175, + color: Colors.white, child: SecondaryButton( textColor: - checkedValue == 2 ? Colors.white : Colors.black, + checkedValue == 2 ? Colors.white : Colors.black, color: checkedValue == 2 ? Colors.red : Colors.white, label: "Female", // @@ -220,9 +227,8 @@ class _AddNewChildPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts(//getStartDay() - // DateUtil.yearMonthDay(DateTime.now()) - getStartDay() - ), + // DateUtil.yearMonthDay(DateTime.now()) + getStartDay()), Icon( Icons.calendar_today, color: Colors.black, @@ -234,62 +240,47 @@ class _AddNewChildPageState extends State { SizedBox( height: 12, ), - //========= - ], - ), - ), - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false - ? Colors.white24 - : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: "Add", - // - onTap: () { - - newChild.babyName = - _firstTextController.text + " " + _secondTextController.text; - newChild.gender = checkedValue.toString(); - newChild.strDOB=getStartDay() ; - newChild.alertBy=addvancedModel.alertBy; - newChild.createdBy=informationModel.createdBy ; - newChild.editedBy=informationModel.createdBy; - newChild.tempValue=true; - // newChild.userID=46013;//informationModel.userID; - newChild.isLogin=true; - //newChild.tokenID='qMgbP94U23RkXtWWT0Sw=='; - //'ZBGoQFUG50eQJd6Y7u1ykA=='; - - - model.getNewBabyOrders(newChild: newChild); - + 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", + // + onTap: () async{ + newChild.babyName = _firstTextController.text + " " + _secondTextController.text; + newChild.gender = checkedValue.toString(); + newChild.strDOB = getStartDay(); + newChild.tempValue = true; + newChild.isLogin = true; + await model.createNewBabyOrders(newChild: newChild); + if(model.isAdded){ + AppToast.showSuccessToast(message: "Record Added"); + Navigator.pop(context,model.isAdded); + }else{ - AppToast.showSuccessToast(message: "Record Added"); - //============ - Navigator.push( - context, - FadePage( - page: ChildPage(), + //TODO handling error + } + }, + ), ), - ); - //============== - - // bloodDetails. - }, + //========= + ], + ), ), ), + // bottomSheet: ), ); } diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index 6a937aad..806a5b71 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -1,8 +1,10 @@ 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/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_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/others/app_scaffold_widget.dart'; @@ -11,140 +13,190 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -class ChildPage extends StatefulWidget { - +import 'dialogs/delete_child.dart'; +class ChildPage extends StatefulWidget { @override _ChildPageState createState() => _ChildPageState(); } -class _ChildPageState extends State with SingleTickerProviderStateMixin { +class _ChildPageState extends State + with SingleTickerProviderStateMixin { + + DeleteBaby deleteBaby = DeleteBaby(); + @override Widget build(BuildContext context) { - var checkedValue= true; + var checkedValue = true; return BaseView( - onModelReady: (model) => model.getBabyInformatioRequestOrders(),//model.getCOC(),getFindUsRequestOrders() - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - appBarTitle: " Vaccination", - baseViewModel: model, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(left: 15,right: 15,top: 70), - child: Column( - children: [ - ...List.generate(model.babyInformationModelList.length, (index) => - Container( - 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), + onModelReady: (model) => model.getNewUserOrders(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: " Vaccination", + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15, top: 70), + child: Column( + children: [ + ...List.generate( + model.babyInformationModelList.length, + (index) => Container( + margin: EdgeInsets.only( + left: 0, right: 0, bottom: 20), + + 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(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, - 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: 'Increase volume by 10', - onPressed: () { - Navigator.push( - context, - FadePage( - page: VaccinationTablePage(), - - //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // HospitalsPage( - // findusHospitalModelList: model.FindusHospitalModelList, - // ) - - ), - ); - // setState(() { - // // _volume += 10; - // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // }); - }, - )] - ), - Row(children:[Texts("Birthday"),]), - Row(children:[IconButton( - icon: new Image.asset('assets/images/new-design/calender-secondary.png'), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); - }, - ), - Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), - Row(children:[IconButton( - icon: new Image.asset('assets/images/new-design/garbage.png'), - tooltip: '', - onPressed: () { - setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); - }, - ), - Texts("Birthday"),]), - ], - ) - - - ) - - ) - - ], - - - ) - ) - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - - padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: "ADD NEW CHILD ", - // - onTap: () => Navigator.push( - context, - FadePage( - page: AddNewChildPage(), - - - ), - ), - - - ), - ), - ) - ); + 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(); + }); + }, + ), + ), + )); } } diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index ba4589a9..92f3a0be 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -29,7 +29,7 @@ class _ChildVaccinesPageState extends State Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getUserInformatioRequestOrders(), + onModelReady: (model) => model.getUserInformationRequestOrders(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, baseViewModel: model, @@ -50,7 +50,8 @@ class _ChildVaccinesPageState extends State child: Texts("Welcome back",fontSize: 20,), ) , ), - Divider(color:Colors.black ,), + Divider(color:Colors.black , indent: 10, + endIndent: 10,), SizedBox( height: 20, ), @@ -61,13 +62,17 @@ class _ChildVaccinesPageState extends State ) , ), - Divider(color:Colors.black ,), + 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( - hintText: model.user.emailAddress,//'Title', + fillColor: Colors.red, + + hintText: model.user.emailAddress, controller: titleController, fontSize: 20, hintColor: Colors.black, @@ -75,9 +80,7 @@ class _ChildVaccinesPageState extends State onChanged: (text) { addEmail=text; model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; - // checkedValue=true; - // print("First text field: $text"); - // print("First text field:"+ model.user.emailAddress); + }, validator: (value) { @@ -99,7 +102,7 @@ class _ChildVaccinesPageState extends State height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(15), child: SecondaryButton( textColor: Colors.white, color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), @@ -121,7 +124,7 @@ class _ChildVaccinesPageState extends State height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(15), child: SecondaryButton( textColor: Colors.white, color: Color.fromRGBO(63, 72, 74, 1,), @@ -132,10 +135,7 @@ class _ChildVaccinesPageState extends State FadePage( page: ChildPage(), - //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // HospitalsPage( - // findusHospitalModelList: model.FindusHospitalModelList, - // ) + ), ), @@ -143,6 +143,7 @@ class _ChildVaccinesPageState extends State ), ), + // Texts( // // TranslationBase.of(context).advancePaymentLabel, // model.user.emailAddress, @@ -151,253 +152,21 @@ class _ChildVaccinesPageState extends State SizedBox( height: 12, ), - // InkWell( - // onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),//model.hospitals - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getHospitalName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), SizedBox( height: 12, ), - // InkWell( - // //======Gender======== - // onTap: () => confirmSelectGenderDialog(),//confirmSelectBeneficiaryDialog(model), - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // //Texts(getBeneficiaryType()), - // Texts(getGender()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // SizedBox( - // height: 12, - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // InkWell( - // onTap: () { - // model.getFamilyFiles().then((value) { - // confirmSelectFamilyDialog(model - // .getAllSharedRecordsByStatusResponse - // .getAllSharedRecordsByStatusList); - // }).showProgressBar( - // text: "Loading", - // backgroundColor: Colors.blue.withOpacity(0.6)); - // }, - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getFamilyMembersName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), SizedBox( height: 12, ), - // InkWell( - // //======Gender======== - // onTap: () => confirmSelectBloodDialog(),//confirmSelectBeneficiaryDialog(model), - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // //Texts(getBeneficiaryType()), - // Texts(getBlood()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // SizedBox( - // height: 12, - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // InkWell( - // onTap: () { - // model.getFamilyFiles().then((value) { - // confirmSelectFamilyDialog(model - // .getAllSharedRecordsByStatusResponse - // .getAllSharedRecordsByStatusList); - // }).showProgressBar( - // text: "Loading", - // backgroundColor: Colors.blue.withOpacity(0.6)); - // }, - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getFamilyMembersName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), + SizedBox( height: 12, ), - // Row( - // children: [ - // Container( - // child: Text(" To view the terms and conditions "), - // ), - // SizedBox( - // width: MediaQuery.of(context).size.height * 0.10, - // ), - // // InkWell( - // // onTap: () { - // // Navigator.of(context).push(MaterialPageRoute( - // // builder: (BuildContext context) => UserAgreementPage())); - // // }, - // // child: Container( - // // child: Texts(" Click here ",color: Colors.blue,), - // // ), - // // ) - // ], - // ), + SizedBox( height: 12, ), - // Row( - // children: [ - // Checkbox( - // onChanged: (bool value) { - // setState(() { - // checkedValue = value; - // }); - // }, - // // tristate: checkedValue==true,//i == 1, - // value: checkedValue, - // activeColor: Colors.red,//Color(0xFF6200EE), - // ), - // SizedBox(height: 10,), - // Row(children: [ - // - // ],), - // SizedBox( - // width: 10, - // ), - // Text( - // 'I agree to the terms and conditions ', - // style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue? Colors.red : Colors.black), - // ), - // ], - // ), - // NewTextFields( - // hintText: TranslationBase.of(context).fileNumber, - // controller: _fileTextController, - // ), - // if (beneficiaryType == BeneficiaryType.OtherAccount) - // SizedBox( - // height: 12, - // ), - // if (beneficiaryType == BeneficiaryType.OtherAccount) - // InkWell( - // onTap: () { - // if (_fileTextController.text.isNotEmpty) - // model - // .getPatientInfoByPatientID( - // id: _fileTextController.text) - // .then((value) { - // confirmSelectPatientDialog(model.patientInfoList); - // }).showProgressBar( - // text: "Loading", - // backgroundColor: - // Colors.blue.withOpacity(0.6)); - // else - // AppToast.showErrorToast( - // message: 'Please Enter The File Number'); - // }, - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getPatientName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), - // SizedBox( - // height: 12, - // ), - // NewTextFields( - // hintText: TranslationBase.of(context).amount, - // keyboardType: TextInputType.number, - // onChanged: (value) { - // setState(() { - // amount = value; - // }); - // }, - // ), - // SizedBox( - // height: 12, - // ), - // NewTextFields( - // hintText: TranslationBase.of(context).depositorEmail, - // initialValue: model.user.emailAddress, - // onChanged: (value) { - // email = value; - // }, - // ), - // SizedBox( - // height: 12, - // ), - // NewTextFields( - // hintText: TranslationBase.of(context).notes, - // controller: _notesTextController, - // ), SizedBox( height: 10, ), diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index f84dea29..259bbdb7 100644 --- a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -1,10 +1,14 @@ import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class SelectGenderDialog extends StatefulWidget { + final Email; + + const SelectGenderDialog({Key key, this.Email}) : super(key: key); @override _SelectGenderDialogState createState() => _SelectGenderDialogState(); } @@ -31,6 +35,7 @@ class _SelectGenderDialogState extends State { child: ListTile( title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), + ), ), ) @@ -77,6 +82,7 @@ class _SelectGenderDialogState extends State { flex: 1, child: InkWell( onTap: () { + AppToast.showSuccessToast(message: "Email Sended"); // widget.onValueSelected(beneficiaryType); Navigator.pop(context); }, diff --git a/lib/pages/ChildVaccines/dialogs/delete_child.dart b/lib/pages/ChildVaccines/dialogs/delete_child.dart new file mode 100644 index 00000000..250f40d3 --- /dev/null +++ b/lib/pages/ChildVaccines/dialogs/delete_child.dart @@ -0,0 +1,103 @@ +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class DeleteChild extends StatefulWidget { + @override + _DeleteChildState createState() => _DeleteChildState(); +} + +class _DeleteChildState extends State { + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + //beneficiaryType = Gender.Male; + }); + }, + child: ListTile( + title: Text("Delete the child "), + + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + // widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index 6ac11e4f..c160acfb 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -61,67 +61,7 @@ class VaccinationTablePage extends StatelessWidget { ],), Divider(color:Colors.black ,), - // 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: 'Increase volume by 10', - // onPressed: () { - // Navigator.push( - // context, - // FadePage( - // page: VaccinationTablePage(), - // - // //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // // HospitalsPage( - // // findusHospitalModelList: model.FindusHospitalModelList, - // // ) - // - // ), - // ); - // // setState(() { - // // // _volume += 10; - // // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // // }); - // }, - // )] - // ), - // Row(children:[Texts("Birthday"),]), - // Row(children:[IconButton( - // icon: new Image.asset('assets/images/new-design/calender-secondary.png'), - // tooltip: 'Increase volume by 10', - // onPressed: () { - // setState(() { - // // _volume += 10; - // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // }); - // }, - // ), - // Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), - // Row(children:[IconButton( - // icon: new Image.asset('assets/images/new-design/garbage.png'), - // tooltip: '', - // onPressed: () { - // setState(() { - // // _volume += 10; - // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // }); - // }, - // ), - // Texts("Birthday"),]), + ], ) diff --git a/lib/widgets/input/text_field.dart b/lib/widgets/input/text_field.dart index 0476c352..7cfba5e6 100644 --- a/lib/widgets/input/text_field.dart +++ b/lib/widgets/input/text_field.dart @@ -46,6 +46,7 @@ class TextFields extends StatefulWidget { this.suffixIcon, this.autoFocus, this.onChanged, + // this.initialValue, this.minLines, this.maxLines, @@ -72,6 +73,7 @@ class TextFields extends StatefulWidget { this.fontSize = 16.0, this.fontWeight = FontWeight.w700, this.autoValidate = false, + this.fillColor, this.hintColor}) : super(key: key); @@ -108,6 +110,7 @@ class TextFields extends StatefulWidget { final bool focus; final bool borderOnlyError; final Color hintColor; + final Color fillColor; @override _TextFieldsState createState() => _TextFieldsState(); @@ -211,7 +214,7 @@ class _TextFieldsState extends State { blurRadius: focus ? 34.0 : 12.0) ]), child: TextFormField( - + keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), autovalidate: widget.autoValidate, @@ -242,6 +245,7 @@ class _TextFieldsState extends State { .textTheme .body2 .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone ? [ WhitelistingTextInputFormatter.digitsOnly, @@ -249,12 +253,15 @@ class _TextFieldsState extends State { ] : widget.inputFormatters, decoration: InputDecoration( + counterText: "", hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, + + ), contentPadding: widget.padding != null ? widget.padding