Merge branch 'search_text_fields' into 'development'

Search text fields

See merge request Cloud_Solution/doctor_app_flutter!842
merge-requests/843/merge
Mohammad Aljammal 5 years ago
commit 771d94ff4c

@ -15,6 +15,7 @@ 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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -91,42 +92,18 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Center( AppTextFieldCustomSearch(
child: FractionallySizedBox( searchController: _controller,
widthFactor: .9, onChangeFun: (value) {
child: Container( model.searchData(value);
width: double.maxFinite, },
height: 75, marginTop: 5,
decoration: BoxDecoration( suffixIcon: IconButton(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: Color(0xffCCCCCC),
),
color: Colors.white),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon( icon: Icon(
DoctorApp.filter_1, DoctorApp.filter_1,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: EdgeInsets.only(bottom: 30),
),
onChanged: (String str) {
model.searchData(str);
}),
])),
), ),
), ),
model.state == ViewState.Idle model.state == ViewState.Idle
@ -135,7 +112,8 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
child: model.filterData.isEmpty child: model.filterData.isEmpty
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).youDontHaveAnyPatient, error: TranslationBase.of(context)
.youDontHaveAnyPatient,
), ),
) )
: ListView.builder( : ListView.builder(
@ -146,7 +124,8 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: PatientCard( child: PatientCard(
patientInfo: PatiantInformtion.fromJson(model.filterData[index].toJson()), patientInfo: PatiantInformtion.fromJson(
model.filterData[index].toJson()),
patientType: "0", patientType: "0",
arrivalType: "0", arrivalType: "0",
isFromSearch: false, isFromSearch: false,
@ -154,8 +133,13 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
isFromLiveCare: true, isFromLiveCare: true,
onTap: () { onTap: () {
// TODO change the parameter to daynamic // TODO change the parameter to daynamic
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(
"patient": PatiantInformtion.fromJson(model.filterData[index].toJson()), PATIENTS_PROFILE,
arguments: {
"patient":
PatiantInformtion.fromJson(
model.filterData[index]
.toJson()),
"patientType": "0", "patientType": "0",
"isSearch": false, "isSearch": false,
"isInpatient": false, "isInpatient": false,

@ -16,6 +16,7 @@ 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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -138,23 +139,14 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
), ),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: AppTextFieldCustomSearch(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
borderColor: Colors.white,
hintText: hintText:
TranslationBase.of(context).searchMedicineNameHere, TranslationBase.of(context).searchMedicineNameHere,
controller: myController, searchController: myController,
onSaved: (value) {},
onFieldSubmitted: (value) { onFieldSubmitted: (value) {
searchMedicine(context, model); searchMedicine(context, model);
}, },
inputFormatter: ONLY_LETTERS, marginTop: 5,
),
), ),
), ),
SizedBox( SizedBox(
@ -226,7 +218,9 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
["ItemID"], ["ItemID"],
url: model.pharmacyItemsList[index] url: model.pharmacyItemsList[index]
["ImageSRCUrl"]), ["ImageSRCUrl"]),
settings: RouteSettings(name: 'PharmaciesListScreen'),), settings: RouteSettings(
name: 'PharmaciesListScreen'),
),
); );
}, },
); );

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -31,7 +32,8 @@ class _DischargedPatientState extends State<DischargedPatient> {
backgroundColor: Colors.grey[200], backgroundColor: Colors.grey[200],
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: model.myDischargedPatient.isEmpty? Center( body: model.myDischargedPatient.isEmpty
? Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@ -51,7 +53,8 @@ class _DischargedPatientState extends State<DischargedPatient> {
) )
], ],
), ),
):Padding( )
: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -59,145 +62,164 @@ class _DischargedPatientState extends State<DischargedPatient> {
Container( Container(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
), ),
SizedBox(height: 12,), SizedBox(
Container( height: 12,
width: double.maxFinite,
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: Color(0xffCCCCCC),
), ),
color: Colors.white), AppTextFieldCustomSearch(
child: Column( searchController: _controller,
crossAxisAlignment: onChangeFun: (value) {
CrossAxisAlignment.start, model.searchData(value);
children: [ },
Padding( marginTop: 5,
padding: EdgeInsets.only( suffixIcon: IconButton(
left: 10, top: 10),
child: AppText(
TranslationBase.of(
context)
.searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon( icon: Icon(
DoctorApp.filter_1, DoctorApp.filter_1,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: ),
EdgeInsets.only( ),
bottom: 30), SizedBox(
), height: 5,
onChanged: (String str) { ),
model.searchData(str); Expanded(
}), child: SingleChildScrollView(
])),
SizedBox(height: 5,),
Expanded(child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
...List.generate(model.filterData.length, (index) => InkWell( ...List.generate(
model.filterData.length,
(index) => InkWell(
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context).pushNamed(
.pushNamed(
PATIENTS_PROFILE, PATIENTS_PROFILE,
arguments: { arguments: {
"patient": model.filterData[index], "patient":
model.filterData[index],
"patientType": "1", "patientType": "1",
"isSearch": false, "isSearch": false,
"isInpatient": true, "isInpatient": true,
"isDischargedPatient": true "isDischargedPatient": true
}); });
}, },
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), padding: EdgeInsets.only(
left: 0,
right: 5,
bottom: 5,
top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius:
BorderRadius.circular(15),
color: Colors.white, color: Colors.white,
), ),
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(left: 12.0), padding: EdgeInsets.only(
left: 12.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [ children: [
Row(children: [ Row(children: [
Container( Container(
width: 170, width: 170,
child: AppText( child: AppText(
(Helpers.capitalize(model (Helpers.capitalize(model
.filterData[index] .filterData[
index]
.firstName) + .firstName) +
" " + " " +
Helpers.capitalize(model Helpers.capitalize(model
.filterData[index] .filterData[
index]
.lastName)), .lastName)),
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.bold, fontWeight:
fontFamily: 'Poppins', FontWeight
textOverflow: TextOverflow.ellipsis, .bold,
fontFamily:
'Poppins',
textOverflow:
TextOverflow
.ellipsis,
), ),
), ),
model.filterData[index].gender == 1 model.filterData[index]
.gender ==
1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp
color: Colors.blue, .male_2,
color: Colors
.blue,
) )
: Icon( : Icon(
DoctorApp.female_1, DoctorApp
color: Colors.pink, .female_1,
color: Colors
.pink,
), ),
]), ]),
Row( Row(
children: [ children: [
AppText( AppText(
model.filterData[index].nationalityName != null model.filterData[index].nationalityName !=
? model.filterData[index].nationalityName.trim() null
: model.filterData[index].nationality != null ? model
? model.filterData[index].nationality.trim() .filterData[
: model.filterData[index].nationalityId != null index]
.nationalityName
.trim()
: model.filterData[index].nationality !=
null
? model
.filterData[
index]
.nationality
.trim()
: model.filterData[index].nationalityId !=
null
? model.filterData[index].nationalityId ? model.filterData[index].nationalityId
: "", : "",
fontWeight: FontWeight.bold, fontWeight:
FontWeight
.bold,
fontSize: 14, fontSize: 14,
textOverflow: TextOverflow.ellipsis, textOverflow:
TextOverflow
.ellipsis,
), ),
model.filterData[index] model.filterData[index].nationality !=
.nationality !=
null || null ||
model.filterData[index] model.filterData[index].nationalityId !=
.nationalityId !=
null null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius:
BorderRadius.circular(20.0), BorderRadius.circular(
child: Image.network( 20.0),
model.filterData[index].nationalityFlagURL != null ? child: Image
model.filterData[index].nationalityFlagURL .network(
model.filterData[index].nationalityFlagURL !=
null
? model.filterData[index].nationalityFlagURL
: '', : '',
height: 25, height:
width: 30, 25,
errorBuilder: width:
(BuildContext context, 30,
Object exception, errorBuilder: (BuildContext context,
StackTrace stackTrace) { Object
exception,
StackTrace
stackTrace) {
return AppText( return AppText(
'', '',
fontSize: 10, fontSize:
10,
); );
}, },
)) ))
@ -209,19 +231,26 @@ class _DischargedPatientState extends State<DischargedPatient> {
Row( Row(
children: <Widget>[ children: <Widget>[
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
MainAxisAlignment
.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(left: 12.0), padding:
EdgeInsets.only(
left: 12.0),
child: Container( child: Container(
width: 60, width: 60,
height: 60, height: 60,
child: Image.asset( child:
model.filterData[index].gender == Image.asset(
model.filterData[index]
.gender ==
1 1
? 'assets/images/male_avatar.png' ? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png', : 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit
.cover,
), ),
), ),
), ),
@ -232,54 +261,80 @@ class _DischargedPatientState extends State<DischargedPatient> {
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text:
new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: fontSize: 2.0 *
2.0 * SizeConfig.textMultiplier, SizeConfig
color: Colors.black), .textMultiplier,
children: <TextSpan>[ color: Colors
.black),
children: <
TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase.of(context) text: TranslationBase.of(context)
.fileNumber, .fileNumber,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize:
fontFamily: 'Poppins')), 14,
fontFamily:
'Poppins')),
new TextSpan( new TextSpan(
text: model text: model
.filterData[index] .filterData[
index]
.patientId .patientId
.toString(), .toString(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight
fontFamily: 'Poppins', .w700,
fontSize: 15)), fontFamily:
'Poppins',
fontSize:
15)),
], ],
), ),
), ),
), ),
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text:
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan( new TextSpan(
text: model.filterData[index].admissionDate == null ? "" : style:
TranslationBase.of(context).admissionDate + " : ", new TextStyle(
style: TextStyle(fontSize: 14)), fontSize: 2.0 *
SizeConfig
.textMultiplier,
color: Colors
.black,
fontFamily:
'Poppins',
),
children: <
TextSpan>[
new TextSpan( new TextSpan(
text: model.filterData[index].admissionDate == null ? "" text: model.filterData[index].admissionDate ==
null
? ""
: TranslationBase.of(context).admissionDate +
" : ",
style: TextStyle(
fontSize:
14)),
new TextSpan(
text: model.filterData[index].admissionDate ==
null
? ""
: "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
fontSize: 15)), fontSize: 15)),
], ],
), ),
@ -287,23 +342,36 @@ class _DischargedPatientState extends State<DischargedPatient> {
), ),
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text:
style: new TextStyle( new TextSpan(
fontSize: style:
2.0 * SizeConfig.textMultiplier, new TextStyle(
color: Colors.black, fontSize: 2.0 *
fontFamily: 'Poppins', SizeConfig
), .textMultiplier,
children: <TextSpan>[ color: Colors
.black,
fontFamily:
'Poppins',
),
children: <
TextSpan>[
new TextSpan( new TextSpan(
text: model.filterData[index].dischargeDate == null ? "" text: model.filterData[index].dischargeDate ==
null
? ""
: "Discharge Date : ", : "Discharge Date : ",
style: TextStyle(fontSize: 14)), style: TextStyle(
fontSize:
14)),
new TextSpan( new TextSpan(
text: model.filterData[index].dischargeDate == null ? "" text: model.filterData[index].dischargeDate ==
null
? ""
: "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight:
FontWeight.w700,
fontSize: 15)), fontSize: 15)),
], ],
), ),
@ -313,12 +381,18 @@ class _DischargedPatientState extends State<DischargedPatient> {
children: [ children: [
AppText( AppText(
"${TranslationBase.of(context).numOfDays}: ", "${TranslationBase.of(context).numOfDays}: ",
fontSize: 14,fontWeight: FontWeight.w300, fontSize: 14,
fontWeight:
FontWeight
.w300,
), ),
AppText( AppText(
"${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}",
fontSize: 15, fontSize:
fontWeight: FontWeight.w700), 15,
fontWeight:
FontWeight
.w700),
], ],
), ),
], ],
@ -336,14 +410,11 @@ class _DischargedPatientState extends State<DischargedPatient> {
)), )),
], ],
), ),
), ),
),],
), ),
),) ],
); ),
),
));
} }
} }

@ -6,6 +6,7 @@ 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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -140,37 +141,18 @@ class _InPatientListPageState extends State<InPatientListPage> {
], ],
), ),
), ),
Container( AppTextFieldCustomSearch(
margin: EdgeInsets.only( searchController: _searchController,
left: 16, onChangeFun: (value) {
right: 16,
bottom: 16,
top: widget.isMyInPatient ? 15 : 5),
child: Stack(
children: [
AppTextFieldCustom(
hintText: TranslationBase.of(context).searchPatientName,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
onPressed: () {},
),
controller: _searchController,
onChanged: (value) {
setState(() { setState(() {
hasQuery = true; hasQuery = true;
}); });
widget.patientSearchViewModel.filterSearchResults(value, widget.patientSearchViewModel.filterSearchResults(value,
isAllClinic: widget.isAllClinic, isAllClinic: widget.isAllClinic,
isMyInPatient: widget.isMyInPatient); isMyInPatient: widget.isMyInPatient);
}), },
Positioned( marginTop: widget.isMyInPatient ? 15 : 5,
right: 35, positionedChild: IconButton(
top: 5,
child: IconButton(
icon: Icon( icon: Icon(
isSortDes isSortDes
? FontAwesomeIcons.sortAmountDown ? FontAwesomeIcons.sortAmountDown
@ -189,9 +171,6 @@ class _InPatientListPageState extends State<InPatientListPage> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
), ),
)
],
),
), ),
widget.patientSearchViewModel.state == ViewState.Idle widget.patientSearchViewModel.state == ViewState.Idle
? (widget.isMyInPatient && ? (widget.isMyInPatient &&

@ -17,6 +17,7 @@ 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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -105,13 +106,15 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
Container( Container(
// color: Colors.red, // color: Colors.red,
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC), decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0), borderRadius: 4, borderWidth: 0),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: _times.map((item) { children: _times.map((item) {
bool _isActive = _times[_activeLocation] == item ? true : false; bool _isActive =
_times[_activeLocation] == item ? true : false;
return Expanded( return Expanded(
child: InkWell( child: InkWell(
@ -131,7 +134,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
await model.getPatientBasedOnDate( await model.getPatientBasedOnDate(
item: item, item: item,
selectedPatientType: widget.selectedPatientType, selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel: widget.patientSearchRequestModel, patientSearchRequestModel:
widget.patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo, isSearchWithKeyInfo: widget.isSearchWithKeyInfo,
outPatientFilterType: outPatientFilterType); outPatientFilterType: outPatientFilterType);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -139,9 +143,14 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
child: Center( child: Center(
child: Container( child: Container(
height: screenSize.height * 0.070, height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration( decoration:
_isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), TextFieldsUtils.containerBorderDecoration(
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), _isActive
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
_isActive
? Color(0xFFD02127)
: Color(0xFFEAEAEA),
borderRadius: 4, borderRadius: 4,
borderWidth: 0), borderWidth: 0),
child: Center( child: Center(
@ -151,16 +160,22 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
AppText( AppText(
item, item,
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E), color: _isActive
? Colors.white
: Color(0xFF2B353E),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
_isActive && _activeLocation != 0 && model.state == ViewState.Idle _isActive &&
_activeLocation != 0 &&
model.state == ViewState.Idle
? Container( ? Container(
padding: EdgeInsets.all(2), padding: EdgeInsets.all(2),
margin: EdgeInsets.symmetric(horizontal: 5), margin: EdgeInsets.symmetric(
horizontal: 5),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(50), borderRadius:
BorderRadius.circular(50),
), ),
constraints: BoxConstraints( constraints: BoxConstraints(
minWidth: 20, minWidth: 20,
@ -168,7 +183,9 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
), ),
child: new Text( child: new Text(
model.filterData.length.toString(), model.filterData.length.toString(),
style: new TextStyle(color: Colors.red, fontSize: 10), style: new TextStyle(
color: Colors.red,
fontSize: 10),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
) )
@ -184,69 +201,50 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
), ),
), ),
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( AppTextFieldCustomSearch(
width: SizeConfig.screenWidth * 0.9, searchController: _controller,
height: 85, onChangeFun: (value) {
decoration: BoxDecoration( model.searchData(value);
borderRadius: BorderRadius.all(Radius.circular(6.0)), },
border: Border.all( marginTop: 5,
width: 1.0, suffixIcon: IconButton(
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).searchPatientName,
fontSize: 13,
)),
Stack(
children: [
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon( icon: Icon(
_activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, _activeLocation != 0
? DoctorApp.filter_1
: FontAwesomeIcons.slidersH,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: EdgeInsets.only(bottom: 30),
onPressed: _activeLocation != 0 onPressed: _activeLocation != 0
? null ? null
: () { : () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => FilterDatePage( builder: (BuildContext context) =>
FilterDatePage(
outPatientFilterType: outPatientFilterType, outPatientFilterType: outPatientFilterType,
patientSearchViewModel: model, patientSearchViewModel: model,
),settings: RouteSettings(name: 'FilterOutPatentDateScreen'),)); ),
settings: RouteSettings(
name: 'FilterOutPatentDateScreen'),
));
}, },
), ),
onChanged: (String str) { positionedChild: IconButton(
model.searchData(str);
}),
Positioned(
right: 25,
child: IconButton(
icon: Icon( icon: Icon(
isSortDes ? FontAwesomeIcons.sortAmountDown : FontAwesomeIcons.sortAmountUp, isSortDes
? FontAwesomeIcons.sortAmountDown
: FontAwesomeIcons.sortAmountUp,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: EdgeInsets.only(bottom: 30),
onPressed: () { onPressed: () {
model.sortOutPatient(isDes: isSortDes); model.sortOutPatient(isDes: isSortDes);
isSortDes = !isSortDes; isSortDes = !isSortDes;
}, },
), ),
)
],
), ),
])),
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
@ -255,7 +253,8 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
child: model.filterData.isEmpty child: model.filterData.isEmpty
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).youDontHaveAnyPatient, error: TranslationBase.of(context)
.youDontHaveAnyPatient,
), ),
) )
: ListView.builder( : ListView.builder(
@ -264,8 +263,11 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
itemCount: model.filterData.length, itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
if (_activeLocation != 0 || if (_activeLocation != 0 ||
(model.filterData[index].patientStatusType != null && (model.filterData[index].patientStatusType !=
model.filterData[index].patientStatusType == 43)) null &&
model.filterData[index]
.patientStatusType ==
43))
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: PatientCard( child: PatientCard(
@ -276,11 +278,15 @@ class _OutPatientsScreenState extends State<OutPatientsScreen> {
isInpatient: widget.isInpatient, isInpatient: widget.isInpatient,
onTap: () { onTap: () {
// TODO change the parameter to daynamic // TODO change the parameter to daynamic
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index], "patient": model.filterData[index],
"patientType": "1", "patientType": "1",
"from": widget.patientSearchRequestModel.from, "from": widget
"to": widget.patientSearchRequestModel.from, .patientSearchRequestModel.from,
"to": widget
.patientSearchRequestModel.from,
"isSearch": false, "isSearch": false,
"isInpatient": false, "isInpatient": false,
"arrivalType": "7", "arrivalType": "7",

@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dar
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -81,41 +82,21 @@ class _PatientsSearchResultScreenState
body: Column( body: Column(
children: [ children: [
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( AppTextFieldCustomSearch(
width: SizeConfig.screenWidth * 0.9, searchController: _controller,
height: 75, onChangeFun: (value) {
decoration: BoxDecoration( model.searchData(value);
borderRadius: BorderRadius.all(Radius.circular(6.0)), },
border: Border.all( marginTop: 5,
width: 1.0, suffixIcon: IconButton(
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).searchPatientName,
fontSize: 13,
)),
AppTextFormField(
// focusNode: focusProject,
controller: _controller,
borderColor: Colors.white,
prefix: IconButton(
icon: Icon( icon: Icon(
DoctorApp.filter_1, DoctorApp.filter_1,
color: Colors.black, color: Colors.black,
), ),
iconSize: 20, iconSize: 20,
padding: EdgeInsets.only(bottom: 30), // padding: EdgeInsets.only(bottom: 30),
),
), ),
onChanged: (String str) {
model.searchData(str);
}),
])),
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),

@ -10,6 +10,7 @@ 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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -47,7 +48,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
BottomSheetTitle( BottomSheetTitle(
title: TranslationBase.of(context).searchPatient), title: TranslationBase.of(context).searchPatient),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.9, // widthFactor: 0.9,
child: Container( child: Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
child: Column( child: Column(
@ -59,26 +60,17 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( AppTextFieldCustomSearch(
margin: searchController: patientFileInfoController,
EdgeInsets.only(left: 0, right: 0, top: 15), onChangeFun: (value) {},
child: AppTextFieldCustom( marginTop: 5,
hintText: TranslationBase.of(context)
.patpatientIDMobilenationalientID,
isTextFieldHasSuffix: false,
maxLines: 1,
minLines: 1,
inputType: TextInputType.number,
hasBorder: true,
controller: patientFileInfoController,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow( FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS)) RegExp(ONLY_NUMBERS))
], ],
onChanged: (_) {}, inputType: TextInputType.number,
validationError: (isFormSubmitted && validationError: (isFormSubmitted &&
(patientFileInfoController (patientFileInfoController.text.isEmpty &&
.text.isEmpty &&
firstNameInfoController firstNameInfoController
.text.isEmpty && .text.isEmpty &&
middleNameInfoController middleNameInfoController
@ -88,7 +80,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
? TranslationBase.of(context).emptyMessage ? TranslationBase.of(context).emptyMessage
: null, : null,
), ),
),
SizedBox( SizedBox(
height: 5, height: 5,
), ),

@ -45,7 +45,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
AuthenticationViewModel authenticationViewModel; AuthenticationViewModel authenticationViewModel;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { getProgressNoteList(BuildContext context, PatientViewModel model,
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -60,7 +61,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2); languageID: 2);
model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { model
.getPatientProgressNote(progressNoteRequest.toJson(),
isLocalBusy: isLocalBusy)
.then((c) {
notesList = model.patientProgressNoteList; notesList = model.patientProgressNoteList;
}); });
} }
@ -72,7 +76,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String arrivalType = routeArgs['arrivalType']; String arrivalType = routeArgs['arrivalType'];
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model), onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -83,8 +88,10 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
patient, patient,
isInpatient: true, isInpatient: true,
), ),
body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 body: model.patientProgressNoteList == null ||
? DrAppEmbeddedError(error: TranslationBase.of(context).errorNoProgressNote) model.patientProgressNoteList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote)
: Container( : Container(
color: Colors.grey[200], color: Colors.grey[200],
child: Column( child: Column(
@ -122,60 +129,105 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
widthFactor: 0.95, widthFactor: 0.95,
child: CardWithBgWidget( child: CardWithBgWidget(
hasBorder: false, hasBorder: false,
bgColor: model.patientProgressNoteList[index].status == 1 && bgColor: model.patientProgressNoteList[index]
authenticationViewModel.doctorProfile.doctorID != .status ==
model.patientProgressNoteList[index].createdBy 1 &&
authenticationViewModel
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy
? Color(0xFFCC9B14) ? Color(0xFFCC9B14)
: model.patientProgressNoteList[index].status == 4 : model.patientProgressNoteList[index]
.status ==
4
? Colors.red.shade700 ? Colors.red.shade700
: model.patientProgressNoteList[index].status == 2 : model.patientProgressNoteList[index]
.status ==
2
? Colors.green[600] ? Colors.green[600]
: Color(0xFFCC9B14), : Color(0xFFCC9B14),
widget: Column( widget: Column(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
if (model.patientProgressNoteList[index].status == 1 && if (model
authenticationViewModel.doctorProfile.doctorID != .patientProgressNoteList[
model.patientProgressNoteList[index].createdBy) index]
.status ==
1 &&
authenticationViewModel
.doctorProfile.doctorID !=
model
.patientProgressNoteList[
index]
.createdBy)
AppText( AppText(
TranslationBase.of(context).notePending, TranslationBase.of(context)
.notePending,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFFCC9B14), color: Color(0xFFCC9B14),
fontSize: 12, fontSize: 12,
), ),
if (model.patientProgressNoteList[index].status == 4) if (model
.patientProgressNoteList[
index]
.status ==
4)
AppText( AppText(
TranslationBase.of(context).noteCanceled, TranslationBase.of(context)
.noteCanceled,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.red.shade700, color: Colors.red.shade700,
fontSize: 12, fontSize: 12,
), ),
if (model.patientProgressNoteList[index].status == 2) if (model
.patientProgressNoteList[
index]
.status ==
2)
AppText( AppText(
TranslationBase.of(context).noteVerified, TranslationBase.of(context)
.noteVerified,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.green[600], color: Colors.green[600],
fontSize: 12, fontSize: 12,
), ),
if (model.patientProgressNoteList[index].status != 2 && if (model.patientProgressNoteList[index].status != 2 &&
model.patientProgressNoteList[index].status != 4 && model
authenticationViewModel.doctorProfile.doctorID == .patientProgressNoteList[
model.patientProgressNoteList[index].createdBy) index]
.status !=
4 &&
authenticationViewModel
.doctorProfile.doctorID ==
model
.patientProgressNoteList[
index]
.createdBy)
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => UpdateNoteOrder( builder: (context) =>
note: model.patientProgressNoteList[index], UpdateNoteOrder(
patientModel: model, note: model
patient: patient, .patientProgressNoteList[
visitType: widget.visitType, index],
patientModel:
model,
patient:
patient,
visitType: widget
.visitType,
isUpdate: true, isUpdate: true,
)), )),
); );
@ -183,7 +235,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[600], color: Colors.grey[600],
borderRadius: BorderRadius.circular(10), borderRadius:
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], // color:Colors.red[600],
@ -198,7 +252,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
TranslationBase.of(context).update, TranslationBase.of(
context)
.update,
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -216,33 +272,61 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
context: context, context: context,
actionName: "verify", actionName: "verify",
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils
UpdateNoteReqModel reqModel = UpdateNoteReqModel( .showMyDialog(
admissionNo: int.parse(patient.admissionNo), context);
cancelledNote: false, UpdateNoteReqModel
lineItemNo: model.patientProgressNoteList[index].lineItemNo, reqModel =
createdBy: model.patientProgressNoteList[index].createdBy, UpdateNoteReqModel(
notes: model.patientProgressNoteList[index].notes, admissionNo: int
.parse(patient
.admissionNo),
cancelledNote:
false,
lineItemNo: model
.patientProgressNoteList[
index]
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: true, verifiedNote: true,
patientTypeID: patient.patientType, patientTypeID:
patient
.patientType,
patientOutSA: false, patientOutSA: false,
); );
await model.updatePatientProgressNote(reqModel); await model
await getProgressNoteList(context, model, isLocalBusy: true); .updatePatientProgressNote(
GifLoaderDialogUtils.hideDialog(context); reqModel);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.green[600], color: Colors.green[600],
borderRadius: BorderRadius.circular(10), borderRadius:
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], // color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons.check, FontAwesomeIcons
.check,
size: 12, size: 12,
color: Colors.white, color: Colors.white,
), ),
@ -250,7 +334,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
width: 2, width: 2,
), ),
AppText( AppText(
TranslationBase.of(context).noteVerify, TranslationBase.of(
context)
.noteVerify,
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
), ),
@ -266,37 +352,66 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
onTap: () async { onTap: () async {
showMyDialog( showMyDialog(
context: context, context: context,
actionName: TranslationBase.of(context).cancel, actionName:
TranslationBase.of(
context)
.cancel,
confirmFun: () async { confirmFun: () async {
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils
.showMyDialog(
context, context,
); );
UpdateNoteReqModel reqModel = UpdateNoteReqModel( UpdateNoteReqModel
admissionNo: int.parse(patient.admissionNo), reqModel =
UpdateNoteReqModel(
admissionNo: int
.parse(patient
.admissionNo),
cancelledNote: true, cancelledNote: true,
lineItemNo: model.patientProgressNoteList[index].lineItemNo, lineItemNo: model
createdBy: model.patientProgressNoteList[index].createdBy, .patientProgressNoteList[
notes: model.patientProgressNoteList[index].notes, index]
.lineItemNo,
createdBy: model
.patientProgressNoteList[
index]
.createdBy,
notes: model
.patientProgressNoteList[
index]
.notes,
verifiedNote: false, verifiedNote: false,
patientTypeID: patient.patientType, patientTypeID:
patient
.patientType,
patientOutSA: false, patientOutSA: false,
); );
await model.updatePatientProgressNote(reqModel); await model
await getProgressNoteList(context, model, isLocalBusy: true); .updatePatientProgressNote(
GifLoaderDialogUtils.hideDialog(context); reqModel);
await getProgressNoteList(
context, model,
isLocalBusy:
true);
GifLoaderDialogUtils
.hideDialog(
context);
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red[600], color: Colors.red[600],
borderRadius: BorderRadius.circular(10), borderRadius:
BorderRadius.circular(
10),
), ),
// color:Colors.red[600], // color:Colors.red[600],
child: Row( child: Row(
children: [ children: [
Icon( Icon(
FontAwesomeIcons.trash, FontAwesomeIcons
.trash,
size: 12, size: 12,
color: Colors.white, color: Colors.white,
), ),
@ -322,25 +437,40 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
height: 10, height: 10,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start, MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.60, width: MediaQuery.of(context)
.size
.width *
0.60,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment
.start,
children: [ children: [
AppText( AppText(
TranslationBase.of(context).createdBy, TranslationBase.of(
context)
.createdBy,
fontSize: 10, fontSize: 10,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model.patientProgressNoteList[index].doctorName ?? '', model
fontWeight: FontWeight.w600, .patientProgressNoteList[
index]
.doctorName ??
'',
fontWeight:
FontWeight.w600,
fontSize: 12, fontSize: 12,
), ),
), ),
@ -352,36 +482,66 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
Column( Column(
children: [ children: [
AppText( AppText(
model.patientProgressNoteList[index].createdOn != null model
.patientProgressNoteList[
index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted( ? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.getDateTimeFromServerFormat( AppDateUtils
model.patientProgressNoteList[index].createdOn), .getDateTimeFromServerFormat(model
isArabic: projectViewModel.isArabic) .patientProgressNoteList[
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), index]
isArabic: projectViewModel.isArabic), .createdOn),
isArabic:
projectViewModel
.isArabic,
isMonthshort: true)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now(),
isArabic:
projectViewModel
.isArabic),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
AppText( AppText(
model.patientProgressNoteList[index].createdOn != null model
? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat( .patientProgressNoteList[
model.patientProgressNoteList[index].createdOn)) index]
: AppDateUtils.getHour(DateTime.now()), .createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.getDateTimeFromServerFormat(model
.patientProgressNoteList[
index]
.createdOn))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
], ],
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment:
CrossAxisAlignment.end,
) )
], ],
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row(mainAxisAlignment: MainAxisAlignment.start, children: [ Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded( Expanded(
child: AppText( child: AppText(
model.patientProgressNoteList[index].notes, model
.patientProgressNoteList[
index]
.notes,
fontSize: 10, fontSize: 10,
), ),
), ),

@ -41,7 +41,8 @@ class AppDateUtils {
final endIndex = str.indexOf(end, startIndex + start.length); final endIndex = str.indexOf(end, startIndex + start.length);
date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
} else { } else {
date = DateTime.now(); date = DateTime.now();
} }
@ -52,7 +53,8 @@ class AppDateUtils {
return date; return date;
} }
static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate, BuildContext context) { static String differenceBetweenDateAndCurrentInYearMonthDay(
DateTime firstDate, BuildContext context) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
// now = now.add(Duration(days: 400, minutes: 0)); // now = now.add(Duration(days: 400, minutes: 0));
var difference = firstDate.difference(now); var difference = firstDate.difference(now);
@ -72,13 +74,16 @@ class AppDateUtils {
return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}"; return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}";
} }
static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context, {bool isShowSecond = false, bool isShowDays = true }) { static String differenceBetweenDateAndCurrent(
DateTime firstDate, BuildContext context,
{bool isShowSecond = false, bool isShowDays = true}) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
var difference = now.difference(firstDate); var difference = now.difference(firstDate);
int minutesInDays = difference.inMinutes; int minutesInDays = difference.inMinutes;
int secondInDays = difference.inSeconds; int secondInDays = difference.inSeconds;
int hoursInDays = minutesInDays ~/ 60; // ~/ : truncating division to make the result int int hoursInDays =
minutesInDays ~/ 60; // ~/ : truncating division to make the result int
int second = secondInDays % 60; int second = secondInDays % 60;
int minutes = minutesInDays % 60; int minutes = minutesInDays % 60;
int days = hoursInDays ~/ 24; int days = hoursInDays ~/ 24;
@ -94,7 +99,8 @@ class AppDateUtils {
(isShowSecond ? ", $second Sec" : ""); (isShowSecond ? ", $second Sec" : "");
} }
static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) { static String differenceBetweenServerDateAndCurrent(
String str, BuildContext context) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
@ -103,7 +109,8 @@ class AppDateUtils {
final endIndex = str.indexOf(end, startIndex + start.length); final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
return differenceBetweenDateAndCurrent(date, context); return differenceBetweenDateAndCurrent(date, context);
} }
@ -262,29 +269,39 @@ class AppDateUtils {
/// [dateTime] convert DateTime to data formatted Arabic /// [dateTime] convert DateTime to data formatted Arabic
static String getMonthDayYearDateFormattedAr(DateTime dateTime) { static String getMonthDayYearDateFormattedAr(DateTime dateTime) {
if (dateTime != null) if (dateTime != null)
return getMonthArabic(dateTime.month) + " " + dateTime.day.toString() + ", " + dateTime.year.toString(); return getMonthArabic(dateTime.month) +
" " +
dateTime.day.toString() +
", " +
dateTime.year.toString();
else else
return ""; return "";
} }
/// get data formatted like Apr 26,2020 /// get data formatted like Apr 26,2020
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getMonthDayYearDateFormatted(DateTime dateTime, {bool isArabic = false}) { static String getMonthDayYearDateFormatted(DateTime dateTime,
{bool isArabic = false}) {
if (dateTime != null) if (dateTime != null)
return isArabic return isArabic
? getMonthArabic(dateTime.month) ? getMonthArabic(dateTime.month)
: getMonth(dateTime.month) + " " + dateTime.day.toString() + ", " + dateTime.year.toString(); : getMonth(dateTime.month) +
" " +
dateTime.day.toString() +
", " +
dateTime.year.toString();
else else
return ""; return "";
} }
/// get data formatted like 26 Apr 2020 /// get data formatted like 26 Apr 2020
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getDayMonthYearDateFormatted(DateTime dateTime, {bool isArabic = false}) { static String getDayMonthYearDateFormatted(DateTime dateTime,
{bool isArabic = false, bool isMonthshort = false}) {
if (dateTime != null) if (dateTime != null)
return dateTime.day.toString() + return dateTime.day.toString() +
" " + " " +
"${isArabic ? getMonthArabic(dateTime.month) : getMonth(dateTime.month)}" + "${isArabic ? getMonthArabic(dateTime.month) : isMonthshort ? getMonth(dateTime.month).toString().substring(0, 3) : getMonth(dateTime.month)}" +
" " + " " +
dateTime.year.toString(); dateTime.year.toString();
else else
@ -293,9 +310,14 @@ class AppDateUtils {
/// get data formatted like 26/4/2020 /// get data formatted like 26/4/2020
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getDayMonthYearDate(DateTime dateTime, {bool isArabic = false}) { static String getDayMonthYearDate(DateTime dateTime,
{bool isArabic = false}) {
if (dateTime != null) if (dateTime != null)
return dateTime.day.toString() + "/" + "${dateTime.month}" + "/" + dateTime.year.toString(); return dateTime.day.toString() +
"/" +
"${dateTime.month}" +
"/" +
dateTime.year.toString();
else else
return ""; return "";
} }
@ -306,7 +328,8 @@ class AppDateUtils {
return DateFormat('hh:mm a').format(dateTime); return DateFormat('hh:mm a').format(dateTime);
} }
static String getAgeByBirthday(String birthOfDate, BuildContext context, {bool isServerFormat = true}) { static String getAgeByBirthday(String birthOfDate, BuildContext context,
{bool isServerFormat = true}) {
// https://leechy.dev/calculate-dates-diff-in-dart // https://leechy.dev/calculate-dates-diff-in-dart
DateTime birthDate; DateTime birthDate;
if (birthOfDate.contains("/Date")) { if (birthOfDate.contains("/Date")) {
@ -331,7 +354,9 @@ class AppDateUtils {
static bool isToday(DateTime dateTime) { static bool isToday(DateTime dateTime) {
DateTime todayDate = DateTime.now().toUtc(); DateTime todayDate = DateTime.now().toUtc();
if (dateTime.day == todayDate.day && dateTime.month == todayDate.month && dateTime.year == todayDate.year) { if (dateTime.day == todayDate.day &&
dateTime.month == todayDate.month &&
dateTime.year == todayDate.year) {
return true; return true;
} }
return false; return false;
@ -340,7 +365,11 @@ class AppDateUtils {
static String getDate(DateTime dateTime) { static String getDate(DateTime dateTime) {
print(dateTime); print(dateTime);
if (dateTime != null) if (dateTime != null)
return getMonth(dateTime.month) + " " + dateTime.day.toString() + "," + dateTime.year.toString(); return getMonth(dateTime.month) +
" " +
dateTime.day.toString() +
"," +
dateTime.year.toString();
else else
return ""; return "";
} }
@ -348,7 +377,11 @@ class AppDateUtils {
static String getDateFormatted(DateTime dateTime) { static String getDateFormatted(DateTime dateTime) {
print(dateTime); print(dateTime);
if (dateTime != null) if (dateTime != null)
return dateTime.day.toString() + "/" + dateTime.month.toString() + "/" + dateTime.year.toString(); return dateTime.day.toString() +
"/" +
dateTime.month.toString() +
"/" +
dateTime.year.toString();
else else
return ""; return "";
} }
@ -376,7 +409,6 @@ class AppDateUtils {
return ""; return "";
} }
// handel date like "09/05/2021 17:00" // handel date like "09/05/2021 17:00"
static DateTime getDateTimeFromString(String str) { static DateTime getDateTimeFromString(String str) {
List<String> array = str.split('/'); List<String> array = str.split('/');
@ -388,13 +420,12 @@ class AppDateUtils {
String hour = array2[1]; String hour = array2[1];
List<String> hourList = hour.split(":"); List<String> hourList = hour.split(":");
DateTime date = DateTime(year, month, day, int.parse(hourList[0]), int.parse(hourList[1])); DateTime date = DateTime(
year, month, day, int.parse(hourList[0]), int.parse(hourList[1]));
return date; return date;
} }
static convertDateFormatImproved(String str) { static convertDateFormatImproved(String str) {
String newDate; String newDate;
const start = "/Date("; const start = "/Date(";

@ -24,11 +24,16 @@ class AppTextFieldCustom extends StatefulWidget {
final int maxLines; final int maxLines;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter> inputFormatters;
final Function(String) onChanged; final Function(String) onChanged;
final Function onFieldSubmitted;
final String validationError; final String validationError;
final bool isPrscription; final bool isPrscription;
final bool isSecure; final bool isSecure;
final bool focus; final bool focus;
///TODO Rename it to isCustomSearchablFiels
final bool isSearchTextField;
AppTextFieldCustom({ AppTextFieldCustom({
this.height = 0, this.height = 0,
this.onClick, this.onClick,
@ -49,6 +54,8 @@ class AppTextFieldCustom extends StatefulWidget {
this.isPrscription = false, this.isPrscription = false,
this.isSecure = false, this.isSecure = false,
this.focus = false, this.focus = false,
this.isSearchTextField = false,
this.onFieldSubmitted,
}); });
@override @override
@ -109,7 +116,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
Expanded( Expanded(
child: Container( child: Container(
padding: widget.dropDownText == null padding: widget.dropDownText == null
? EdgeInsets.symmetric(vertical: 0) ? widget.isSearchTextField
? EdgeInsets.only(top: 10)
: EdgeInsets.symmetric(vertical: 0)
: EdgeInsets.symmetric(vertical: 0), // 8.0 : EdgeInsets.symmetric(vertical: 0), // 8.0
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -120,9 +129,11 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
widget.dropDownText != null) widget.dropDownText != null)
AppText( AppText(
widget.hintText, widget.hintText,
// marginTop: widget.hasHintmargin ? 0 : 30,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: widget.isPrscription == false fontSize: widget.isPrscription == false
? SizeConfig.getHeightMultiplier() * (SizeConfig.isWidthLarge?1.1: 1.3) ? SizeConfig.getHeightMultiplier() *
(SizeConfig.isWidthLarge ? 1.1 : 1.3)
: 0, : 0,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
@ -163,6 +174,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
widget.onChanged(value); widget.onChanged(value);
} }
}, },
onFieldSubmitted: widget.onFieldSubmitted,
obscureText: widget.isSecure), obscureText: widget.isSecure),
) )
: AppText( : AppText(
@ -177,7 +189,15 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
widget.isTextFieldHasSuffix widget.isTextFieldHasSuffix
? widget.suffixIcon != null ? widget.suffixIcon != null
? widget.suffixIcon ? Container(
margin: EdgeInsets.only(
bottom: widget.isSearchTextField
? (widget.controller.text.isEmpty ||
widget.controller == null)
? 10
: 25
: 0),
child: widget.suffixIcon)
: InkWell( : InkWell(
child: Icon( child: Icon(
Icons.keyboard_arrow_down, Icons.keyboard_arrow_down,
@ -196,5 +216,4 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
], ],
); );
} }
} }

@ -0,0 +1,66 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'app-textfield-custom.dart';
class AppTextFieldCustomSearch extends StatelessWidget {
const AppTextFieldCustomSearch({
Key key,
this.onChangeFun,
this.positionedChild,
this.marginTop,
this.suffixIcon,
this.validationError,
this.inputType,
this.inputFormatters,
this.searchController,
this.onFieldSubmitted,
this.hintText,
});
final TextEditingController searchController;
final Function onChangeFun;
final Function onFieldSubmitted;
final Widget positionedChild;
final IconButton suffixIcon;
final double marginTop;
final String validationError;
final String hintText;
final TextInputType inputType;
final List<TextInputFormatter> inputFormatters;
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop),
child: Stack(
children: [
AppTextFieldCustom(
hintText:
hintText ?? TranslationBase.of(context).searchPatientName,
isTextFieldHasSuffix: true,
isSearchTextField: true,
inputFormatters: inputFormatters,
suffixIcon: suffixIcon ??
IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
onPressed: () {},
),
controller: searchController,
onChanged: onChangeFun,
onFieldSubmitted: onFieldSubmitted,
validationError: validationError),
if (positionedChild != null)
Positioned(right: 35, top: 5, child: positionedChild)
],
),
);
}
}
Loading…
Cancel
Save