fix patient_search_screen.dart

merge-requests/244/head
Elham Rababah 5 years ago
parent 0147e7e49b
commit fb035cd4c9

@ -68,21 +68,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
try {
/* Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile)*/;
if (_formKey.currentState.validate()) {
_formKey.currentState.save();
/* sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType);
String token = await sharedPref.getString(TOKEN);
_patientSearchFormValues.TokenID = token;
_patientSearchFormValues.ProjectID = doctorProfile.projectID; //15
_patientSearchFormValues.DoctorID = doctorProfile.doctorID;
_patientSearchFormValues.ClinicID = doctorProfile.clinicID;*/
if ((_patientSearchFormValues.From == "0" ||
_patientSearchFormValues.To == "0") &&
_selectedType == "7") {

@ -59,22 +59,49 @@ class _DynamicElementsState extends State<DynamicElements> {
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration({String hintText,
String selectedText, bool isDropDown,IconData icon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
)
;
}
return LayoutBuilder(
builder: (ctx, constraints) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 10,
),
SizedBox(
height: 10,
),
AppTextFormField(
textInputType: TextInputType.number,
onTap: ()=> _presentDatePicker('_selectedFromDate'),
hintText: TranslationBase.of(context).fromDate,
controller: _fromDateController,
inputFormatter: ONLY_DATE,
onTap: () {
_presentDatePicker('_selectedFromDate');
},
onSaved: (value) {
if (_fromDateController.text.toString().trim().isEmpty) {
widget._patientSearchFormValues.From = "0";
@ -82,12 +109,14 @@ class _DynamicElementsState extends State<DynamicElements> {
widget._patientSearchFormValues.From = _fromDateController.text.replaceAll("/", "-");
}
},
readOnly: true,
),
SizedBox(
height: 10,
),
AppTextFormField(
textInputType: TextInputType.number,
readOnly: true,
hintText: TranslationBase
.of(context)
.toDate,

@ -4,10 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
// OWNER : Ibrahim albitar
// DATE : 19-04-2020
// DESCRIPTION : Custom Text Form Field for app.
class AppTextFormField extends FormField<String> {
AppTextFormField(
{FormFieldSetter<String> onSaved,
@ -41,6 +37,7 @@ class AppTextFormField extends FormField<String> {
obscureText: obscureText,
focusNode: focusNode,
keyboardType: textInputType,
readOnly: readOnly,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(inputFormatter)),

Loading…
Cancel
Save