Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into patient_registration
Conflicts: lib/config/config.dart lib/locator.dartmerge-requests/866/head
commit
5ad9976c40
Binary file not shown.
|
After Width: | Height: | Size: 969 B |
@ -0,0 +1,5 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
|
||||||
|
class PatientRegisterService extends BaseService{
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_request_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/pending_orders/pending_order_request_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart';
|
||||||
|
|
||||||
|
class PendingOrderService extends BaseService {
|
||||||
|
List<PendingOrderModel> _pendingOrderList = List();
|
||||||
|
List<PendingOrderModel> get pendingOrderList => _pendingOrderList;
|
||||||
|
|
||||||
|
List<AdmissionOrdersModel> _admissionOrderList = List();
|
||||||
|
List<AdmissionOrdersModel> get admissionOrderList => _admissionOrderList;
|
||||||
|
|
||||||
|
Future getPendingOrders(
|
||||||
|
{PendingOrderRequestModel pendingOrderRequestModel,
|
||||||
|
int patientId,
|
||||||
|
int admissionNo}) async {
|
||||||
|
pendingOrderRequestModel = PendingOrderRequestModel(
|
||||||
|
patientID: patientId,
|
||||||
|
admissionNo: admissionNo,
|
||||||
|
patientTypeID: 1,
|
||||||
|
patientType: 1,
|
||||||
|
setupID: "010266");
|
||||||
|
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(GET_PENDING_ORDERS,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
print("Success");
|
||||||
|
_pendingOrderList.clear();
|
||||||
|
response['List_PendingOrders'].forEach(
|
||||||
|
(v) {
|
||||||
|
_pendingOrderList.add(PendingOrderModel.fromJson(v));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: pendingOrderRequestModel.toJson());
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getAdmissionOrders(
|
||||||
|
{AdmissionOrdersRequestModel admissionOrdersRequestModel,
|
||||||
|
int patientId,
|
||||||
|
int admissionNo}) async {
|
||||||
|
admissionOrdersRequestModel = AdmissionOrdersRequestModel(
|
||||||
|
patientID: patientId,
|
||||||
|
admissionNo: admissionNo,
|
||||||
|
patientTypeID: 1,
|
||||||
|
patientType: 1,
|
||||||
|
setupID: "010266");
|
||||||
|
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(GET_ADMISSION_ORDERS,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
print("Success");
|
||||||
|
//admissionOrderList.clear();
|
||||||
|
response['List_AdmissionOrders'].forEach(
|
||||||
|
(v) {
|
||||||
|
_admissionOrderList.add(AdmissionOrdersModel.fromJson(v));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: admissionOrdersRequestModel.toJson());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/service/patient/PatientRegisterService.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||||
|
|
||||||
|
import '../../locator.dart';
|
||||||
|
|
||||||
|
class PatientRegisterViewModel extends BaseViewModel {
|
||||||
|
PatientRegisterService _service = locator<PatientRegisterService>();
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/pending_order_service.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/locator.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/admisson_orders/admission_orders_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/pending_orders/pending_orders_model.dart';
|
||||||
|
|
||||||
|
class PendingOrdersViewModel extends BaseViewModel {
|
||||||
|
bool hasError = false;
|
||||||
|
PendingOrderService _pendingOrderService = locator<PendingOrderService>();
|
||||||
|
|
||||||
|
List<PendingOrderModel> get pendingOrdersList =>
|
||||||
|
_pendingOrderService.pendingOrderList;
|
||||||
|
|
||||||
|
List<AdmissionOrdersModel> get admissionOrderList =>
|
||||||
|
_pendingOrderService.admissionOrderList;
|
||||||
|
|
||||||
|
Future getPendingOrders({int patientId, int admissionNo}) async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pendingOrderService.getPendingOrders(
|
||||||
|
patientId: patientId, admissionNo: admissionNo);
|
||||||
|
if (_pendingOrderService.hasError) {
|
||||||
|
error = _pendingOrderService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else {
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getAdmissionOrders({int patientId, int admissionNo}) async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pendingOrderService.getAdmissionOrders(
|
||||||
|
patientId: patientId, admissionNo: admissionNo);
|
||||||
|
if (_pendingOrderService.hasError) {
|
||||||
|
error = _pendingOrderService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else {
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
class AdmissionOrdersModel {
|
||||||
|
int procedureID;
|
||||||
|
String procedureName;
|
||||||
|
String procedureNameN;
|
||||||
|
int orderNo;
|
||||||
|
int doctorID;
|
||||||
|
int clinicID;
|
||||||
|
String createdOn;
|
||||||
|
int createdBy;
|
||||||
|
String editedOn;
|
||||||
|
int editedBy;
|
||||||
|
|
||||||
|
AdmissionOrdersModel(
|
||||||
|
{this.procedureID,
|
||||||
|
this.procedureName,
|
||||||
|
this.procedureNameN,
|
||||||
|
this.orderNo,
|
||||||
|
this.doctorID,
|
||||||
|
this.clinicID,
|
||||||
|
this.createdOn,
|
||||||
|
this.createdBy,
|
||||||
|
this.editedOn,
|
||||||
|
this.editedBy});
|
||||||
|
|
||||||
|
AdmissionOrdersModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
procedureID = json['ProcedureID'];
|
||||||
|
procedureName = json['ProcedureName'];
|
||||||
|
procedureNameN = json['ProcedureNameN'];
|
||||||
|
orderNo = json['OrderNo'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
editedOn = json['EditedOn'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ProcedureID'] = this.procedureID;
|
||||||
|
data['ProcedureName'] = this.procedureName;
|
||||||
|
data['ProcedureNameN'] = this.procedureNameN;
|
||||||
|
data['OrderNo'] = this.orderNo;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['EditedOn'] = this.editedOn;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
class AdmissionOrdersRequestModel {
|
||||||
|
bool isDentalAllowedBackend;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
int languageID;
|
||||||
|
String iPAdress;
|
||||||
|
String generalid;
|
||||||
|
int deviceTypeID;
|
||||||
|
String tokenID;
|
||||||
|
int patientID;
|
||||||
|
int admissionNo;
|
||||||
|
String sessionID;
|
||||||
|
int projectID;
|
||||||
|
String setupID;
|
||||||
|
bool patientOutSA;
|
||||||
|
int patientType;
|
||||||
|
int patientTypeID;
|
||||||
|
|
||||||
|
AdmissionOrdersRequestModel(
|
||||||
|
{this.isDentalAllowedBackend,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.languageID,
|
||||||
|
this.iPAdress,
|
||||||
|
this.generalid,
|
||||||
|
this.deviceTypeID,
|
||||||
|
this.tokenID,
|
||||||
|
this.patientID,
|
||||||
|
this.admissionNo,
|
||||||
|
this.sessionID,
|
||||||
|
this.projectID,
|
||||||
|
this.setupID,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.patientType,
|
||||||
|
this.patientTypeID});
|
||||||
|
|
||||||
|
AdmissionOrdersRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
generalid = json['generalid'];
|
||||||
|
deviceTypeID = json['DeviceTypeID'];
|
||||||
|
tokenID = json['TokenID'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
patientTypeID = json['PatientTypeID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['generalid'] = this.generalid;
|
||||||
|
data['DeviceTypeID'] = this.deviceTypeID;
|
||||||
|
data['TokenID'] = this.tokenID;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['PatientTypeID'] = this.patientTypeID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
class PendingOrderRequestModel {
|
||||||
|
bool isDentalAllowedBackend;
|
||||||
|
double versionID;
|
||||||
|
int channel;
|
||||||
|
int languageID;
|
||||||
|
String iPAdress;
|
||||||
|
String generalid;
|
||||||
|
int deviceTypeID;
|
||||||
|
String tokenID;
|
||||||
|
int patientID;
|
||||||
|
int admissionNo;
|
||||||
|
String sessionID;
|
||||||
|
int projectID;
|
||||||
|
String setupID;
|
||||||
|
bool patientOutSA;
|
||||||
|
int patientType;
|
||||||
|
int patientTypeID;
|
||||||
|
|
||||||
|
PendingOrderRequestModel(
|
||||||
|
{this.isDentalAllowedBackend,
|
||||||
|
this.versionID,
|
||||||
|
this.channel,
|
||||||
|
this.languageID,
|
||||||
|
this.iPAdress,
|
||||||
|
this.generalid,
|
||||||
|
this.deviceTypeID,
|
||||||
|
this.tokenID,
|
||||||
|
this.patientID,
|
||||||
|
this.admissionNo,
|
||||||
|
this.sessionID,
|
||||||
|
this.projectID,
|
||||||
|
this.setupID,
|
||||||
|
this.patientOutSA,
|
||||||
|
this.patientType,
|
||||||
|
this.patientTypeID});
|
||||||
|
|
||||||
|
PendingOrderRequestModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||||
|
versionID = json['VersionID'];
|
||||||
|
channel = json['Channel'];
|
||||||
|
languageID = json['LanguageID'];
|
||||||
|
iPAdress = json['IPAdress'];
|
||||||
|
generalid = json['generalid'];
|
||||||
|
deviceTypeID = json['DeviceTypeID'];
|
||||||
|
tokenID = json['TokenID'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
sessionID = json['SessionID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
patientOutSA = json['PatientOutSA'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
patientTypeID = json['PatientTypeID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||||
|
data['VersionID'] = this.versionID;
|
||||||
|
data['Channel'] = this.channel;
|
||||||
|
data['LanguageID'] = this.languageID;
|
||||||
|
data['IPAdress'] = this.iPAdress;
|
||||||
|
data['generalid'] = this.generalid;
|
||||||
|
data['DeviceTypeID'] = this.deviceTypeID;
|
||||||
|
data['TokenID'] = this.tokenID;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['SessionID'] = this.sessionID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['PatientOutSA'] = this.patientOutSA;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['PatientTypeID'] = this.patientTypeID;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
class PendingOrderModel {
|
||||||
|
String notes;
|
||||||
|
|
||||||
|
PendingOrderModel({this.notes});
|
||||||
|
|
||||||
|
PendingOrderModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
notes = json['Notes'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['Notes'] = this.notes;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,351 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class AdmissionOrdersScreen extends StatefulWidget {
|
||||||
|
const AdmissionOrdersScreen({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AdmissionOrdersScreenState createState() => _AdmissionOrdersScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AdmissionOrdersScreenState extends State<AdmissionOrdersScreen> {
|
||||||
|
bool isDischargedPatient = false;
|
||||||
|
|
||||||
|
AuthenticationViewModel authenticationViewModel;
|
||||||
|
|
||||||
|
ProjectViewModel projectViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
authenticationViewModel = Provider.of(context);
|
||||||
|
projectViewModel = Provider.of(context);
|
||||||
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||||
|
PatiantInformtion patient = routeArgs['patient'];
|
||||||
|
String arrivalType = routeArgs['arrivalType'];
|
||||||
|
if (routeArgs.containsKey('isDischargedPatient'))
|
||||||
|
isDischargedPatient = routeArgs['isDischargedPatient'];
|
||||||
|
return BaseView<PendingOrdersViewModel>(
|
||||||
|
onModelReady: (model) => model.getAdmissionOrders(
|
||||||
|
admissionNo: 2014005178, patientId: patient.patientMRN),
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
//appBarTitle: TranslationBase.of(context).progressNote,
|
||||||
|
appBar: PatientProfileAppBar(
|
||||||
|
patient,
|
||||||
|
isInpatient: true,
|
||||||
|
),
|
||||||
|
body: model.admissionOrderList == null ||
|
||||||
|
model.admissionOrderList.length == 0
|
||||||
|
? DrAppEmbeddedError(
|
||||||
|
error: TranslationBase.of(context).noDataAvailable)
|
||||||
|
: Container(
|
||||||
|
color: Colors.grey[200],
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(12.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context).admission,
|
||||||
|
fontSize: 15.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context).orders,
|
||||||
|
fontSize: 30.0,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: model.admissionOrderList.length,
|
||||||
|
itemBuilder: (BuildContext ctxt, int index) {
|
||||||
|
return FractionallySizedBox(
|
||||||
|
widthFactor: 0.95,
|
||||||
|
child: CardWithBgWidget(
|
||||||
|
hasBorder: false,
|
||||||
|
// bgColor: model.admissionOrderList[index]
|
||||||
|
// .status ==
|
||||||
|
// 1 &&
|
||||||
|
// authenticationViewModel
|
||||||
|
// .doctorProfile.doctorID !=
|
||||||
|
// model
|
||||||
|
// .patientProgressNoteList[
|
||||||
|
// index]
|
||||||
|
// .createdBy
|
||||||
|
// ? Color(0xFFCC9B14)
|
||||||
|
// : model.patientProgressNoteList[index]
|
||||||
|
// .status ==
|
||||||
|
// 4
|
||||||
|
// ? Colors.red.shade700
|
||||||
|
// : model.patientProgressNoteList[index]
|
||||||
|
// .status ==
|
||||||
|
// 2
|
||||||
|
// ? Colors.green[600]
|
||||||
|
// : Color(0xFFCC9B14),
|
||||||
|
widget: Column(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 10,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 10,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width *
|
||||||
|
0.60,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(
|
||||||
|
context)
|
||||||
|
.createdBy
|
||||||
|
.toString(),
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: AppText(
|
||||||
|
model
|
||||||
|
.admissionOrderList[
|
||||||
|
index]
|
||||||
|
.createdBy
|
||||||
|
.toString() ??
|
||||||
|
'',
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w600,
|
||||||
|
fontSize: 12,
|
||||||
|
isCopyable: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(
|
||||||
|
context)
|
||||||
|
.procedureName
|
||||||
|
.toString(),
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: AppText(
|
||||||
|
model
|
||||||
|
.admissionOrderList[
|
||||||
|
index]
|
||||||
|
.procedureName
|
||||||
|
.toString() ??
|
||||||
|
'',
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w600,
|
||||||
|
fontSize: 12,
|
||||||
|
isCopyable: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(
|
||||||
|
context)
|
||||||
|
.orderNo
|
||||||
|
.toString(),
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: AppText(
|
||||||
|
model
|
||||||
|
.admissionOrderList[
|
||||||
|
index]
|
||||||
|
.orderNo
|
||||||
|
.toString() ??
|
||||||
|
'',
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w600,
|
||||||
|
fontSize: 12,
|
||||||
|
isCopyable: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// Row(
|
||||||
|
// crossAxisAlignment:
|
||||||
|
// CrossAxisAlignment
|
||||||
|
// .start,
|
||||||
|
// children: [
|
||||||
|
// AppText(
|
||||||
|
// TranslationBase.of(
|
||||||
|
// context)
|
||||||
|
// .createdBy
|
||||||
|
// .toString(),
|
||||||
|
// fontSize: 10,
|
||||||
|
// ),
|
||||||
|
// Expanded(
|
||||||
|
// child: AppText(
|
||||||
|
// model
|
||||||
|
// .admissionOrderList[
|
||||||
|
// index]
|
||||||
|
// .createdBy
|
||||||
|
// .toString() ??
|
||||||
|
// '',
|
||||||
|
// fontWeight:
|
||||||
|
// FontWeight.w600,
|
||||||
|
// fontSize: 12,
|
||||||
|
// isCopyable: true,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
model
|
||||||
|
.admissionOrderList[
|
||||||
|
index]
|
||||||
|
.createdOn !=
|
||||||
|
null
|
||||||
|
? AppDateUtils.getDayMonthYearDateFormatted(
|
||||||
|
AppDateUtils
|
||||||
|
.getDateTimeFromServerFormat(model
|
||||||
|
.admissionOrderList[
|
||||||
|
index]
|
||||||
|
.createdOn),
|
||||||
|
isArabic:
|
||||||
|
projectViewModel
|
||||||
|
.isArabic,
|
||||||
|
isMonthShort: true)
|
||||||
|
: AppDateUtils
|
||||||
|
.getDayMonthYearDateFormatted(
|
||||||
|
DateTime.now(),
|
||||||
|
isArabic:
|
||||||
|
projectViewModel
|
||||||
|
.isArabic),
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 14,
|
||||||
|
isCopyable: true,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
model
|
||||||
|
.admissionOrderList[
|
||||||
|
index]
|
||||||
|
.createdOn !=
|
||||||
|
null
|
||||||
|
? AppDateUtils.getHour(
|
||||||
|
AppDateUtils
|
||||||
|
.getDateTimeFromServerFormat(model
|
||||||
|
.admissionOrderList[
|
||||||
|
index]
|
||||||
|
.createdOn))
|
||||||
|
: AppDateUtils.getHour(
|
||||||
|
DateTime.now()),
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 14,
|
||||||
|
isCopyable: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.end,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
|
// Row(
|
||||||
|
// mainAxisAlignment:
|
||||||
|
// MainAxisAlignment.start,
|
||||||
|
// children: [
|
||||||
|
// Expanded(
|
||||||
|
// child: AppText(
|
||||||
|
// model
|
||||||
|
// .admissionOrderList[
|
||||||
|
// index]
|
||||||
|
// .notes,
|
||||||
|
// fontSize: 10,
|
||||||
|
// isCopyable: true,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ])
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class PendingOrdersScreen extends StatelessWidget {
|
||||||
|
const PendingOrdersScreen({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||||
|
PatiantInformtion patient = routeArgs['patient'];
|
||||||
|
patient = routeArgs['patient'];
|
||||||
|
String patientType = routeArgs['patientType'];
|
||||||
|
bool isInpatient = routeArgs['isInpatient'];
|
||||||
|
return BaseView<PendingOrdersViewModel>(
|
||||||
|
onModelReady: (model) => model.getPendingOrders(
|
||||||
|
patientId: patient.patientMRN,
|
||||||
|
admissionNo: int.parse(patient.admissionNo)),
|
||||||
|
builder:
|
||||||
|
(BuildContext context, PendingOrdersViewModel model, Widget child) =>
|
||||||
|
AppScaffold(
|
||||||
|
appBar: PatientProfileAppBar(
|
||||||
|
patient,
|
||||||
|
isInpatient: isInpatient,
|
||||||
|
),
|
||||||
|
isShowAppBar: true,
|
||||||
|
baseViewModel: model,
|
||||||
|
appBarTitle: "Pending Orders",
|
||||||
|
body: model.pendingOrdersList == null ||
|
||||||
|
model.pendingOrdersList.length == 0
|
||||||
|
? DrAppEmbeddedError(
|
||||||
|
error: TranslationBase.of(context).noDataAvailable)
|
||||||
|
: Container(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: model.pendingOrdersList.length,
|
||||||
|
itemBuilder: (BuildContext ctxt, int index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(10.0),
|
||||||
|
),
|
||||||
|
border: Border.all(
|
||||||
|
color: Color(0xFF707070), width: 0.30),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child:
|
||||||
|
AppText(model.pendingOrdersList[index].notes),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,212 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/PatientRegisterViewModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'RegisterSearchPatientPage.dart';
|
||||||
|
|
||||||
|
class RegisterPatientPage extends StatefulWidget {
|
||||||
|
const RegisterPatientPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_RegisterPatientPageState createState() => _RegisterPatientPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RegisterPatientPageState extends State<RegisterPatientPage>
|
||||||
|
with TickerProviderStateMixin {
|
||||||
|
PageController _controller;
|
||||||
|
int _currentIndex = 0;
|
||||||
|
bool _isLoading = false;
|
||||||
|
|
||||||
|
changePageViewIndex(pageIndex, {isChangeState = true}) {
|
||||||
|
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
|
||||||
|
_controller.jumpToPage(pageIndex);
|
||||||
|
setState(() {
|
||||||
|
_currentIndex = pageIndex;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeLoadingState(bool isLoading) {
|
||||||
|
setState(() {
|
||||||
|
_isLoading = isLoading;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_controller = new PageController();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_controller.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final screenSize = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
return BaseView<PatientRegisterViewModel>(
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: true,
|
||||||
|
isLoading: _isLoading,
|
||||||
|
appBar: PatientSearchHeader(
|
||||||
|
title: TranslationBase.of(context).registeraPatient,
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
PageStepperWidget(
|
||||||
|
stepsCount: 3,
|
||||||
|
currentStepIndex: _currentIndex + 1,
|
||||||
|
screenSize: screenSize,
|
||||||
|
stepsTitles: [
|
||||||
|
"Search",
|
||||||
|
"Activation",
|
||||||
|
"Confirmation",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
color: Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
child: PageView(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
controller: _controller,
|
||||||
|
onPageChanged: (index) {
|
||||||
|
setState(() {
|
||||||
|
_currentIndex = index;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
children: <Widget>[
|
||||||
|
RegisterSearchPatientPage(),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
_isLoading
|
||||||
|
? Container(
|
||||||
|
height: 0,
|
||||||
|
)
|
||||||
|
: pagerButtons(model),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget pagerButtons(PatientRegisterViewModel model) {
|
||||||
|
switch (_currentIndex) {
|
||||||
|
case 2:
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).cancel,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 12,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Color(0xFFeaeaea),
|
||||||
|
color: Color(0xFFeaeaea),
|
||||||
|
fontColor: Colors.black,
|
||||||
|
fontSize: 2.2,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 8,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).noteConfirm,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 12,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Color(0xFF359846),
|
||||||
|
color: Color(0xFF359846),
|
||||||
|
fontColor: Colors.white,
|
||||||
|
fontSize: 2.0,
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
return Container(
|
||||||
|
color: Colors.white,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).cancel,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 12,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Color(0xFFeaeaea),
|
||||||
|
color: Color(0xFFeaeaea),
|
||||||
|
fontColor: Colors.black,
|
||||||
|
fontSize: 2.2,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 8,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: AppButton(
|
||||||
|
title: TranslationBase.of(context).next,
|
||||||
|
hasBorder: true,
|
||||||
|
vPadding: 12,
|
||||||
|
hPadding: 8,
|
||||||
|
borderColor: Color(0xFFB8382B),
|
||||||
|
color: Color(0xFFB8382B),
|
||||||
|
fontColor: Colors.white,
|
||||||
|
fontSize: 2.0,
|
||||||
|
onPressed: () {
|
||||||
|
changePageViewIndex(_currentIndex + 1);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,201 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/PatientRegisterViewModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class RegisterSearchPatientPage extends StatefulWidget {
|
||||||
|
const RegisterSearchPatientPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_RegisterSearchPatientPageState createState() =>
|
||||||
|
_RegisterSearchPatientPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
|
||||||
|
String countryError;
|
||||||
|
dynamic _selectedCountry;
|
||||||
|
|
||||||
|
final _phoneController = TextEditingController();
|
||||||
|
String phoneError;
|
||||||
|
|
||||||
|
final _idController = TextEditingController();
|
||||||
|
String idError;
|
||||||
|
|
||||||
|
DateTime _birthDate;
|
||||||
|
String birthdateError;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final screenSize = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
return BaseView<PatientRegisterViewModel>(
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: false,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
margin: EdgeInsets.all(16.0),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
"Please enter mobile number or Identification number",
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
fontSize: SizeConfig.textMultiplier * 2.2,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: screenSize.height * 0.075,
|
||||||
|
hintText: "Country",
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
validationError: countryError,
|
||||||
|
dropDownText: _selectedCountry != null
|
||||||
|
? _selectedCountry['nameEn']
|
||||||
|
: null,
|
||||||
|
enabled: false,
|
||||||
|
/*onClick: model.dietTypesList != null && model.dietTypesList.length > 0
|
||||||
|
? () {
|
||||||
|
openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedCountry = selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
: () async {
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
await model
|
||||||
|
.getDietTypes(patient.patientId)
|
||||||
|
.then((_) => GifLoaderDialogUtils.hideDialog(context));
|
||||||
|
if (model.state == ViewState.Idle && model.dietTypesList.length > 0) {
|
||||||
|
openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedCountry = selectedValue;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else if (model.state == ViewState.ErrorLocal) {
|
||||||
|
DrAppToastMsg.showErrorToast(model.error);
|
||||||
|
} else {
|
||||||
|
DrAppToastMsg.showErrorToast("Empty List");
|
||||||
|
}
|
||||||
|
},*/
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: screenSize.height * 0.075,
|
||||||
|
hintText: "Phone Number",
|
||||||
|
inputType: TextInputType.phone,
|
||||||
|
controller: _phoneController,
|
||||||
|
validationError: phoneError,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: screenSize.height * 0.075,
|
||||||
|
hintText: "ID Number",
|
||||||
|
inputType: TextInputType.phone,
|
||||||
|
controller: _idController,
|
||||||
|
validationError: idError,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
"Calender",
|
||||||
|
fontSize: SizeConfig.textMultiplier * 1.8,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: screenSize.height * 0.075,
|
||||||
|
hintText: "Birthdate",
|
||||||
|
dropDownText: _birthDate != null
|
||||||
|
? "${AppDateUtils.convertStringToDateFormat(_birthDate.toString(), "yyyy-MM-dd")}"
|
||||||
|
: null,
|
||||||
|
enabled: false,
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
validationError: birthdateError,
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.calendar_today,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
onPressed: null,
|
||||||
|
),
|
||||||
|
onClick: () {
|
||||||
|
if (_birthDate == null) {
|
||||||
|
_birthDate = DateTime.now();
|
||||||
|
}
|
||||||
|
_selectDate(context, _birthDate, (picked) {
|
||||||
|
setState(() {
|
||||||
|
_birthDate = picked;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future _selectDate(BuildContext context, DateTime dateTime,
|
||||||
|
Function(DateTime picked) updateDate) async {
|
||||||
|
final DateTime picked = await showDatePicker(
|
||||||
|
context: context,
|
||||||
|
initialDate: dateTime,
|
||||||
|
firstDate: DateTime.now(),
|
||||||
|
lastDate: DateTime(2040),
|
||||||
|
initialEntryMode: DatePickerEntryMode.calendar,
|
||||||
|
);
|
||||||
|
if (picked != null && picked != dateTime) {
|
||||||
|
updateDate(picked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void openListDialogField(String attributeName, String attributeValueId,
|
||||||
|
List<dynamic> list, Function(dynamic selectedValue) okFunction) {
|
||||||
|
ListSelectDialog dialog = ListSelectDialog(
|
||||||
|
list: list,
|
||||||
|
attributeName: attributeName,
|
||||||
|
attributeValueId: attributeValueId,
|
||||||
|
usingSearch: true,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
okFunction: (selectedValue) {
|
||||||
|
okFunction(selectedValue);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
showDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue