Merge branch 'feature_admission_request' into 'development'
Feature admission request See merge request Cloud_Solution/doctor_app_flutter!210merge-requests/212/merge
						commit
						13be95a0bb
					
				@ -0,0 +1,31 @@
 | 
			
		||||
import 'package:doctor_app_flutter/config/config.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
 | 
			
		||||
 | 
			
		||||
class AdmissionRequestService extends LookupService {
 | 
			
		||||
  List<dynamic> doctorsList = [];
 | 
			
		||||
  List<dynamic> specialityList = [];
 | 
			
		||||
 | 
			
		||||
  setSpecialityList() {
 | 
			
		||||
    specialityList.clear();
 | 
			
		||||
    listOfSpeciality.forEach((element) {
 | 
			
		||||
      specialityList.add(element.toJson());
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future getDoctorsList() async {
 | 
			
		||||
    hasError = false;
 | 
			
		||||
 | 
			
		||||
    await baseAppClient.post(
 | 
			
		||||
      PATIENT_GET_DOCTOR_BY_CLINIC_URL,
 | 
			
		||||
      onSuccess: (dynamic response, int statusCode) {
 | 
			
		||||
        doctorsList = [];
 | 
			
		||||
        doctorsList = response['List_Doctors_All'];
 | 
			
		||||
      },
 | 
			
		||||
      onFailure: (String error, int statusCode) {
 | 
			
		||||
        hasError = true;
 | 
			
		||||
        super.error = error;
 | 
			
		||||
      },
 | 
			
		||||
      body: Map(),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,5 @@
 | 
			
		||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
 | 
			
		||||
 | 
			
		||||
class UcafService extends BaseService {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,46 @@
 | 
			
		||||
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
 | 
			
		||||
 | 
			
		||||
import '../../locator.dart';
 | 
			
		||||
 | 
			
		||||
class AdmissionRequestViewModel extends BaseViewModel{
 | 
			
		||||
 | 
			
		||||
  AdmissionRequestService _admissionRequestService = locator<AdmissionRequestService>();
 | 
			
		||||
 | 
			
		||||
  List<dynamic> get doctorsList => _admissionRequestService.doctorsList;
 | 
			
		||||
 | 
			
		||||
  List<dynamic>  get speciality => _admissionRequestService.specialityList;
 | 
			
		||||
 | 
			
		||||
  String selectedLanguage;
 | 
			
		||||
 | 
			
		||||
  Future getLanguage() async {
 | 
			
		||||
    selectedLanguage =  await sharedPref.getString(APP_Language);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future getMasterLookup() async {
 | 
			
		||||
    setState(ViewState.Busy);
 | 
			
		||||
    await getLanguage();
 | 
			
		||||
    await _admissionRequestService.getMasterLookup(MasterKeysService.Speciality);
 | 
			
		||||
    if (_admissionRequestService.hasError) {
 | 
			
		||||
      error = _admissionRequestService.error;
 | 
			
		||||
      setState(ViewState.Error);
 | 
			
		||||
    } else {
 | 
			
		||||
      _admissionRequestService.setSpecialityList();
 | 
			
		||||
      await getClinicDoctors();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future getClinicDoctors() async {
 | 
			
		||||
    setState(ViewState.Busy);
 | 
			
		||||
    await _admissionRequestService.getDoctorsList();
 | 
			
		||||
    if (_admissionRequestService.hasError) {
 | 
			
		||||
      error = _admissionRequestService.error;
 | 
			
		||||
      setState(ViewState.Error);
 | 
			
		||||
    } else
 | 
			
		||||
      setState(ViewState.Idle);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,9 @@
 | 
			
		||||
import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
 | 
			
		||||
 | 
			
		||||
import '../../locator.dart';
 | 
			
		||||
 | 
			
		||||
class UcafViewModel extends BaseViewModel {
 | 
			
		||||
 | 
			
		||||
  UcafService _ucafService = locator<UcafService>();
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,433 @@
 | 
			
		||||
import 'package:doctor_app_flutter/config/config.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/config/size_config.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.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/helpers.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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:flutter/material.dart';
 | 
			
		||||
import 'package:flutter/services.dart';
 | 
			
		||||
import 'package:hexcolor/hexcolor.dart';
 | 
			
		||||
 | 
			
		||||
class UCAFInputScreen extends StatefulWidget {
 | 
			
		||||
  @override
 | 
			
		||||
  _UCAFInputScreenState createState() => _UCAFInputScreenState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _UCAFInputScreenState extends State<UCAFInputScreen> {
 | 
			
		||||
  bool _inPatient = false;
 | 
			
		||||
  bool _emergencyCase = false;
 | 
			
		||||
  final _durationOfIllnessController = TextEditingController();
 | 
			
		||||
  final _additionalComplaintsController = TextEditingController();
 | 
			
		||||
  final _otherController = TextEditingController();
 | 
			
		||||
  final _howController = TextEditingController();
 | 
			
		||||
  final _whenController = TextEditingController();
 | 
			
		||||
  final _whereController = TextEditingController();
 | 
			
		||||
  final _managementsLineController = TextEditingController();
 | 
			
		||||
  final _signsController = TextEditingController();
 | 
			
		||||
  List<Map> conditionsData = [
 | 
			
		||||
    {"name": "CHRONIC", "isChecked": false},
 | 
			
		||||
    {"name": "RTA", "isChecked": false},
 | 
			
		||||
    {"name": "PSYCHIATRIC", "isChecked": false},
 | 
			
		||||
    {"name": "WORK RELATED", "isChecked": false},
 | 
			
		||||
    {"name": "VACCINATION", "isChecked": false},
 | 
			
		||||
    {"name": "CONGENITAL", "isChecked": false},
 | 
			
		||||
    {"name": "INFERTILITY", "isChecked": false},
 | 
			
		||||
    {"name": "CHECK-UP", "isChecked": false},
 | 
			
		||||
    {"name": "PREGNANCY/INDICATE MP", "isChecked": false},
 | 
			
		||||
    {"name": "CLEANING", "isChecked": false},
 | 
			
		||||
    {"name": "ORTHO DONTICS", "isChecked": false},
 | 
			
		||||
    {"name": "SPORTS RELATED", "isChecked": false},
 | 
			
		||||
    {"name": "REGULAR DENTAL TREATMENT", "isChecked": false},
 | 
			
		||||
    {"name": "IS TRAUMA TREATMENT SPECIFY ETA", "isChecked": false},
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    final routeArgs = ModalRoute.of(context).settings.arguments as Map;
 | 
			
		||||
    PatiantInformtion patient = routeArgs['patient'];
 | 
			
		||||
    final screenSize = MediaQuery.of(context).size;
 | 
			
		||||
 | 
			
		||||
    return BaseView<UcafViewModel>(
 | 
			
		||||
      builder: (_, model, w) => AppScaffold(
 | 
			
		||||
        baseViewModel: model,
 | 
			
		||||
        appBarTitle: TranslationBase.of(context).ucaf,
 | 
			
		||||
        body: SingleChildScrollView(
 | 
			
		||||
          child: Column(
 | 
			
		||||
            children: [
 | 
			
		||||
              PatientHeaderWidget(patient),
 | 
			
		||||
              Container(
 | 
			
		||||
                margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
 | 
			
		||||
                child: Column(
 | 
			
		||||
                  crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
                  children: [
 | 
			
		||||
                    CheckboxListTile(
 | 
			
		||||
                      title: AppText(
 | 
			
		||||
                        TranslationBase.of(context).inPatient,
 | 
			
		||||
                        fontWeight: FontWeight.bold,
 | 
			
		||||
                        fontSize: SizeConfig.textMultiplier * 2.1,
 | 
			
		||||
                      ),
 | 
			
		||||
                      value: _inPatient,
 | 
			
		||||
                      onChanged: (newValue) {
 | 
			
		||||
                        setState(() {
 | 
			
		||||
                          _inPatient = newValue;
 | 
			
		||||
                        });
 | 
			
		||||
                      },
 | 
			
		||||
                      controlAffinity: ListTileControlAffinity.leading,
 | 
			
		||||
                      contentPadding: EdgeInsets.all(0),
 | 
			
		||||
                    ),
 | 
			
		||||
                    CheckboxListTile(
 | 
			
		||||
                      title: AppText(
 | 
			
		||||
                        TranslationBase.of(context).emergencyCase,
 | 
			
		||||
                        fontWeight: FontWeight.bold,
 | 
			
		||||
                        fontSize: SizeConfig.textMultiplier * 2.1,
 | 
			
		||||
                      ),
 | 
			
		||||
                      value: _emergencyCase,
 | 
			
		||||
                      onChanged: (newValue) {
 | 
			
		||||
                        setState(() {
 | 
			
		||||
                          _emergencyCase = newValue;
 | 
			
		||||
                        });
 | 
			
		||||
                      },
 | 
			
		||||
                      controlAffinity: ListTileControlAffinity.leading,
 | 
			
		||||
                      contentPadding: EdgeInsets.all(0),
 | 
			
		||||
                    ),
 | 
			
		||||
                    Container(
 | 
			
		||||
                        height: screenSize.height * 0.070,
 | 
			
		||||
                        child: TextField(
 | 
			
		||||
                          decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                              TranslationBase.of(context).durationOfIllness,
 | 
			
		||||
                              null,
 | 
			
		||||
                              false),
 | 
			
		||||
                          enabled: true,
 | 
			
		||||
                          controller: _durationOfIllnessController,
 | 
			
		||||
                          inputFormatters: [
 | 
			
		||||
                            FilteringTextInputFormatter.allow(
 | 
			
		||||
                                RegExp(ONLY_NUMBERS))
 | 
			
		||||
                          ],
 | 
			
		||||
                          keyboardType: TextInputType.number,
 | 
			
		||||
                        )),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 10,
 | 
			
		||||
                    ),
 | 
			
		||||
                    Row(
 | 
			
		||||
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
 | 
			
		||||
                      children: [
 | 
			
		||||
                        Row(
 | 
			
		||||
                          children: [
 | 
			
		||||
                            AppText(
 | 
			
		||||
                              "BP (H/L)",
 | 
			
		||||
                              fontSize: SizeConfig.textMultiplier * 1.8,
 | 
			
		||||
                              color: Colors.black,
 | 
			
		||||
                              fontWeight: FontWeight.w700,
 | 
			
		||||
                            ),
 | 
			
		||||
                            SizedBox(
 | 
			
		||||
                              width: 8,
 | 
			
		||||
                            ),
 | 
			
		||||
                            AppText(
 | 
			
		||||
                              "120/80",
 | 
			
		||||
                              fontSize: SizeConfig.textMultiplier * 2,
 | 
			
		||||
                              color: Colors.grey.shade800,
 | 
			
		||||
                              fontWeight: FontWeight.normal,
 | 
			
		||||
                            ),
 | 
			
		||||
                          ],
 | 
			
		||||
                        ),
 | 
			
		||||
                        Row(
 | 
			
		||||
                          children: [
 | 
			
		||||
                            AppText(
 | 
			
		||||
                              "${TranslationBase.of(context).temperature}",
 | 
			
		||||
                              fontSize: SizeConfig.textMultiplier * 1.8,
 | 
			
		||||
                              color: Colors.black,
 | 
			
		||||
                              fontWeight: FontWeight.w700,
 | 
			
		||||
                            ),
 | 
			
		||||
                            SizedBox(
 | 
			
		||||
                              width: 8,
 | 
			
		||||
                            ),
 | 
			
		||||
                            AppText(
 | 
			
		||||
                              "37.5(C), 98.6(F)",
 | 
			
		||||
                              fontSize: SizeConfig.textMultiplier * 2,
 | 
			
		||||
                              color: Colors.grey.shade800,
 | 
			
		||||
                              fontWeight: FontWeight.normal,
 | 
			
		||||
                            ),
 | 
			
		||||
                          ],
 | 
			
		||||
                        ),
 | 
			
		||||
                      ],
 | 
			
		||||
                    ),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 4,
 | 
			
		||||
                    ),
 | 
			
		||||
                    Row(
 | 
			
		||||
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
 | 
			
		||||
                      children: [
 | 
			
		||||
                        Row(
 | 
			
		||||
                          children: [
 | 
			
		||||
                            AppText(
 | 
			
		||||
                              "${TranslationBase.of(context).pulseBeats} :",
 | 
			
		||||
                              fontSize: SizeConfig.textMultiplier * 1.8,
 | 
			
		||||
                              color: Colors.black,
 | 
			
		||||
                              fontWeight: FontWeight.w700,
 | 
			
		||||
                            ),
 | 
			
		||||
                            SizedBox(
 | 
			
		||||
                              width: 8,
 | 
			
		||||
                            ),
 | 
			
		||||
                            AppText(
 | 
			
		||||
                              "80",
 | 
			
		||||
                              fontSize: SizeConfig.textMultiplier * 2,
 | 
			
		||||
                              color: Colors.grey.shade800,
 | 
			
		||||
                              fontWeight: FontWeight.normal,
 | 
			
		||||
                            ),
 | 
			
		||||
                          ],
 | 
			
		||||
                        ),
 | 
			
		||||
                      ],
 | 
			
		||||
                    ),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 16,
 | 
			
		||||
                    ),
 | 
			
		||||
                    AppText(
 | 
			
		||||
                      TranslationBase.of(context).chiefComplaintsAndSymptoms,
 | 
			
		||||
                      fontWeight: FontWeight.bold,
 | 
			
		||||
                      fontSize: SizeConfig.textMultiplier * 2.5,
 | 
			
		||||
                    ),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 8,
 | 
			
		||||
                    ),
 | 
			
		||||
                    AppText(
 | 
			
		||||
                      TranslationBase.of(context)
 | 
			
		||||
                          .patientFeelsPainInHisBackAndCough,
 | 
			
		||||
                      fontWeight: FontWeight.normal,
 | 
			
		||||
                      fontSize: SizeConfig.textMultiplier * 2.0,
 | 
			
		||||
                    ),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 8,
 | 
			
		||||
                    ),
 | 
			
		||||
                    Container(
 | 
			
		||||
                        child: TextField(
 | 
			
		||||
                      decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                          TranslationBase.of(context).additionalTextComplaints,
 | 
			
		||||
                          null,
 | 
			
		||||
                          false),
 | 
			
		||||
                      enabled: true,
 | 
			
		||||
                      controller: _additionalComplaintsController,
 | 
			
		||||
                      keyboardType: TextInputType.text,
 | 
			
		||||
                      minLines: 4,
 | 
			
		||||
                      maxLines: 6,
 | 
			
		||||
                    )),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 16,
 | 
			
		||||
                    ),
 | 
			
		||||
                    AppText(
 | 
			
		||||
                      TranslationBase.of(context).otherConditions,
 | 
			
		||||
                      fontWeight: FontWeight.bold,
 | 
			
		||||
                      fontSize: SizeConfig.textMultiplier * 2.0,
 | 
			
		||||
                    ),
 | 
			
		||||
                    ...List.generate(
 | 
			
		||||
                        conditionsData.length,
 | 
			
		||||
                        (index) => CheckboxListTile(
 | 
			
		||||
                              title: AppText(
 | 
			
		||||
                                conditionsData[index]['name'],
 | 
			
		||||
                                fontWeight: FontWeight.bold,
 | 
			
		||||
                                fontSize: SizeConfig.textMultiplier * 2.1,
 | 
			
		||||
                              ),
 | 
			
		||||
                              value: conditionsData[index]['isChecked'],
 | 
			
		||||
                              onChanged: (newValue) {
 | 
			
		||||
                                setState(() {
 | 
			
		||||
                                  conditionsData[index]['isChecked'] = newValue;
 | 
			
		||||
                                });
 | 
			
		||||
                              },
 | 
			
		||||
                              controlAffinity: ListTileControlAffinity.leading,
 | 
			
		||||
                              contentPadding: EdgeInsets.all(0),
 | 
			
		||||
                            )),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 8,
 | 
			
		||||
                    ),
 | 
			
		||||
                    Container(
 | 
			
		||||
                        height: screenSize.height * 0.070,
 | 
			
		||||
                        child: TextField(
 | 
			
		||||
                          decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                              TranslationBase.of(context).other,
 | 
			
		||||
                              null,
 | 
			
		||||
                              false),
 | 
			
		||||
                          enabled: true,
 | 
			
		||||
                          controller: _otherController,
 | 
			
		||||
                          keyboardType: TextInputType.text,
 | 
			
		||||
                        )),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 8,
 | 
			
		||||
                    ),
 | 
			
		||||
                    Container(
 | 
			
		||||
                        height: screenSize.height * 0.070,
 | 
			
		||||
                        child: TextField(
 | 
			
		||||
                          decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                              TranslationBase.of(context).how,
 | 
			
		||||
                              null,
 | 
			
		||||
                              false),
 | 
			
		||||
                          enabled: true,
 | 
			
		||||
                          controller: _howController,
 | 
			
		||||
                          keyboardType: TextInputType.text,
 | 
			
		||||
                        )),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 8,
 | 
			
		||||
                    ),
 | 
			
		||||
                    Row(
 | 
			
		||||
                      children: [
 | 
			
		||||
                        Expanded(
 | 
			
		||||
                          child: Container(
 | 
			
		||||
                              height: screenSize.height * 0.070,
 | 
			
		||||
                              child: TextField(
 | 
			
		||||
                                decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                    TranslationBase.of(context).when,
 | 
			
		||||
                                    null,
 | 
			
		||||
                                    false),
 | 
			
		||||
                                enabled: true,
 | 
			
		||||
                                controller: _whenController,
 | 
			
		||||
                                keyboardType: TextInputType.text,
 | 
			
		||||
                              )),
 | 
			
		||||
                        ),
 | 
			
		||||
                        SizedBox(
 | 
			
		||||
                          width: 4,
 | 
			
		||||
                        ),
 | 
			
		||||
                        Expanded(
 | 
			
		||||
                          child: Container(
 | 
			
		||||
                              height: screenSize.height * 0.070,
 | 
			
		||||
                              child: TextField(
 | 
			
		||||
                                decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                    TranslationBase.of(context).where,
 | 
			
		||||
                                    null,
 | 
			
		||||
                                    false),
 | 
			
		||||
                                enabled: true,
 | 
			
		||||
                                controller: _whereController,
 | 
			
		||||
                                keyboardType: TextInputType.text,
 | 
			
		||||
                              )),
 | 
			
		||||
                        ),
 | 
			
		||||
                      ],
 | 
			
		||||
                    ),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 8,
 | 
			
		||||
                    ),
 | 
			
		||||
                    Container(
 | 
			
		||||
                        child: TextField(
 | 
			
		||||
                          decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                              TranslationBase.of(context).specifyPossibleLineManagement,
 | 
			
		||||
                              null,
 | 
			
		||||
                              false),
 | 
			
		||||
                          enabled: true,
 | 
			
		||||
                          controller: _managementsLineController,
 | 
			
		||||
                          keyboardType: TextInputType.text,
 | 
			
		||||
                          minLines: 4,
 | 
			
		||||
                          maxLines: 6,
 | 
			
		||||
                        )),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 16,
 | 
			
		||||
                    ),
 | 
			
		||||
                    AppText(
 | 
			
		||||
                      TranslationBase.of(context)
 | 
			
		||||
                          .significantSigns,
 | 
			
		||||
                      fontWeight: FontWeight.bold,
 | 
			
		||||
                      fontSize: SizeConfig.textMultiplier * 2.0,
 | 
			
		||||
                    ),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 8,
 | 
			
		||||
                    ),
 | 
			
		||||
                    Container(
 | 
			
		||||
                        child: TextField(
 | 
			
		||||
                          decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                              TranslationBase.of(context).backAbdomen,
 | 
			
		||||
                              null,
 | 
			
		||||
                              false),
 | 
			
		||||
                          enabled: true,
 | 
			
		||||
                          controller: _signsController,
 | 
			
		||||
                          keyboardType: TextInputType.text,
 | 
			
		||||
                          minLines: 4,
 | 
			
		||||
                          maxLines: 6,
 | 
			
		||||
                        )),
 | 
			
		||||
                    SizedBox(
 | 
			
		||||
                      height: 16,
 | 
			
		||||
                    ),
 | 
			
		||||
                    AppButton(
 | 
			
		||||
                      title: TranslationBase.of(context).next,
 | 
			
		||||
                      color: HexColor("#B8382B"),
 | 
			
		||||
                      onPressed: (){
 | 
			
		||||
                        // Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient});
 | 
			
		||||
                      },
 | 
			
		||||
                    ),
 | 
			
		||||
                  ],
 | 
			
		||||
                ),
 | 
			
		||||
              ),
 | 
			
		||||
            ],
 | 
			
		||||
          ),
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class PatientHeaderWidget extends StatelessWidget {
 | 
			
		||||
  final PatiantInformtion patient;
 | 
			
		||||
 | 
			
		||||
  PatientHeaderWidget(this.patient);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    return Column(
 | 
			
		||||
      children: [
 | 
			
		||||
        Container(
 | 
			
		||||
          margin: EdgeInsets.all(16),
 | 
			
		||||
          child: Row(
 | 
			
		||||
            children: [
 | 
			
		||||
              Expanded(
 | 
			
		||||
                child: Column(
 | 
			
		||||
                  crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
                  children: [
 | 
			
		||||
                    AppText(
 | 
			
		||||
                      patient.firstName + ' ' + patient.lastName,
 | 
			
		||||
                      fontWeight: FontWeight.bold,
 | 
			
		||||
                      fontSize: SizeConfig.textMultiplier * 2.2,
 | 
			
		||||
                    ),
 | 
			
		||||
                    Row(
 | 
			
		||||
                      children: [
 | 
			
		||||
                        AppText(
 | 
			
		||||
                          "VIP",
 | 
			
		||||
                          fontWeight: FontWeight.bold,
 | 
			
		||||
                          fontSize: SizeConfig.textMultiplier * 2.2,
 | 
			
		||||
                        ),
 | 
			
		||||
                        SizedBox(
 | 
			
		||||
                          width: 8,
 | 
			
		||||
                        ),
 | 
			
		||||
                        AppText(
 | 
			
		||||
                          " ${patient.age}",
 | 
			
		||||
                          fontWeight: FontWeight.normal,
 | 
			
		||||
                          fontSize: SizeConfig.textMultiplier * 2.0,
 | 
			
		||||
                        ),
 | 
			
		||||
                      ],
 | 
			
		||||
                    ),
 | 
			
		||||
                    AppText(
 | 
			
		||||
                      "NEW VISIT",
 | 
			
		||||
                      fontWeight: FontWeight.bold,
 | 
			
		||||
                      fontSize: SizeConfig.textMultiplier * 2.0,
 | 
			
		||||
                    ),
 | 
			
		||||
                    AppText(
 | 
			
		||||
                      "${patient.companyName}",
 | 
			
		||||
                      fontWeight: FontWeight.bold,
 | 
			
		||||
                      fontSize: SizeConfig.textMultiplier * 2.0,
 | 
			
		||||
                    ),
 | 
			
		||||
                  ],
 | 
			
		||||
                ),
 | 
			
		||||
              ),
 | 
			
		||||
              Icon(
 | 
			
		||||
                Icons.info_outline,
 | 
			
		||||
                color: Colors.black,
 | 
			
		||||
              ),
 | 
			
		||||
            ],
 | 
			
		||||
          ),
 | 
			
		||||
        ),
 | 
			
		||||
        Container(
 | 
			
		||||
          width: double.infinity,
 | 
			
		||||
          height: 1,
 | 
			
		||||
          color: Color(0xffCCCCCC),
 | 
			
		||||
        ),
 | 
			
		||||
      ],
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,285 @@
 | 
			
		||||
import 'package:doctor_app_flutter/config/size_config.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.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/helpers.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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:flutter/material.dart';
 | 
			
		||||
import 'package:hexcolor/hexcolor.dart';
 | 
			
		||||
 | 
			
		||||
import '../../../../routes.dart';
 | 
			
		||||
import 'admission-request_second-screen.dart';
 | 
			
		||||
 | 
			
		||||
class AdmissionRequestDetailScreen extends StatefulWidget {
 | 
			
		||||
  @override
 | 
			
		||||
  _AdmissionRequestDetailScreenState createState() =>
 | 
			
		||||
      _AdmissionRequestDetailScreenState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _AdmissionRequestDetailScreenState
 | 
			
		||||
    extends State<AdmissionRequestDetailScreen> {
 | 
			
		||||
  DateTime selectedDate;
 | 
			
		||||
  dynamic _selectedSpeciality;
 | 
			
		||||
  dynamic _selectedDoctor;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    final routeArgs = ModalRoute.of(context).settings.arguments as Map;
 | 
			
		||||
    PatiantInformtion patient = routeArgs['patient'];
 | 
			
		||||
    final screenSize = MediaQuery.of(context).size;
 | 
			
		||||
 | 
			
		||||
    return BaseView<AdmissionRequestViewModel>(
 | 
			
		||||
      onModelReady: (model) => model.getMasterLookup(),
 | 
			
		||||
      builder: (_, model, w) => AppScaffold(
 | 
			
		||||
        baseViewModel: model,
 | 
			
		||||
        appBarTitle: TranslationBase.of(context).admissionRequest,
 | 
			
		||||
        body: model.doctorsList != null
 | 
			
		||||
            ? Column(
 | 
			
		||||
                children: [
 | 
			
		||||
                  Expanded(
 | 
			
		||||
                    child: SingleChildScrollView(
 | 
			
		||||
                      child: Column(
 | 
			
		||||
                        crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
                        children: [
 | 
			
		||||
                          PatientPageHeaderWidget(patient),
 | 
			
		||||
                          Container(
 | 
			
		||||
                            margin: EdgeInsets.symmetric(
 | 
			
		||||
                                vertical: 16, horizontal: 16),
 | 
			
		||||
                            child: Column(
 | 
			
		||||
                              crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
                              children: [
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 16,
 | 
			
		||||
                                ),
 | 
			
		||||
                                AppText(
 | 
			
		||||
                                  TranslationBase.of(context).patientDetails,
 | 
			
		||||
                                  fontWeight: FontWeight.bold,
 | 
			
		||||
                                  fontSize: SizeConfig.textMultiplier * 2.5,
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                    decoration:
 | 
			
		||||
                                        Helpers.containerBorderDecoration(
 | 
			
		||||
                                            Color(0xFFEEEEEE),
 | 
			
		||||
                                            Color(0xFFCCCCCC),
 | 
			
		||||
                                            borderWidth: 0.0),
 | 
			
		||||
                                    height: screenSize.height * 0.070,
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration:
 | 
			
		||||
                                          Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                              "Pre Admission Number :01",
 | 
			
		||||
                                              null,
 | 
			
		||||
                                              false),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                      // controller: _remarksController,
 | 
			
		||||
                                      keyboardType: TextInputType.text,
 | 
			
		||||
                                    )),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                  height: screenSize.height * 0.070,
 | 
			
		||||
                                  child: InkWell(
 | 
			
		||||
                                    onTap: () => _selectDate(context, model),
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration:
 | 
			
		||||
                                          Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                              TranslationBase.of(context).date,
 | 
			
		||||
                                              selectedDate != null
 | 
			
		||||
                                                  ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
 | 
			
		||||
                                                  : null,
 | 
			
		||||
                                              true,
 | 
			
		||||
                                              suffixIcon: Icon(
 | 
			
		||||
                                                Icons.calendar_today,
 | 
			
		||||
                                                color: Colors.black,
 | 
			
		||||
                                              )),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 20,
 | 
			
		||||
                                ),
 | 
			
		||||
                                AppText(
 | 
			
		||||
                                  TranslationBase.of(context)
 | 
			
		||||
                                      .specialityAndDoctorDetail,
 | 
			
		||||
                                  fontWeight: FontWeight.bold,
 | 
			
		||||
                                  fontSize: SizeConfig.textMultiplier * 2.5,
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                  height: screenSize.height * 0.070,
 | 
			
		||||
                                  child: InkWell(
 | 
			
		||||
                                    onTap: () {
 | 
			
		||||
                                      ListSelectDialog dialog =
 | 
			
		||||
                                          ListSelectDialog(
 | 
			
		||||
                                              list: model.speciality,
 | 
			
		||||
                                              attributeName: model.selectedLanguage == 'ar' ? 'nameAr' :'nameEn'  ,
 | 
			
		||||
                                              attributeValueId: 'id',
 | 
			
		||||
                                              okText:
 | 
			
		||||
                                                  TranslationBase.of(context)
 | 
			
		||||
                                                      .ok,
 | 
			
		||||
                                              okFunction: (selectedValue) {
 | 
			
		||||
                                                setState(() {
 | 
			
		||||
                                                  _selectedSpeciality =
 | 
			
		||||
                                                      selectedValue;
 | 
			
		||||
                                                });
 | 
			
		||||
                                              });
 | 
			
		||||
                                      showDialog(
 | 
			
		||||
                                        barrierDismissible: false,
 | 
			
		||||
                                        context: context,
 | 
			
		||||
                                        builder: (BuildContext context) {
 | 
			
		||||
                                          return dialog;
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                    },
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration:
 | 
			
		||||
                                          Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                              TranslationBase.of(context)
 | 
			
		||||
                                                  .speciality,
 | 
			
		||||
                                              _selectedSpeciality != null
 | 
			
		||||
                                                  ? model.selectedLanguage == 'ar' ? _selectedSpeciality['nameAr'] : _selectedSpeciality['nameEn']
 | 
			
		||||
                                                  : null,
 | 
			
		||||
                                              true),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                  height: screenSize.height * 0.070,
 | 
			
		||||
                                  child: InkWell(
 | 
			
		||||
                                    onTap: model.doctorsList != null &&
 | 
			
		||||
                                        model.doctorsList.length > 0
 | 
			
		||||
                                        ? () {
 | 
			
		||||
                                      ListSelectDialog dialog =
 | 
			
		||||
                                      ListSelectDialog(
 | 
			
		||||
                                        list: model.doctorsList,
 | 
			
		||||
                                        attributeName: 'DoctorName',
 | 
			
		||||
                                        attributeValueId: 'DoctorID',
 | 
			
		||||
                                        okText: TranslationBase.of(context).ok,
 | 
			
		||||
                                        okFunction: (selectedValue) {
 | 
			
		||||
                                          setState(() {
 | 
			
		||||
                                            _selectedDoctor = selectedValue;
 | 
			
		||||
                                          });
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                      showDialog(
 | 
			
		||||
                                        barrierDismissible: false,
 | 
			
		||||
                                        context: context,
 | 
			
		||||
                                        builder: (BuildContext context) {
 | 
			
		||||
                                          return dialog;
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                    }
 | 
			
		||||
                                        : null,
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                          TranslationBase.of(context).doctor,
 | 
			
		||||
                                          _selectedDoctor != null
 | 
			
		||||
                                              ? _selectedDoctor['DoctorName']
 | 
			
		||||
                                              : null,
 | 
			
		||||
                                          true),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                  height: screenSize.height * 0.070,
 | 
			
		||||
                                  decoration:
 | 
			
		||||
                                  Helpers.containerBorderDecoration(
 | 
			
		||||
                                      Color(0xFFEEEEEE),
 | 
			
		||||
                                      Color(0xFFCCCCCC),
 | 
			
		||||
                                      borderWidth: 0.0),
 | 
			
		||||
                                  child: InkWell(
 | 
			
		||||
                                    onTap: () => null,
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration:
 | 
			
		||||
                                      Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                          TranslationBase.of(context).referringDate,
 | 
			
		||||
                                          null,
 | 
			
		||||
                                          true,
 | 
			
		||||
                                          suffixIcon: Icon(
 | 
			
		||||
                                            Icons.calendar_today,
 | 
			
		||||
                                            color: Color(0xFFCCCCCC),
 | 
			
		||||
                                          )),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                    decoration:
 | 
			
		||||
                                    Helpers.containerBorderDecoration(
 | 
			
		||||
                                        Color(0xFFEEEEEE),
 | 
			
		||||
                                        Color(0xFFCCCCCC),
 | 
			
		||||
                                        borderWidth: 0.0),
 | 
			
		||||
                                    height: screenSize.height * 0.070,
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration:
 | 
			
		||||
                                      Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                          TranslationBase.of(context).referringDoctor,
 | 
			
		||||
                                          null,
 | 
			
		||||
                                          true, dropDownColor: Color(0xFFCCCCCC)),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                      // controller: _remarksController,
 | 
			
		||||
                                      keyboardType: TextInputType.text,
 | 
			
		||||
                                    )),
 | 
			
		||||
                              ],
 | 
			
		||||
                            ),
 | 
			
		||||
                          ),
 | 
			
		||||
                        ],
 | 
			
		||||
                      ),
 | 
			
		||||
                    ),
 | 
			
		||||
                  ),
 | 
			
		||||
                  Container(
 | 
			
		||||
                    margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
 | 
			
		||||
                    child: AppButton(
 | 
			
		||||
                      title: TranslationBase.of(context).next,
 | 
			
		||||
                      color: HexColor("#B8382B"),
 | 
			
		||||
                      onPressed: (){
 | 
			
		||||
                        Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient});
 | 
			
		||||
                      },
 | 
			
		||||
                    ),
 | 
			
		||||
                  ),
 | 
			
		||||
                ],
 | 
			
		||||
              )
 | 
			
		||||
            : Container(),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  _selectDate(BuildContext context, AdmissionRequestViewModel model) async {
 | 
			
		||||
    selectedDate = DateTime.now();
 | 
			
		||||
    final DateTime picked = await showDatePicker(
 | 
			
		||||
      context: context,
 | 
			
		||||
      initialDate: selectedDate,
 | 
			
		||||
      firstDate: DateTime.now().add(Duration(hours: 2)),
 | 
			
		||||
      lastDate: DateTime(2040),
 | 
			
		||||
      initialEntryMode: DatePickerEntryMode.calendar,
 | 
			
		||||
    );
 | 
			
		||||
    if (picked != null && picked != selectedDate) {
 | 
			
		||||
      setState(() {
 | 
			
		||||
        selectedDate = picked;
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,208 @@
 | 
			
		||||
import 'package:doctor_app_flutter/config/config.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/config/size_config.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.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/helpers.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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:flutter/material.dart';
 | 
			
		||||
import 'package:flutter/services.dart';
 | 
			
		||||
import 'package:hexcolor/hexcolor.dart';
 | 
			
		||||
 | 
			
		||||
class AdmissionRequestThirdScreen extends StatefulWidget {
 | 
			
		||||
  @override
 | 
			
		||||
  _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScreen> {
 | 
			
		||||
 | 
			
		||||
  final _postPlansEstimatedCostController = TextEditingController();
 | 
			
		||||
  final _dietTypeRemarksController = TextEditingController();
 | 
			
		||||
  DateTime _dischargeDate;
 | 
			
		||||
  dynamic _selectedDietType;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    final routeArgs = ModalRoute.of(context).settings.arguments as Map;
 | 
			
		||||
    PatiantInformtion patient = routeArgs['patient'];
 | 
			
		||||
    final screenSize = MediaQuery.of(context).size;
 | 
			
		||||
 | 
			
		||||
    return BaseView<AdmissionRequestViewModel>(
 | 
			
		||||
      // onModelReady: (model) => model.getMasterLookup(),
 | 
			
		||||
      builder: (_, model, w) => AppScaffold(
 | 
			
		||||
        baseViewModel: model,
 | 
			
		||||
        appBarTitle: TranslationBase.of(context).admissionRequest,
 | 
			
		||||
        body: model.doctorsList != null
 | 
			
		||||
            ? Column(
 | 
			
		||||
          children: [
 | 
			
		||||
            Expanded(
 | 
			
		||||
              child: SingleChildScrollView(
 | 
			
		||||
                child: Column(
 | 
			
		||||
                  crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
                  children: [
 | 
			
		||||
                    PatientPageHeaderWidget(patient),
 | 
			
		||||
                    Container(
 | 
			
		||||
                      margin: EdgeInsets.symmetric(
 | 
			
		||||
                          vertical: 16, horizontal: 16),
 | 
			
		||||
                      child: Column(
 | 
			
		||||
                        crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
                        children: [
 | 
			
		||||
                          SizedBox(
 | 
			
		||||
                            height: 16,
 | 
			
		||||
                          ),
 | 
			
		||||
                          AppText(
 | 
			
		||||
                            TranslationBase.of(context).postPlansEstimatedCost,
 | 
			
		||||
                            fontWeight: FontWeight.bold,
 | 
			
		||||
                            fontSize: SizeConfig.textMultiplier * 2.5,
 | 
			
		||||
                          ),
 | 
			
		||||
                          SizedBox(
 | 
			
		||||
                            height: 10,
 | 
			
		||||
                          ),
 | 
			
		||||
                          Container(
 | 
			
		||||
                              child: TextField(
 | 
			
		||||
                                decoration:
 | 
			
		||||
                                Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                    TranslationBase.of(context)
 | 
			
		||||
                                        .postPlansEstimatedCost,
 | 
			
		||||
                                    null,
 | 
			
		||||
                                    false),
 | 
			
		||||
                                enabled: true,
 | 
			
		||||
                                controller: _postPlansEstimatedCostController,
 | 
			
		||||
                                keyboardType: TextInputType.text,
 | 
			
		||||
                                minLines: 4,
 | 
			
		||||
                                maxLines: 6,
 | 
			
		||||
                              )),
 | 
			
		||||
                          SizedBox(
 | 
			
		||||
                            height: 10,
 | 
			
		||||
                          ),
 | 
			
		||||
                          Container(
 | 
			
		||||
                            height: screenSize.height * 0.070,
 | 
			
		||||
                            child: InkWell(
 | 
			
		||||
                              onTap: () {
 | 
			
		||||
                                if (_dischargeDate == null) {
 | 
			
		||||
                                  _dischargeDate = DateTime.now();
 | 
			
		||||
                                }
 | 
			
		||||
                                _selectDate(
 | 
			
		||||
                                    context, _dischargeDate,
 | 
			
		||||
                                        (picked) {
 | 
			
		||||
                                      setState(() {
 | 
			
		||||
                                        _dischargeDate = picked;
 | 
			
		||||
                                      });
 | 
			
		||||
                                    });
 | 
			
		||||
                              },
 | 
			
		||||
                              child: TextField(
 | 
			
		||||
                                decoration:
 | 
			
		||||
                                Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                    TranslationBase.of(context)
 | 
			
		||||
                                        .expectedAdmissionDate,
 | 
			
		||||
                                    _dischargeDate != null
 | 
			
		||||
                                        ? "${DateUtils.convertStringToDateFormat(_dischargeDate.toString(), "yyyy-MM-dd")}"
 | 
			
		||||
                                        : null,
 | 
			
		||||
                                    true,
 | 
			
		||||
                                    suffixIcon: Icon(
 | 
			
		||||
                                      Icons.calendar_today,
 | 
			
		||||
                                      color: Colors.black,
 | 
			
		||||
                                    )),
 | 
			
		||||
                                enabled: false,
 | 
			
		||||
                              ),
 | 
			
		||||
                            ),
 | 
			
		||||
                          ),
 | 
			
		||||
                          SizedBox(
 | 
			
		||||
                            height: 10,
 | 
			
		||||
                          ),
 | 
			
		||||
                          Container(
 | 
			
		||||
                            height: screenSize.height * 0.070,
 | 
			
		||||
                            child: InkWell(
 | 
			
		||||
                              onTap: /*model.doctorsList != null &&
 | 
			
		||||
                                        model.doctorsList.length > 0
 | 
			
		||||
                                        ? () {
 | 
			
		||||
                                      ListSelectDialog dialog =
 | 
			
		||||
                                      ListSelectDialog(
 | 
			
		||||
                                        list: model.doctorsList,
 | 
			
		||||
                                        attributeName: 'DoctorName',
 | 
			
		||||
                                        attributeValueId: 'DoctorID',
 | 
			
		||||
                                        okText: TranslationBase.of(context).ok,
 | 
			
		||||
                                        okFunction: (selectedValue) {
 | 
			
		||||
                                          setState(() {
 | 
			
		||||
                                            _selectedDoctor = selectedValue;
 | 
			
		||||
                                          });
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                      showDialog(
 | 
			
		||||
                                        barrierDismissible: false,
 | 
			
		||||
                                        context: context,
 | 
			
		||||
                                        builder: (BuildContext context) {
 | 
			
		||||
                                          return dialog;
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                    }
 | 
			
		||||
                                        :*/ null,
 | 
			
		||||
                              child: TextField(
 | 
			
		||||
                                decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                    TranslationBase.of(context).dietType,
 | 
			
		||||
                                    /* _admissionType != null
 | 
			
		||||
                                              ? _admissionType['DoctorName']
 | 
			
		||||
                                              :*/ null,
 | 
			
		||||
                                    true),
 | 
			
		||||
                                enabled: false,
 | 
			
		||||
                              ),
 | 
			
		||||
                            ),
 | 
			
		||||
                          ),
 | 
			
		||||
                          SizedBox(
 | 
			
		||||
                            height: 10,
 | 
			
		||||
                          ),
 | 
			
		||||
                          Container(
 | 
			
		||||
                              child: TextField(
 | 
			
		||||
                                decoration:
 | 
			
		||||
                                Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                    TranslationBase.of(context)
 | 
			
		||||
                                        .dietTypeRemarks,
 | 
			
		||||
                                    null,
 | 
			
		||||
                                    false),
 | 
			
		||||
                                enabled: true,
 | 
			
		||||
                                controller: _dietTypeRemarksController,
 | 
			
		||||
                                keyboardType: TextInputType.text,
 | 
			
		||||
                                minLines: 4,
 | 
			
		||||
                                maxLines: 6,
 | 
			
		||||
                              )),
 | 
			
		||||
                        ],
 | 
			
		||||
                      ),
 | 
			
		||||
                    ),
 | 
			
		||||
                  ],
 | 
			
		||||
                ),
 | 
			
		||||
              ),
 | 
			
		||||
            ),
 | 
			
		||||
            Container(
 | 
			
		||||
              margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
 | 
			
		||||
              child: AppButton(
 | 
			
		||||
                title: TranslationBase.of(context).save,
 | 
			
		||||
                color: HexColor("#B8382B"),
 | 
			
		||||
                onPressed: null,
 | 
			
		||||
              ),
 | 
			
		||||
            ),
 | 
			
		||||
          ],
 | 
			
		||||
        )
 | 
			
		||||
            : Container(),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  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);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,402 @@
 | 
			
		||||
import 'package:doctor_app_flutter/config/config.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/config/size_config.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.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/helpers.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
 | 
			
		||||
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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:flutter/material.dart';
 | 
			
		||||
import 'package:flutter/services.dart';
 | 
			
		||||
import 'package:hexcolor/hexcolor.dart';
 | 
			
		||||
 | 
			
		||||
import '../../../../routes.dart';
 | 
			
		||||
 | 
			
		||||
class AdmissionRequestSecondScreen extends StatefulWidget {
 | 
			
		||||
  @override
 | 
			
		||||
  _AdmissionRequestSecondScreenState createState() =>
 | 
			
		||||
      _AdmissionRequestSecondScreenState();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _AdmissionRequestSecondScreenState
 | 
			
		||||
    extends State<AdmissionRequestSecondScreen> {
 | 
			
		||||
  final _expectedDaysController = TextEditingController();
 | 
			
		||||
  final _treatmentLineController = TextEditingController();
 | 
			
		||||
  final _preOperativeOrdersController = TextEditingController();
 | 
			
		||||
  DateTime _expectedAdmissionDate;
 | 
			
		||||
  bool _emergencyAdmission = false;
 | 
			
		||||
  bool _patientPregnant = false;
 | 
			
		||||
  bool _preAnesthesiaReferred = false;
 | 
			
		||||
  dynamic _selectedWard;
 | 
			
		||||
  dynamic _selectedAdmissionType;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    final routeArgs = ModalRoute.of(context).settings.arguments as Map;
 | 
			
		||||
    PatiantInformtion patient = routeArgs['patient'];
 | 
			
		||||
    final screenSize = MediaQuery.of(context).size;
 | 
			
		||||
 | 
			
		||||
    return BaseView<AdmissionRequestViewModel>(
 | 
			
		||||
      // onModelReady: (model) => model.getMasterLookup(),
 | 
			
		||||
      builder: (_, model, w) => AppScaffold(
 | 
			
		||||
        baseViewModel: model,
 | 
			
		||||
        appBarTitle: TranslationBase.of(context).admissionRequest,
 | 
			
		||||
        body: model.doctorsList != null
 | 
			
		||||
            ? Column(
 | 
			
		||||
                children: [
 | 
			
		||||
                  Expanded(
 | 
			
		||||
                    child: SingleChildScrollView(
 | 
			
		||||
                      child: Column(
 | 
			
		||||
                        crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
                        children: [
 | 
			
		||||
                          PatientPageHeaderWidget(patient),
 | 
			
		||||
                          Container(
 | 
			
		||||
                            margin: EdgeInsets.symmetric(
 | 
			
		||||
                                vertical: 16, horizontal: 16),
 | 
			
		||||
                            child: Column(
 | 
			
		||||
                              crossAxisAlignment: CrossAxisAlignment.start,
 | 
			
		||||
                              children: [
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 16,
 | 
			
		||||
                                ),
 | 
			
		||||
                                AppText(
 | 
			
		||||
                                  TranslationBase.of(context).otherInformation,
 | 
			
		||||
                                  fontWeight: FontWeight.bold,
 | 
			
		||||
                                  fontSize: SizeConfig.textMultiplier * 2.5,
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                    height: screenSize.height * 0.070,
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration:
 | 
			
		||||
                                          Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                              TranslationBase.of(context)
 | 
			
		||||
                                                  .expectedDays,
 | 
			
		||||
                                              null,
 | 
			
		||||
                                              false),
 | 
			
		||||
                                      enabled: true,
 | 
			
		||||
                                      controller: _expectedDaysController,
 | 
			
		||||
                                      inputFormatters: [
 | 
			
		||||
                                        FilteringTextInputFormatter.allow(
 | 
			
		||||
                                            RegExp(ONLY_NUMBERS))
 | 
			
		||||
                                      ],
 | 
			
		||||
                                      keyboardType: TextInputType.number,
 | 
			
		||||
                                    )),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                  height: screenSize.height * 0.070,
 | 
			
		||||
                                  child: InkWell(
 | 
			
		||||
                                    onTap: () {
 | 
			
		||||
                                      if (_expectedAdmissionDate == null) {
 | 
			
		||||
                                        _expectedAdmissionDate = DateTime.now();
 | 
			
		||||
                                      }
 | 
			
		||||
                                      _selectDate(
 | 
			
		||||
                                          context, _expectedAdmissionDate,
 | 
			
		||||
                                          (picked) {
 | 
			
		||||
                                        setState(() {
 | 
			
		||||
                                          _expectedAdmissionDate = picked;
 | 
			
		||||
                                        });
 | 
			
		||||
                                      });
 | 
			
		||||
                                    },
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration:
 | 
			
		||||
                                          Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                              TranslationBase.of(context)
 | 
			
		||||
                                                  .expectedAdmissionDate,
 | 
			
		||||
                                              _expectedAdmissionDate != null
 | 
			
		||||
                                                  ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
 | 
			
		||||
                                                  : null,
 | 
			
		||||
                                              true,
 | 
			
		||||
                                              suffixIcon: Icon(
 | 
			
		||||
                                                Icons.calendar_today,
 | 
			
		||||
                                                color: Colors.black,
 | 
			
		||||
                                              )),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                CheckboxListTile(
 | 
			
		||||
                                  title: AppText(
 | 
			
		||||
                                    TranslationBase.of(context)
 | 
			
		||||
                                        .emergencyAdmission,
 | 
			
		||||
                                    fontWeight: FontWeight.normal,
 | 
			
		||||
                                    fontSize: SizeConfig.textMultiplier * 2.1,
 | 
			
		||||
                                  ),
 | 
			
		||||
                                  value: _emergencyAdmission,
 | 
			
		||||
                                  onChanged: (newValue) {
 | 
			
		||||
                                    setState(() {
 | 
			
		||||
                                      _emergencyAdmission = newValue;
 | 
			
		||||
                                    });
 | 
			
		||||
                                  },
 | 
			
		||||
                                  controlAffinity: ListTileControlAffinity.leading,
 | 
			
		||||
                                  contentPadding: EdgeInsets.all(0),
 | 
			
		||||
                                ),
 | 
			
		||||
                                CheckboxListTile(
 | 
			
		||||
                                  title: AppText(
 | 
			
		||||
                                    TranslationBase.of(context)
 | 
			
		||||
                                        .patientPregnant,
 | 
			
		||||
                                    fontWeight: FontWeight.normal,
 | 
			
		||||
                                    fontSize: SizeConfig.textMultiplier * 2.1,
 | 
			
		||||
                                  ),
 | 
			
		||||
                                  value: _patientPregnant,
 | 
			
		||||
                                  onChanged: (newValue) {
 | 
			
		||||
                                    setState(() {
 | 
			
		||||
                                      _patientPregnant = newValue;
 | 
			
		||||
                                    });
 | 
			
		||||
                                  },
 | 
			
		||||
                                  controlAffinity: ListTileControlAffinity.leading,
 | 
			
		||||
                                  contentPadding: EdgeInsets.all(0),
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                          TranslationBase.of(context).treatmentLine,
 | 
			
		||||
                                          null,
 | 
			
		||||
                                          false),
 | 
			
		||||
                                      enabled: true,
 | 
			
		||||
                                      controller: _treatmentLineController,
 | 
			
		||||
                                      keyboardType: TextInputType.text,
 | 
			
		||||
                                      minLines: 4,
 | 
			
		||||
                                      maxLines: 6,
 | 
			
		||||
                                    )),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                  height: screenSize.height * 0.070,
 | 
			
		||||
                                  child: InkWell(
 | 
			
		||||
                                    onTap: /*model.doctorsList != null &&
 | 
			
		||||
                                        model.doctorsList.length > 0
 | 
			
		||||
                                        ? () {
 | 
			
		||||
                                      ListSelectDialog dialog =
 | 
			
		||||
                                      ListSelectDialog(
 | 
			
		||||
                                        list: model.doctorsList,
 | 
			
		||||
                                        attributeName: 'DoctorName',
 | 
			
		||||
                                        attributeValueId: 'DoctorID',
 | 
			
		||||
                                        okText: TranslationBase.of(context).ok,
 | 
			
		||||
                                        okFunction: (selectedValue) {
 | 
			
		||||
                                          setState(() {
 | 
			
		||||
                                            _selectedDoctor = selectedValue;
 | 
			
		||||
                                          });
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                      showDialog(
 | 
			
		||||
                                        barrierDismissible: false,
 | 
			
		||||
                                        context: context,
 | 
			
		||||
                                        builder: (BuildContext context) {
 | 
			
		||||
                                          return dialog;
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                    }
 | 
			
		||||
                                        :*/ null,
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                          TranslationBase.of(context).ward,
 | 
			
		||||
                                         /* _selectedWard != null
 | 
			
		||||
                                              ? _selectedWard['DoctorName']
 | 
			
		||||
                                              :*/ null,
 | 
			
		||||
                                          true),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ),
 | 
			
		||||
                                CheckboxListTile(
 | 
			
		||||
                                  title: AppText(
 | 
			
		||||
                                    TranslationBase.of(context)
 | 
			
		||||
                                        .preAnesthesiaReferred,
 | 
			
		||||
                                    fontWeight: FontWeight.normal,
 | 
			
		||||
                                    fontSize: SizeConfig.textMultiplier * 2.1,
 | 
			
		||||
                                  ),
 | 
			
		||||
                                  value: _preAnesthesiaReferred,
 | 
			
		||||
                                  onChanged: (newValue) {
 | 
			
		||||
                                    setState(() {
 | 
			
		||||
                                      _preAnesthesiaReferred = newValue;
 | 
			
		||||
                                    });
 | 
			
		||||
                                  },
 | 
			
		||||
                                  controlAffinity: ListTileControlAffinity.leading,
 | 
			
		||||
                                  contentPadding: EdgeInsets.all(0),
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                  height: screenSize.height * 0.070,
 | 
			
		||||
                                  child: InkWell(
 | 
			
		||||
                                    onTap: /*model.doctorsList != null &&
 | 
			
		||||
                                        model.doctorsList.length > 0
 | 
			
		||||
                                        ? () {
 | 
			
		||||
                                      ListSelectDialog dialog =
 | 
			
		||||
                                      ListSelectDialog(
 | 
			
		||||
                                        list: model.doctorsList,
 | 
			
		||||
                                        attributeName: 'DoctorName',
 | 
			
		||||
                                        attributeValueId: 'DoctorID',
 | 
			
		||||
                                        okText: TranslationBase.of(context).ok,
 | 
			
		||||
                                        okFunction: (selectedValue) {
 | 
			
		||||
                                          setState(() {
 | 
			
		||||
                                            _selectedDoctor = selectedValue;
 | 
			
		||||
                                          });
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                      showDialog(
 | 
			
		||||
                                        barrierDismissible: false,
 | 
			
		||||
                                        context: context,
 | 
			
		||||
                                        builder: (BuildContext context) {
 | 
			
		||||
                                          return dialog;
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                    }
 | 
			
		||||
                                        :*/ null,
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                          TranslationBase.of(context).admissionType,
 | 
			
		||||
                                          /* _admissionType != null
 | 
			
		||||
                                              ? _admissionType['DoctorName']
 | 
			
		||||
                                              :*/ null,
 | 
			
		||||
                                          true),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                  height: screenSize.height * 0.070,
 | 
			
		||||
                                  child: InkWell(
 | 
			
		||||
                                    onTap: /*model.doctorsList != null &&
 | 
			
		||||
                                        model.doctorsList.length > 0
 | 
			
		||||
                                        ? () {
 | 
			
		||||
                                      ListSelectDialog dialog =
 | 
			
		||||
                                      ListSelectDialog(
 | 
			
		||||
                                        list: model.doctorsList,
 | 
			
		||||
                                        attributeName: 'DoctorName',
 | 
			
		||||
                                        attributeValueId: 'DoctorID',
 | 
			
		||||
                                        okText: TranslationBase.of(context).ok,
 | 
			
		||||
                                        okFunction: (selectedValue) {
 | 
			
		||||
                                          setState(() {
 | 
			
		||||
                                            _selectedDoctor = selectedValue;
 | 
			
		||||
                                          });
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                      showDialog(
 | 
			
		||||
                                        barrierDismissible: false,
 | 
			
		||||
                                        context: context,
 | 
			
		||||
                                        builder: (BuildContext context) {
 | 
			
		||||
                                          return dialog;
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                    }
 | 
			
		||||
                                        :*/ null,
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                          TranslationBase.of(context).diagnosis,
 | 
			
		||||
                                          /* _admissionType != null
 | 
			
		||||
                                              ? _admissionType['DoctorName']
 | 
			
		||||
                                              :*/ null,
 | 
			
		||||
                                          true),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                          TranslationBase.of(context).preOperativeOrders,
 | 
			
		||||
                                          null,
 | 
			
		||||
                                          false),
 | 
			
		||||
                                      enabled: true,
 | 
			
		||||
                                      controller: _preOperativeOrdersController,
 | 
			
		||||
                                      keyboardType: TextInputType.text,
 | 
			
		||||
                                      minLines: 4,
 | 
			
		||||
                                      maxLines: 6,
 | 
			
		||||
                                    )),
 | 
			
		||||
                                SizedBox(
 | 
			
		||||
                                  height: 10,
 | 
			
		||||
                                ),
 | 
			
		||||
                                Container(
 | 
			
		||||
                                  height: screenSize.height * 0.070,
 | 
			
		||||
                                  child: InkWell(
 | 
			
		||||
                                    onTap: /*model.doctorsList != null &&
 | 
			
		||||
                                        model.doctorsList.length > 0
 | 
			
		||||
                                        ? () {
 | 
			
		||||
                                      ListSelectDialog dialog =
 | 
			
		||||
                                      ListSelectDialog(
 | 
			
		||||
                                        list: model.doctorsList,
 | 
			
		||||
                                        attributeName: 'DoctorName',
 | 
			
		||||
                                        attributeValueId: 'DoctorID',
 | 
			
		||||
                                        okText: TranslationBase.of(context).ok,
 | 
			
		||||
                                        okFunction: (selectedValue) {
 | 
			
		||||
                                          setState(() {
 | 
			
		||||
                                            _selectedDoctor = selectedValue;
 | 
			
		||||
                                          });
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                      showDialog(
 | 
			
		||||
                                        barrierDismissible: false,
 | 
			
		||||
                                        context: context,
 | 
			
		||||
                                        builder: (BuildContext context) {
 | 
			
		||||
                                          return dialog;
 | 
			
		||||
                                        },
 | 
			
		||||
                                      );
 | 
			
		||||
                                    }
 | 
			
		||||
                                        :*/ null,
 | 
			
		||||
                                    child: TextField(
 | 
			
		||||
                                      decoration: Helpers.textFieldSelectorDecoration(
 | 
			
		||||
                                          TranslationBase.of(context).allergies,
 | 
			
		||||
                                          /* _admissionType != null
 | 
			
		||||
                                              ? _admissionType['DoctorName']
 | 
			
		||||
                                              :*/ null,
 | 
			
		||||
                                          true),
 | 
			
		||||
                                      enabled: false,
 | 
			
		||||
                                    ),
 | 
			
		||||
                                  ),
 | 
			
		||||
                                ),
 | 
			
		||||
                              ],
 | 
			
		||||
                            ),
 | 
			
		||||
                          ),
 | 
			
		||||
                        ],
 | 
			
		||||
                      ),
 | 
			
		||||
                    ),
 | 
			
		||||
                  ),
 | 
			
		||||
                  Container(
 | 
			
		||||
                    margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
 | 
			
		||||
                    child: AppButton(
 | 
			
		||||
                      title: TranslationBase.of(context).next,
 | 
			
		||||
                      color: HexColor("#B8382B"),
 | 
			
		||||
                      onPressed: (){
 | 
			
		||||
                        Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient});
 | 
			
		||||
                      },
 | 
			
		||||
                    ),
 | 
			
		||||
                  ),
 | 
			
		||||
                ],
 | 
			
		||||
              )
 | 
			
		||||
            : Container(),
 | 
			
		||||
      ),
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  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);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue