merge-requests/598/head
Elham Rababah 5 years ago
parent 46b4ea25ea
commit 5daadc8369

@ -0,0 +1,39 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class HeaderInSearch extends StatelessWidget {
final String title;
const HeaderInSearch({Key key, this.title}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: 50),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
title,
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
color: Color(0xFF2B353E),
fontFamily: 'Poppins',
),
),
]),
),
);
}
}

@ -294,6 +294,7 @@ class _PatientSearchScreenNewState extends State<PatientSearchScreenNew> {
patientSearchRequestModel: patientSearchRequestModel, patientSearchRequestModel: patientSearchRequestModel,
isSearchWithKeyInfo: isSearchWithKeyInfo:
patientFileInfoController.text.isNotEmpty ? true : false, patientFileInfoController.text.isNotEmpty ? true : false,
isSearch: true,
), ),
), ),
); );

@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; 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/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
@ -41,6 +41,8 @@ class PatientsScreenNew extends StatefulWidget {
final PatientType selectedPatientType; final PatientType selectedPatientType;
final PatientSearchRequestModel patientSearchRequestModel; final PatientSearchRequestModel patientSearchRequestModel;
final bool isSearchWithKeyInfo; final bool isSearchWithKeyInfo;
final bool isSearch;
final bool isInpatient;
PatientsScreenNew( PatientsScreenNew(
{this.patientSearchForm, {this.patientSearchForm,
@ -50,7 +52,9 @@ class PatientsScreenNew extends StatefulWidget {
this.isView, this.isView,
this.selectedPatientType, this.selectedPatientType,
this.patientSearchRequestModel, this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true}); this.isSearchWithKeyInfo = true,
this.isSearch = false,
this.isInpatient = false});
@override @override
_PatientsScreenNewState createState() => _PatientsScreenNewState(); _PatientsScreenNewState createState() => _PatientsScreenNewState();
@ -78,9 +82,7 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
List<String> _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; List<String> _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week'];
int _activeLocation = 0; int _activeLocation = 0;
bool isInpatient = false;
String patientType; String patientType;
bool isSearch = false;
String patientTypeTitle; String patientTypeTitle;
var _isLoading = true; var _isLoading = true;
var selectedFilter = 1; var selectedFilter = 1;
@ -205,144 +207,82 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
appBarTitle: "Search Patient", appBarTitle: "Search Patient",
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: model.patientList.isEmpty body: Container(
? Column(
children: [
Column(children: <Widget>[
SizedBox(
height: 10.0,
),
if (widget.selectedPatientType ==
PatientType.OutPatient &&
!widget.isSearchWithKeyInfo)
Container(
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(10)),
child: ClinicList(
clinicId: clinicId,
onClinicChange: (newValue) {
clinicId = newValue;
changeClinic(newValue, context, model);
},
)),
Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height *
0.03),
// child: _locationBar(context)
child:
(widget.selectedPatientType == PatientType.OutPatient &&
widget.isSearchWithKeyInfo)
? _locationBar(context, model)
: Container(),
)
]),
Container(
margin: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.10),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context)
.youDontHaveAnyPatient),
)
],
),
),
),
],
)
: Container(
color: Colors.grey[200], color: Colors.grey[200],
child: ListView( child: ListView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
children: <Widget>[ children: <Widget>[
Container( Container(
child:model.patientList.isEmpty child: Column(
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Center(
child: Padding(
padding: const EdgeInsets.fromLTRB(
0, 0, 0, 0), //250
child:
DrAppCircularProgressIndeicator(),
)),
),
],
)
: Column(
children: <Widget>[ children: <Widget>[
BottomSheetTitle(title: "Search for 1111",), if(widget.isSearch)
HeaderInSearch(
title: "Search for 1111",
Container( ),
// color: Colors.red, if(!widget.isSearch && !widget.isInpatient)
height: screenSize.height * 0.070, HeaderInSearch(
decoration: TextFieldsUtils.containerBorderDecoration( title: "Search for 1111",
Color(0Xffffffff), Color(0xFFCCCCCC), ),
borderRadius: 4, borderWidth: 0), if(!widget.isInpatient)
child: Row( Container(
mainAxisSize: MainAxisSize.max, // color: Colors.red,
crossAxisAlignment: CrossAxisAlignment.center, height: screenSize.height * 0.070,
children: _locations.map((item) { decoration: TextFieldsUtils
bool _isActive = _locations[_activeLocation] == item ? true : false; .containerBorderDecoration(
Color(0Xffffffff),
return Expanded( Color(0xFFCCCCCC),
child: InkWell( borderRadius: 4,
onTap: () async { borderWidth: 0),
// setState(() { child: Row(
// _activeTab = _locations.indexOf(item); mainAxisSize: MainAxisSize.max,
// }); crossAxisAlignment: CrossAxisAlignment.center,
setState(() { children: _locations.map((item) {
_activeLocation = _locations.indexOf(item); bool _isActive = _locations[_activeLocation] == item
}); ? true
GifLoaderDialogUtils.showMyDialog(context); : false;
await model.getPatientBasedOnDate(item: item,
selectedPatientType: widget.selectedPatientType, return Expanded(
patientSearchRequestModel: widget child: InkWell(
.patientSearchRequestModel, onTap: () async {
isSearchWithKeyInfo: widget.isSearchWithKeyInfo); // setState(() {
GifLoaderDialogUtils.hideDialog(context); // _activeTab = _locations.indexOf(item);
}, // });
child: Center( setState(() {
child: Container( _activeLocation = _locations.indexOf(item);
height: screenSize.height * 0.070, });
decoration: TextFieldsUtils.containerBorderDecoration( GifLoaderDialogUtils.showMyDialog(context);
_isActive await model.getPatientBasedOnDate(item: item,
? Color(0xFFD02127 /*B8382B*/) selectedPatientType: widget.selectedPatientType,
: Color(0xFFEAEAEA), patientSearchRequestModel: widget
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), .patientSearchRequestModel,
borderRadius: 4, isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
borderWidth: 0), GifLoaderDialogUtils.hideDialog(context);
child: Center( },
child: AppText( child: Center(
item, child: Container(
fontSize: SizeConfig.textMultiplier * 1.8, height: screenSize.height * 0.070,
color: _isActive ? Colors.white : Color(0xFF2B353E), decoration: TextFieldsUtils.containerBorderDecoration(
fontWeight: FontWeight.w700, _isActive
? Color(0xFFD02127 /*B8382B*/)
: Color(0xFFEAEAEA),
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
item,
fontSize: SizeConfig.textMultiplier * 1.8,
color: _isActive ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
), ),
), ),
), ),
), ),
), );
); }).toList(),
}).toList(), ),
), ),
),
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( Container(
@ -390,18 +330,6 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context)
.size
.height *
0.03),
// child: _locationBar(context)
child: widget.selectedPatientType ==
PatientType.OutPatient && !widget.isSearchWithKeyInfo
? _locationBar(context, model)
: Container(),
),
SizedBox( SizedBox(
height: 10.0, height: 10.0,
), ),
@ -419,7 +347,7 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
arrivalType: arrivalType:
arrivalType, arrivalType,
isInpatient: isInpatient:
isInpatient, widget.isInpatient,
onTap: () { onTap: () {
// TODO change the parameter to daynamic // TODO change the parameter to daynamic
Navigator.of(context) Navigator.of(context)
@ -432,9 +360,9 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
"from": widget.patientSearchRequestModel.from, "from": widget.patientSearchRequestModel.from,
"to": widget.patientSearchRequestModel.from, "to": widget.patientSearchRequestModel.from,
"isSearch": "isSearch":
isSearch, widget.isSearch,
"isInpatient": "isInpatient":
isInpatient, widget.isInpatient,
"arrivalType": "arrivalType":
"7", "7",
}); });
@ -566,80 +494,4 @@ class _PatientsScreenNewState extends State<PatientsScreenNew> {
Helpers.showErrorToast(err); Helpers.showErrorToast(err);
}); });
} }
//TODO Replace it with time bar.
Widget _locationBar(BuildContext _context, model) {
return Container(
height: MediaQuery.of(context).size.height * 0.0619,
width: SizeConfig.screenWidth * 0.94,
decoration: BoxDecoration(
color: Color(0Xffffffff),
borderRadius: BorderRadius.circular(12.5),
// border: Border.all(
// width: 0.5,
// ),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell(
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.058,
width: SizeConfig.screenWidth * 0.2334,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12.5),
topRight: Radius.circular(12.5),
topLeft: Radius.circular(9.5),
bottomLeft: Radius.circular(9.5)),
color: _isActive ? HexColor("#B8382B") : Colors.white,
),
child: Center(
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
fontWeight: FontWeight.normal,
),
),
)),
),
onTap: () async {
setState(() {
_activeLocation = _locations.indexOf(item);
});
GifLoaderDialogUtils.showMyDialog(context);
await model.getPatientBasedOnDate(item: item,
selectedPatientType: widget.selectedPatientType,
patientSearchRequestModel: widget
.patientSearchRequestModel,
isSearchWithKeyInfo: widget.isSearchWithKeyInfo);
GifLoaderDialogUtils.hideDialog(context);
}),
_isActive
? Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10),
topRight: Radius.circular(10)),
color: Colors.white),
alignment: Alignment.center,
height: 1,
width: SizeConfig.screenWidth * 0.23,
)
: Container()
]);
}).toList(),
),
);
}
} }

Loading…
Cancel
Save