|
|
|
|
@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/patients/PatientCard.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
@ -71,32 +72,35 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
tabsBar(context, screenSize, model),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(16.0),
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.searchPatientName,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
),
|
|
|
|
|
controller: _searchController,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
model.filterSearchResults(value);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
model.filteredInPatientItems.length > 0
|
|
|
|
|
? Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(16.0),
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 16.0),
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.searchPatientName,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
),
|
|
|
|
|
controller: _searchController,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
model.filterSearchResults(value);
|
|
|
|
|
}),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
// height: 16,
|
|
|
|
|
// ),
|
|
|
|
|
...model.filteredInPatientItems.map((item) {
|
|
|
|
|
return PatientCard(
|
|
|
|
|
patientInfo: item,
|
|
|
|
|
@ -104,6 +108,11 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
|
|
|
|
|
arrivalType: "1",
|
|
|
|
|
isInpatient: true,
|
|
|
|
|
onTap: () {
|
|
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
|
|
|
|
if (!currentFocus.hasPrimaryFocus) {
|
|
|
|
|
currentFocus.unfocus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(PATIENTS_PROFILE, arguments: {
|
|
|
|
|
"patient": item,
|
|
|
|
|
@ -122,9 +131,13 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
child: ErrorMessage(
|
|
|
|
|
error: TranslationBase.of(context).noDataAvailable)),
|
|
|
|
|
: Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: ErrorMessage(
|
|
|
|
|
error: TranslationBase.of(context).noDataAvailable)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -155,10 +168,16 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
|
|
|
|
|
setState(() {
|
|
|
|
|
_activeTab = _tabs.indexOf(item);
|
|
|
|
|
});
|
|
|
|
|
// GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
// context);
|
|
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
|
|
|
|
if (!currentFocus.hasPrimaryFocus) {
|
|
|
|
|
currentFocus.unfocus();
|
|
|
|
|
}
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model.getInPatientList(requestModel,
|
|
|
|
|
isMyInpatient: _activeTab == 1);
|
|
|
|
|
isMyInpatient: _activeTab == 1, isFirstTime: false);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context);
|
|
|
|
|
},
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
|