Merge branch 'child_vaccines' into 'master'
Child vaccines See merge request Cloud_Solution/diplomatic-quarter!62er_location
commit
847ccb9c07
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
@ -0,0 +1,45 @@
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
class List_BabyInformationModel {
|
||||
int alertBy;
|
||||
int babyID;
|
||||
String babyName;
|
||||
DateTime dOB;
|
||||
int gender;
|
||||
String genderDescription;
|
||||
int patientID;
|
||||
int userID;
|
||||
|
||||
List_BabyInformationModel(
|
||||
{this.alertBy,
|
||||
this.babyID,
|
||||
this.babyName,
|
||||
this.dOB,
|
||||
this.gender,
|
||||
this.genderDescription,
|
||||
this.patientID,
|
||||
this.userID});
|
||||
|
||||
List_BabyInformationModel.fromJson(Map<String, dynamic> json) {
|
||||
alertBy = json['AlertBy'];
|
||||
babyID = json['BabyID'];
|
||||
babyName = json['BabyName'];
|
||||
dOB = DateUtil.convertStringToDate(json['DOB']);
|
||||
gender = json['Gender'];
|
||||
genderDescription = json['GenderDescription'];
|
||||
patientID = json['PatientID'];
|
||||
userID = json['UserID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['AlertBy'] = this.alertBy;
|
||||
data['BabyID'] = this.babyID;
|
||||
data['BabyName'] = this.babyName;
|
||||
data['DOB'] = this.dOB;
|
||||
data['Gender'] = this.gender;
|
||||
data['GenderDescription'] = this.genderDescription;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['UserID'] = this.userID;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
class CreateNewBaby {
|
||||
String babyName;
|
||||
String gender;
|
||||
String strDOB;
|
||||
int editedBy;
|
||||
int createdBy;
|
||||
bool tempValue;
|
||||
int userID;
|
||||
bool isLogin;
|
||||
int alertBy;
|
||||
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;
|
||||
|
||||
CreateNewBaby(
|
||||
{this.babyName,
|
||||
this.gender,
|
||||
this.strDOB,
|
||||
this.editedBy,
|
||||
this.createdBy,
|
||||
this.tempValue,
|
||||
this.userID,
|
||||
this.isLogin,
|
||||
this.alertBy,
|
||||
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});
|
||||
|
||||
CreateNewBaby.fromJson(Map<String, dynamic> json) {
|
||||
babyName = json['BabyName'];
|
||||
gender = json['Gender'];
|
||||
strDOB = json['StrDOB'];
|
||||
editedBy = json['EditedBy'];
|
||||
createdBy = json['CreatedBy'];
|
||||
tempValue = json['TempValue'];
|
||||
userID = json['UserID'];
|
||||
isLogin = json['IsLogin'];
|
||||
alertBy = json['AlertBy'];
|
||||
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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['BabyName'] = this.babyName;
|
||||
data['Gender'] = this.gender;
|
||||
data['StrDOB'] = this.strDOB;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['TempValue'] = this.tempValue;
|
||||
data['UserID'] = this.userID;
|
||||
data['IsLogin'] = this.isLogin;
|
||||
data['AlertBy'] = this.alertBy;
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
class CreateVaccinationTable {
|
||||
String givenAt;
|
||||
String status;
|
||||
String vaccinesDescription;
|
||||
String visit;
|
||||
|
||||
CreateVaccinationTable(
|
||||
{this.givenAt, this.status, this.vaccinesDescription, this.visit});
|
||||
|
||||
CreateVaccinationTable.fromJson(Map<String, dynamic> json) {
|
||||
givenAt = json['GivenAt'];
|
||||
status = json['Status'];
|
||||
vaccinesDescription = json['VaccinesDescription'];
|
||||
visit = json['Visit'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['GivenAt'] = this.givenAt;
|
||||
data['Status'] = this.status;
|
||||
data['VaccinesDescription'] = this.vaccinesDescription;
|
||||
data['Visit'] = this.visit;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
class GET_VACCINATIONS_ITEMSMODEL {
|
||||
String dESCRIPTION;
|
||||
String iTEMCODE;
|
||||
|
||||
GET_VACCINATIONS_ITEMSMODEL({this.dESCRIPTION, this.iTEMCODE});
|
||||
|
||||
GET_VACCINATIONS_ITEMSMODEL.fromJson(Map<String, dynamic> json) {
|
||||
dESCRIPTION = json['DESCRIPTION'];
|
||||
iTEMCODE = json['ITEM_CODE'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['DESCRIPTION'] = this.dESCRIPTION;
|
||||
data['ITEM_CODE'] = this.iTEMCODE;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
class List_UserInformationModel {
|
||||
int userID;
|
||||
String mobileNumber;
|
||||
String nationalID;
|
||||
String emailAddress;
|
||||
int patientID;
|
||||
int patientType;
|
||||
bool patientOutSA;
|
||||
int createdBy;
|
||||
int editedBy;
|
||||
|
||||
List_UserInformationModel(
|
||||
{this.userID,
|
||||
this.mobileNumber,
|
||||
this.nationalID,
|
||||
this.emailAddress,
|
||||
this.patientID,
|
||||
this.patientType,
|
||||
this.patientOutSA,
|
||||
this.createdBy,
|
||||
this.editedBy});
|
||||
|
||||
List_UserInformationModel.fromJson(Map<String, dynamic> json) {
|
||||
userID = json['UserID'];
|
||||
mobileNumber = json['MobileNumber'];
|
||||
nationalID = json['NationalID'];
|
||||
emailAddress = json['EmailAddress'];
|
||||
patientID = json['PatientID'];
|
||||
patientType = json['PatientType'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
createdBy = json['CreatedBy'];
|
||||
editedBy = json['EditedBy'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['UserID'] = this.userID;
|
||||
data['MobileNumber'] = this.mobileNumber;
|
||||
data['NationalID'] = this.nationalID;
|
||||
data['EmailAddress'] = this.emailAddress;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['CreatedBy'] = this.createdBy;
|
||||
data['EditedBy'] = this.editedBy;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
|
||||
import '../base_service.dart';
|
||||
|
||||
class CreteNewBabyService extends BaseService {
|
||||
List<CreateNewBaby> createNewBabyModelList = List();
|
||||
|
||||
|
||||
Future getCreateNewBabyOrders({ CreateNewBaby newChild}) async {
|
||||
hasError = 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());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
import 'dart:convert';
|
||||
|
||||
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';
|
||||
import '../base_service.dart';
|
||||
|
||||
class ChildVaccinesService extends BaseService {
|
||||
List<List_BabyInformationModel> babyInformationModelList = List();
|
||||
List<List_UserInformationModel> userInformationModelList = List();
|
||||
|
||||
Map<String, dynamic> body = Map();
|
||||
Future getAllBabyInformationOrders() async {
|
||||
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,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
babyInformationModelList.clear();
|
||||
|
||||
response['List_BabyInformationModel'].forEach((vital) {
|
||||
babyInformationModelList.add(List_BabyInformationModel.fromJson(vital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/get_vacainations_itemsmodel.dart';
|
||||
|
||||
import '../base_service.dart';
|
||||
|
||||
class GetVccinationsItemsService extends BaseService {
|
||||
List<GET_VACCINATIONS_ITEMSMODEL> getVaccinationsItemModelList = List();
|
||||
Map<String, dynamic> body = Map();
|
||||
|
||||
|
||||
|
||||
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();
|
||||
response['List_CreateVaccinationTableModel'].forEach((vital) {
|
||||
getVaccinationsItemModelList.add(
|
||||
GET_VACCINATIONS_ITEMSMODEL.fromJson(vital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
|
||||
import '../base_service.dart';
|
||||
|
||||
class UserInformationService extends BaseService{
|
||||
|
||||
List<List_UserInformationModel> userInformationModelList = List();
|
||||
Map<String, dynamic> body = Map();
|
||||
|
||||
|
||||
|
||||
Future getUserInformationOrders() async {
|
||||
hasError = false;
|
||||
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 baseAppClient.post(GET_USERINFORMATION_REQUEST,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
userInformationModelList.clear();
|
||||
|
||||
response['List_UserInformationModel_New'].forEach((vital) {
|
||||
userInformationModelList.add(List_UserInformationModel.fromJson(vital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
|
||||
import '../base_service.dart';
|
||||
|
||||
class VaccinationTableService extends BaseService {
|
||||
List<CreateVaccinationTable> createVaccinationTableModelList = List();
|
||||
Map<String, dynamic> body = Map();
|
||||
|
||||
|
||||
|
||||
Future getCreateVaccinationTableOrders() 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) {
|
||||
createVaccinationTableModelList.clear();
|
||||
response['List_CreateVaccinationTableModel'].forEach((vital) {
|
||||
createVaccinationTableModelList.add(
|
||||
CreateVaccinationTable.fromJson(vital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: body);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
import '../base_view_model.dart';
|
||||
|
||||
|
||||
class AddNewChildViewModel extends BaseViewModel{
|
||||
|
||||
CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>();
|
||||
|
||||
|
||||
|
||||
List<CreateNewBaby> get creteNewBabyModelList=> _creteNewBabyService.createNewBabyModelList;
|
||||
getNewBabyOrders({ CreateNewBaby newChild}) async {
|
||||
setState(ViewState.Busy);
|
||||
|
||||
await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild);
|
||||
|
||||
if ( _creteNewBabyService.hasError) {
|
||||
error = _creteNewBabyService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
import '../base_view_model.dart';
|
||||
|
||||
class ChildVaccinesViewModel extends BaseViewModel{
|
||||
|
||||
|
||||
ChildVaccinesService _childVaccinesService = locator<ChildVaccinesService>();
|
||||
|
||||
|
||||
|
||||
List<List_BabyInformationModel> get babyInformationModelList=> _childVaccinesService.babyInformationModelList;//BabyInformationModelList;
|
||||
getBabyInformatioRequestOrders() async {
|
||||
setState(ViewState.Busy);
|
||||
|
||||
await _childVaccinesService.getAllBabyInformationOrders();
|
||||
|
||||
if (_childVaccinesService.hasError) {
|
||||
error = _childVaccinesService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/childvaccines/user_information_service.dart';
|
||||
import '../../../locator.dart';
|
||||
import '../base_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
|
||||
class UserInformationViewModel extends BaseViewModel {
|
||||
UserInformationService _userInformationService =
|
||||
locator<UserInformationService>();
|
||||
|
||||
List<List_UserInformationModel> get userInformationModelList =>
|
||||
_userInformationService.userInformationModelList;
|
||||
|
||||
getUserInformatioRequestOrders() async {
|
||||
setState(ViewState.Busy);
|
||||
|
||||
await _userInformationService.getUserInformationOrders();
|
||||
|
||||
if (_userInformationService.hasError) {
|
||||
error = _userInformationService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/childvaccines/vaccination_table_service.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
import '../base_view_model.dart';
|
||||
|
||||
|
||||
class VaccinationTableViewModel extends BaseViewModel{
|
||||
|
||||
VaccinationTableService _creteVaccinationTableService = locator<VaccinationTableService>();
|
||||
|
||||
// String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent;
|
||||
//String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent;
|
||||
List<CreateVaccinationTable> get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList;
|
||||
getCreateVaccinationTable() async {
|
||||
setState(ViewState.Busy);
|
||||
|
||||
await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders();
|
||||
|
||||
if ( _creteVaccinationTableService.hasError) {
|
||||
error = _creteVaccinationTableService.error;
|
||||
setState(ViewState.Error);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,331 @@
|
||||
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/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';
|
||||
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.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';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
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 }
|
||||
|
||||
class AddNewChildPage extends StatefulWidget {
|
||||
final int frequency;
|
||||
final int days;
|
||||
final String itemDescription;
|
||||
String dateAdd;
|
||||
|
||||
List<DateTime> _scheduleList = List();
|
||||
List<DayOfWeek> daysOfWeek = [
|
||||
DayOfWeek.Monday,
|
||||
DayOfWeek.Tuesday,
|
||||
DayOfWeek.Wednesday,
|
||||
DayOfWeek.Thursday,
|
||||
DayOfWeek.Friday,
|
||||
DayOfWeek.Saturday,
|
||||
DayOfWeek.Sunday
|
||||
];
|
||||
|
||||
DateTime startDay;
|
||||
DateTime endDay;
|
||||
|
||||
//AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key);
|
||||
AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) {
|
||||
startDay = DateTime.now();
|
||||
endDay =
|
||||
DateTime.now(); //endDay = DateTime.now().add(Duration(days: days));
|
||||
int hour = 24; //(24 / frequency).round();
|
||||
int durations = 24 ~/ hour;
|
||||
for (int count = 0; count < durations; count++) {
|
||||
_scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month,
|
||||
DateTime.now().day, (hour * count)));
|
||||
}
|
||||
}
|
||||
@override
|
||||
_AddNewChildPageState createState() => _AddNewChildPageState();
|
||||
}
|
||||
|
||||
class _AddNewChildPageState extends State<AddNewChildPage> {
|
||||
int tappedIndex;
|
||||
int checkedValue;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
tappedIndex = -1;
|
||||
}
|
||||
|
||||
TextEditingController _firstTextController = TextEditingController();
|
||||
TextEditingController _secondTextController = TextEditingController();
|
||||
TextEditingController _notesTextController = TextEditingController();
|
||||
BeneficiaryType beneficiaryType = BeneficiaryType.NON;
|
||||
Gender gender = Gender.Male;
|
||||
//ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel();
|
||||
List_BabyInformationModel addvancedModel = List_BabyInformationModel();
|
||||
CreateNewBaby newChild=CreateNewBaby();
|
||||
List_UserInformationModel informationModel =List_UserInformationModel();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<AddNewChildViewModel>(
|
||||
builder: (_,model,w)=> AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: "Vaccintion",
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Texts(
|
||||
"Add the child's information below to recieve the schedule of vaccinations.", //+model.user.firstName,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
NewTextFields(
|
||||
hintText: "First Name",
|
||||
controller: _firstTextController,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
NewTextFields(
|
||||
hintText: "Second Name",
|
||||
controller: _secondTextController,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Gender:",
|
||||
textAlign: TextAlign.end,
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
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,
|
||||
child: SecondaryButton(
|
||||
textColor:
|
||||
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());
|
||||
});
|
||||
|
||||
// bloodDetails.
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height * 0.12,
|
||||
width: 170,
|
||||
child: SecondaryButton(
|
||||
textColor:
|
||||
checkedValue == 2 ? Colors.white : Colors.black,
|
||||
color: checkedValue == 2 ? Colors.red : Colors.white,
|
||||
label: "Female",
|
||||
//
|
||||
onTap: () {
|
||||
setState(() {
|
||||
checkedValue = 2;
|
||||
print("checkedValue=" + checkedValue.toString());
|
||||
});
|
||||
// bloodDetails.city=_selectedHospital.toString();
|
||||
|
||||
// bloodDetails.
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
//==========
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Date Of Birth::",
|
||||
textAlign: TextAlign.end,
|
||||
),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
DatePicker.showDatePicker(
|
||||
context,
|
||||
showTitleActions: true,
|
||||
// minTime: DateTime(
|
||||
// DateTime.now().year, DateTime.now().month - 1, 1),
|
||||
minTime: DateTime(1, 1, 1),
|
||||
maxTime: DateTime.now(),
|
||||
onConfirm: (date) {
|
||||
setState(() {
|
||||
widget.startDay = date;
|
||||
});
|
||||
},
|
||||
currentTime: widget.startDay,
|
||||
// locale: projectViewModel.localeType
|
||||
);
|
||||
},
|
||||
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(//getStartDay()
|
||||
// DateUtil.yearMonthDay(DateTime.now())
|
||||
getStartDay()
|
||||
),
|
||||
Icon(
|
||||
Icons.calendar_today,
|
||||
color: Colors.black,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
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);
|
||||
|
||||
|
||||
|
||||
AppToast.showSuccessToast(message: "Record Added");
|
||||
//============
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: ChildPage(),
|
||||
|
||||
),
|
||||
);
|
||||
//==============
|
||||
|
||||
// bloodDetails.
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getStartDay() {
|
||||
return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}";
|
||||
}
|
||||
|
||||
String getEndDay() {
|
||||
return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}";
|
||||
}
|
||||
|
||||
String getDateTime(DateTime dateTime) {
|
||||
return '${dateTime.hour}:${dateTime.minute}';
|
||||
}
|
||||
|
||||
String getDays() {
|
||||
String days = "";
|
||||
widget.daysOfWeek.forEach((element) {
|
||||
days += "${DateUtil.getDay(element)},";
|
||||
});
|
||||
return days;
|
||||
}
|
||||
|
||||
void confirmSelectDayDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: DayCheckBoxDialog(
|
||||
title: 'Select Day',
|
||||
selectedDaysOfWeek: widget.daysOfWeek,
|
||||
onValueSelected: (value) {
|
||||
setState(() {
|
||||
widget.daysOfWeek = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.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/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
|
||||
class ChildPage extends StatefulWidget {
|
||||
|
||||
|
||||
@override
|
||||
_ChildPageState createState() => _ChildPageState();
|
||||
}
|
||||
|
||||
class _ChildPageState extends State<ChildPage> with SingleTickerProviderStateMixin {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var checkedValue= true;
|
||||
return BaseView<ChildVaccinesViewModel>(
|
||||
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),
|
||||
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(),
|
||||
|
||||
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,457 @@
|
||||
|
||||
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
|
||||
class ChildVaccinesPage extends StatefulWidget {
|
||||
@override
|
||||
_ChildVaccinesPageState createState() => _ChildVaccinesPageState();
|
||||
}
|
||||
|
||||
class _ChildVaccinesPageState extends State<ChildVaccinesPage>
|
||||
with SingleTickerProviderStateMixin{
|
||||
TextEditingController titleController = TextEditingController();
|
||||
var checkedValue=false;
|
||||
String addEmail="";
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return BaseView<UserInformationViewModel>(
|
||||
onModelReady: (model) => model.getUserInformatioRequestOrders(),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
baseViewModel: model,
|
||||
appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child:Container(
|
||||
child: Texts("Welcome back",fontSize: 20,),
|
||||
) ,
|
||||
),
|
||||
Divider(color:Colors.black ,),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child:Container(
|
||||
child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,),
|
||||
) ,
|
||||
),
|
||||
|
||||
Divider(color:Colors.black ,),
|
||||
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',
|
||||
controller: titleController,
|
||||
fontSize: 20,
|
||||
hintColor: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
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) {
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
return model.user.emailAddress;
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
return model.user.emailAddress;}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height * 0.12,
|
||||
width: double.infinity,
|
||||
|
||||
padding: EdgeInsets.all(12),
|
||||
child: SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,),
|
||||
label: "UPDATE EMAIL",
|
||||
//
|
||||
onTap: (){
|
||||
model.user.emailAddress=addEmail.toString();
|
||||
AppToast.showSuccessToast(
|
||||
message: "Email updated");
|
||||
// bloodDetails.city=_selectedHospital.toString();
|
||||
|
||||
// bloodDetails.
|
||||
},
|
||||
|
||||
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height * 0.12,
|
||||
width: double.infinity,
|
||||
|
||||
padding: EdgeInsets.all(12),
|
||||
child: SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
color: Color.fromRGBO(63, 72, 74, 1,),
|
||||
label: " VIEW LIST OF CHILDREN",
|
||||
//
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: ChildPage(),
|
||||
|
||||
//ChildPage(babyInformationModelList:model.BabyInformationModelList)
|
||||
// HospitalsPage(
|
||||
// findusHospitalModelList: model.FindusHospitalModelList,
|
||||
// )
|
||||
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
),
|
||||
),
|
||||
// Texts(
|
||||
// // TranslationBase.of(context).advancePaymentLabel,
|
||||
// model.user.emailAddress,
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
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,
|
||||
),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Center(
|
||||
// child: Container(
|
||||
// color: Colors.white,
|
||||
// width: 350,
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (_) =>
|
||||
// AssetGiffyDialog(
|
||||
// title: Text(
|
||||
// "",
|
||||
// style: TextStyle(
|
||||
// fontSize: 22.0,
|
||||
// fontWeight:
|
||||
// FontWeight
|
||||
// .w600),
|
||||
// ),
|
||||
// image: Image.asset(
|
||||
// 'assets/images/BloodChrt_EN.png'),
|
||||
// buttonCancelText:
|
||||
// Text('cancel'),
|
||||
// buttonCancelColor:
|
||||
// Colors.grey,
|
||||
// onlyCancelButton: true,
|
||||
// ));
|
||||
// },
|
||||
// child: Container(
|
||||
// width: 250,
|
||||
// height: 200,
|
||||
// child:Image.asset(
|
||||
// 'assets/images/BloodChrt_EN.png')),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.15,
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,105 @@
|
||||
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 SelectGenderDialog extends StatefulWidget {
|
||||
@override
|
||||
_SelectGenderDialogState createState() => _SelectGenderDialogState();
|
||||
}
|
||||
|
||||
class _SelectGenderDialogState extends State<SelectGenderDialog> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Divider(),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
//beneficiaryType = Gender.Male;
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "),
|
||||
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
|
||||
import 'dialogs/SelectGenderDialog.dart';
|
||||
|
||||
class VaccinationTablePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var checkedValue;
|
||||
return BaseView<VaccinationTableViewModel>(
|
||||
onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
baseViewModel: model,
|
||||
appBarTitle: "Vaccination",
|
||||
body: SingleChildScrollView(
|
||||
child:Container(
|
||||
margin: EdgeInsets.only(left: 15,right: 15,top: 70),
|
||||
child: Column(
|
||||
children: [//babyInformationModelList.length
|
||||
...List.generate(model.creteVaccinationTableModelList.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),
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
|
||||
children: [
|
||||
Row(children: [
|
||||
Text(model.creteVaccinationTableModelList[index].visit),
|
||||
SizedBox(width: 10,),
|
||||
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Html(
|
||||
// data:"<html><head><style type='text/css'>.Test {list-style-image:url('http://10.50.100.198:4444/Images/Bullet_List_Small.png');}</style></head><body><table><tr align='left'><td align='left'>BCG</td></tr><tr align='left'><td align='left'>HEPATITIS B</td></tr></table></body></html>"//model.creteVaccinationTableModelList[index].vaccinesDescription
|
||||
data:model.creteVaccinationTableModelList[index].vaccinesDescription,
|
||||
|
||||
),
|
||||
],),
|
||||
),
|
||||
Text(model.creteVaccinationTableModelList[index].givenAt),
|
||||
|
||||
|
||||
],),
|
||||
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"),]),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
),
|
||||
),
|
||||
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: "Send Email ",
|
||||
//
|
||||
onTap: () {
|
||||
//SelectGenderDialog();
|
||||
//===============
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SelectGenderDialog(
|
||||
),
|
||||
);
|
||||
//=========
|
||||
}
|
||||
|
||||
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue