Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into all_special_lab_result
Conflicts: pubspec.lockmerge-requests/839/head
commit
7be6ef6ed6
@ -1,18 +1,22 @@
|
||||
class GetOrderedProcedureRequestModel {
|
||||
String vidaAuthTokenID;
|
||||
int patientMRN;
|
||||
int appointmentNo;
|
||||
|
||||
GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN});
|
||||
GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo});
|
||||
|
||||
GetOrderedProcedureRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
vidaAuthTokenID = json['VidaAuthTokenID'];
|
||||
patientMRN = json['PatientMRN'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
|
||||
data['PatientMRN'] = this.patientMRN;
|
||||
data['AppointmentNo'] = this.appointmentNo;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'doctor_repaly_chat.dart';
|
||||
|
||||
class AllDoctorQuestions extends StatefulWidget {
|
||||
final Function changeCurrentTab;
|
||||
|
||||
const AllDoctorQuestions({Key key, this.changeCurrentTab}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AllDoctorQuestionsState createState() => _AllDoctorQuestionsState();
|
||||
}
|
||||
|
||||
class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
|
||||
|
||||
int pageIndex = 1;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<DoctorReplayViewModel>(
|
||||
onModelReady: (model) {
|
||||
model.getDoctorReply(isLocalBusy: false);
|
||||
},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
appBarTitle: TranslationBase.of(context).replay2,
|
||||
isShowAppBar: false,
|
||||
body: model.listDoctorWorkingHoursTable.isEmpty
|
||||
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
|
||||
: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
||||
child: NotificationListener(
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: model.listDoctorWorkingHoursTable.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) =>
|
||||
DoctorReplayChat(
|
||||
reply:
|
||||
model.listDoctorWorkingHoursTable[
|
||||
index],
|
||||
previousModel: model,
|
||||
),
|
||||
settings: RouteSettings(
|
||||
name: 'DoctorReplayChat'),
|
||||
));
|
||||
},
|
||||
child: DoctorReplyWidget(
|
||||
reply: model
|
||||
.listDoctorWorkingHoursTable[index]),
|
||||
),
|
||||
if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1)
|
||||
DrAppCircularProgressIndeicator()
|
||||
|
||||
],
|
||||
);
|
||||
}),
|
||||
onNotification: (t) {
|
||||
if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 &&
|
||||
model.state != ViewState.BusyLocal) {
|
||||
setState(() {
|
||||
pageIndex++;
|
||||
});
|
||||
model.getDoctorReply(pageIndex: pageIndex);
|
||||
}
|
||||
return;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,185 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_repaly_chat.dart';
|
||||
import 'package:doctor_app_flutter/util/helpers.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_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/dr_app_circular_progress_Indeicator.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'all_doctor_questions.dart';
|
||||
import 'not_replaied_Doctor_Questions.dart';
|
||||
|
||||
/*
|
||||
*@author: Mohammad Aljammal
|
||||
*@Date:28/4/2020
|
||||
*@param:
|
||||
*@return:
|
||||
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
|
||||
*/
|
||||
class DoctorReplyScreen extends StatefulWidget {
|
||||
final Function changeCurrentTab;
|
||||
|
||||
const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DoctorReplyScreenState createState() => _DoctorReplyScreenState();
|
||||
}
|
||||
|
||||
class _DoctorReplyScreenState extends State<DoctorReplyScreen>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
int _activeTab = 0;
|
||||
int pageIndex = 1;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
_tabController.addListener(_handleTabSelection);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
_handleTabSelection() {
|
||||
setState(() {
|
||||
_activeTab = _tabController.index;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
widget.changeCurrentTab();
|
||||
return false;
|
||||
},
|
||||
child: AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).replay2,
|
||||
isShowAppBar: false,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
extendBodyBehindAppBar: false,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(
|
||||
MediaQuery.of(context).size.height * 0.070),
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.070,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.5), //width: 0.7
|
||||
),
|
||||
color: Colors.white),
|
||||
child: Center(
|
||||
child: TabBar(
|
||||
isScrollable: false,
|
||||
controller: _tabController,
|
||||
indicatorColor: Colors.transparent,
|
||||
indicatorWeight: 1.0,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
labelColor: Theme.of(context).primaryColor,
|
||||
labelPadding: EdgeInsets.only(
|
||||
top: 0, left: 0, right: 0, bottom: 0),
|
||||
unselectedLabelColor: Colors.grey[800],
|
||||
tabs: [
|
||||
tabWidget(
|
||||
screenSize,
|
||||
_activeTab == 0,
|
||||
"Not Replied",
|
||||
),
|
||||
tabWidget(
|
||||
screenSize,
|
||||
_activeTab == 1,
|
||||
TranslationBase.of(context).all,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: [
|
||||
NotRepliedDoctorQuestions(),
|
||||
AllDoctorQuestions(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget tabWidget(Size screenSize, bool isActive, String title,
|
||||
{int counter = -1}) {
|
||||
return Center(
|
||||
child: Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration: TextFieldsUtils.containerBorderDecoration(
|
||||
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
|
||||
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
|
||||
borderRadius: 4,
|
||||
borderWidth: 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
title,
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: isActive ? Colors.white : Color(0xFF2B353E),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
if (counter != -1)
|
||||
Container(
|
||||
margin: EdgeInsets.all(4),
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: isActive ? Colors.white : Color(0xFFD02127),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: FittedBox(
|
||||
child: AppText(
|
||||
"$counter",
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: !isActive ? Colors.white : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/screens/doctor/doctor_replay/doctor_reply_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'doctor_repaly_chat.dart';
|
||||
|
||||
class NotRepliedDoctorQuestions extends StatefulWidget {
|
||||
final Function changeCurrentTab;
|
||||
|
||||
const NotRepliedDoctorQuestions({Key key, this.changeCurrentTab})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_NotRepliedDoctorQuestionsState createState() =>
|
||||
_NotRepliedDoctorQuestionsState();
|
||||
}
|
||||
|
||||
class _NotRepliedDoctorQuestionsState extends State<NotRepliedDoctorQuestions> {
|
||||
int pageIndex = 1;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<DoctorReplayViewModel>(
|
||||
onModelReady: (model) {
|
||||
model.getDoctorReply(isLocalBusy: false, isGettingNotReply: true);
|
||||
},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
appBarTitle: TranslationBase.of(context).replay2,
|
||||
isShowAppBar: false,
|
||||
body: model.listDoctorNotRepliedQuestions.isEmpty
|
||||
? ErrorMessage(error: TranslationBase.of(context).noItem)
|
||||
: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
||||
child: NotificationListener(
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount:
|
||||
model.listDoctorNotRepliedQuestions.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) =>
|
||||
DoctorReplayChat(
|
||||
reply: model
|
||||
.listDoctorNotRepliedQuestions[
|
||||
index],
|
||||
previousModel: model,
|
||||
),
|
||||
settings: RouteSettings(
|
||||
name: 'DoctorReplayChat'),
|
||||
));
|
||||
},
|
||||
child: DoctorReplyWidget(
|
||||
reply:
|
||||
model.listDoctorNotRepliedQuestions[
|
||||
index]),
|
||||
),
|
||||
if (model.state == ViewState.BusyLocal &&
|
||||
index ==
|
||||
model.listDoctorNotRepliedQuestions
|
||||
.length -
|
||||
1)
|
||||
DrAppCircularProgressIndeicator()
|
||||
],
|
||||
);
|
||||
}),
|
||||
onNotification: (t) {
|
||||
if (t is ScrollUpdateNotification &&
|
||||
t.metrics.pixels >=
|
||||
t.metrics.maxScrollExtent - 50 &&
|
||||
model.state != ViewState.BusyLocal) {
|
||||
setState(() {
|
||||
pageIndex++;
|
||||
});
|
||||
model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true);
|
||||
}
|
||||
return;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,111 +0,0 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/doctor/doctor_repaly_chat.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/doctor/doctor_reply_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/dr_app_circular_progress_Indeicator.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/*
|
||||
*@author: Mohammad Aljammal
|
||||
*@Date:28/4/2020
|
||||
*@param:
|
||||
*@return:
|
||||
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
|
||||
*/
|
||||
class DoctorReplyScreen extends StatefulWidget {
|
||||
final Function changeCurrentTab;
|
||||
|
||||
const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DoctorReplyScreenState createState() => _DoctorReplyScreenState();
|
||||
}
|
||||
|
||||
class _DoctorReplyScreenState extends State<DoctorReplyScreen> {
|
||||
int pageIndex = 1;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<DoctorReplayViewModel>(
|
||||
onModelReady: (model) {
|
||||
model.getDoctorReply(isLocalBusy: false);
|
||||
},
|
||||
builder: (_, model, w) => WillPopScope(
|
||||
onWillPop: () async {
|
||||
widget.changeCurrentTab();
|
||||
return false;
|
||||
},
|
||||
child: AppScaffold(
|
||||
baseViewModel: model,
|
||||
appBarTitle: TranslationBase.of(context).replay2,
|
||||
isShowAppBar: false,
|
||||
body: model.listDoctorWorkingHoursTable.isEmpty
|
||||
? DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
|
||||
: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
||||
child: NotificationListener(
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: model.listDoctorWorkingHoursTable.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) =>
|
||||
DoctorReplayChat(
|
||||
reply:
|
||||
model.listDoctorWorkingHoursTable[
|
||||
index],
|
||||
previousModel: model,
|
||||
),
|
||||
settings: RouteSettings(
|
||||
name: 'DoctorReplayChat'),
|
||||
));
|
||||
},
|
||||
child: DoctorReplyWidget(
|
||||
reply: model
|
||||
.listDoctorWorkingHoursTable[index]),
|
||||
),
|
||||
if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1)
|
||||
DrAppCircularProgressIndeicator()
|
||||
|
||||
],
|
||||
);
|
||||
}),
|
||||
onNotification: (t) {
|
||||
if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 &&
|
||||
model.state != ViewState.BusyLocal) {
|
||||
setState(() {
|
||||
pageIndex++;
|
||||
});
|
||||
model.getDoctorReply(pageIndex: pageIndex);
|
||||
}
|
||||
return;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/referral_view_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/doctor/my_referral_patient_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../widgets/shared/app_scaffold_widget.dart';
|
||||
|
||||
class MyReferralPatient extends StatefulWidget {
|
||||
int expandedItemIndex = -1;
|
||||
|
||||
@override
|
||||
_MyReferralPatientState createState() => _MyReferralPatientState();
|
||||
}
|
||||
|
||||
class _MyReferralPatientState extends State<MyReferralPatient> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<ReferralPatientViewModel>(
|
||||
onModelReady: (model) => model.getMyReferralPatient(),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
appBarTitle: TranslationBase.of(context).myReferralPatient,
|
||||
body: model.listMyReferralPatientModel.length == 0
|
||||
? Center(
|
||||
child: AppText(
|
||||
TranslationBase.of(context).errorNoSchedule,
|
||||
color: Theme.of(context).errorColor,
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
...List.generate(
|
||||
model.listMyReferralPatientModel.length,
|
||||
(index) => MyReferralPatientWidget(
|
||||
myReferralPatientModel: model
|
||||
.listMyReferralPatientModel[index],
|
||||
model: model,
|
||||
expandClick: () {
|
||||
setState(() {
|
||||
if (widget.expandedItemIndex ==
|
||||
index) {
|
||||
widget.expandedItemIndex = -1;
|
||||
} else {
|
||||
widget.expandedItemIndex = index;
|
||||
}
|
||||
});
|
||||
},
|
||||
isExpand:
|
||||
widget.expandedItemIndex == index,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -1,213 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../../routes.dart';
|
||||
|
||||
class InPatientPage extends StatefulWidget {
|
||||
final bool isMyInPatient;
|
||||
final PatientSearchViewModel patientSearchViewModel;
|
||||
|
||||
InPatientPage(this.isMyInPatient, this.patientSearchViewModel);
|
||||
|
||||
@override
|
||||
_InPatientPageState createState() => _InPatientPageState();
|
||||
}
|
||||
|
||||
class _InPatientPageState extends State<InPatientPage> {
|
||||
|
||||
TextEditingController _searchController = TextEditingController();
|
||||
|
||||
bool isSortDes = false;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_searchController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
baseViewModel: widget.patientSearchViewModel,
|
||||
isShowAppBar: false,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height * 0.070,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(16.0),
|
||||
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) {
|
||||
widget.patientSearchViewModel.filterSearchResults(value);
|
||||
}),
|
||||
|
||||
Positioned(
|
||||
right: 35,
|
||||
top:5,
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
isSortDes
|
||||
? FontAwesomeIcons.sortAmountDown
|
||||
: FontAwesomeIcons.sortAmountUp,
|
||||
color: Colors.black,
|
||||
),
|
||||
iconSize: 20,
|
||||
// padding: EdgeInsets.only(bottom: 30),
|
||||
onPressed: () {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
widget.patientSearchViewModel.sortInPatient(isDes: isSortDes);
|
||||
isSortDes = !isSortDes;
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
widget.patientSearchViewModel.state == ViewState.Idle?widget.patientSearchViewModel.filteredInPatientItems.length > 0
|
||||
? (widget.isMyInPatient && widget.patientSearchViewModel.myIinPatientList.length ==0 )?NoData():Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
...List.generate(
|
||||
widget.patientSearchViewModel.filteredInPatientItems.length, (index) {
|
||||
if (!widget.isMyInPatient)
|
||||
return PatientCard(
|
||||
patientInfo:
|
||||
widget.patientSearchViewModel.filteredInPatientItems[index],
|
||||
patientType: "1",
|
||||
arrivalType: "1",
|
||||
isInpatient: true,
|
||||
isMyPatient: widget.patientSearchViewModel.filteredInPatientItems[index]
|
||||
.doctorId ==
|
||||
widget.patientSearchViewModel.doctorProfile.doctorID,
|
||||
onTap: () {
|
||||
FocusScopeNode currentFocus =
|
||||
FocusScope.of(context);
|
||||
if (!currentFocus.hasPrimaryFocus) {
|
||||
currentFocus.unfocus();
|
||||
}
|
||||
|
||||
Navigator.of(context).pushNamed(
|
||||
PATIENTS_PROFILE,
|
||||
arguments: {
|
||||
"patient": widget.patientSearchViewModel.
|
||||
filteredInPatientItems[index],
|
||||
"patientType": "1",
|
||||
"from": "0",
|
||||
"to": "0",
|
||||
"isSearch": false,
|
||||
"isInpatient": true,
|
||||
"arrivalType": "1",
|
||||
"isMyPatient":widget.patientSearchViewModel.filteredInPatientItems[index]
|
||||
.doctorId ==
|
||||
widget.patientSearchViewModel.doctorProfile.doctorID,
|
||||
});
|
||||
},
|
||||
);
|
||||
else if (widget.patientSearchViewModel.filteredInPatientItems[index]
|
||||
.doctorId ==
|
||||
widget.patientSearchViewModel.doctorProfile.doctorID &&
|
||||
widget.isMyInPatient)
|
||||
return PatientCard(
|
||||
patientInfo:
|
||||
widget.patientSearchViewModel.filteredInPatientItems[index],
|
||||
patientType: "1",
|
||||
arrivalType: "1",
|
||||
isInpatient: true,
|
||||
isMyPatient: widget.patientSearchViewModel
|
||||
.filteredInPatientItems[index]
|
||||
.doctorId ==
|
||||
widget.patientSearchViewModel.doctorProfile.doctorID,
|
||||
onTap: () {
|
||||
FocusScopeNode currentFocus =
|
||||
FocusScope.of(context);
|
||||
if (!currentFocus.hasPrimaryFocus) {
|
||||
currentFocus.unfocus();
|
||||
}
|
||||
|
||||
Navigator.of(context).pushNamed(
|
||||
PATIENTS_PROFILE,
|
||||
arguments: {
|
||||
"patient": widget.patientSearchViewModel.filteredInPatientItems[index],
|
||||
"patientType": "1",
|
||||
"from": "0",
|
||||
"to": "0",
|
||||
"isSearch": false,
|
||||
"isInpatient": true,
|
||||
"arrivalType": "1",
|
||||
"isMyPatient":widget.patientSearchViewModel.filteredInPatientItems[index]
|
||||
.doctorId ==
|
||||
widget.patientSearchViewModel.doctorProfile.doctorID,
|
||||
});
|
||||
},
|
||||
);
|
||||
else
|
||||
return SizedBox();
|
||||
}),
|
||||
SizedBox(
|
||||
height: 15,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: NoData(): Center(
|
||||
child: Container(
|
||||
height: 300,
|
||||
width: 300,
|
||||
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NoData extends StatelessWidget {
|
||||
const NoData({
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: ErrorMessage(
|
||||
error:
|
||||
TranslationBase.of(context).noDataAvailable)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class InPatientHeader extends StatelessWidget with PreferredSizeWidget{
|
||||
const InPatientHeader() : super();
|
||||
|
||||
@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(
|
||||
TranslationBase
|
||||
.of(context)
|
||||
.inPatient,
|
||||
fontSize: SizeConfig.textMultiplier * 2.8,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF2B353E),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Size get preferredSize => Size(double.maxFinite,85);
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class NoData extends StatelessWidget {
|
||||
const NoData({
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: ErrorMessage(
|
||||
error: TranslationBase.of(context).noDataAvailable)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,311 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import 'NoData.dart';
|
||||
import 'list_of_all_in_patient.dart';
|
||||
import 'list_of_my_inpatient.dart';
|
||||
|
||||
class InPatientListPage extends StatefulWidget {
|
||||
final bool isMyInPatient;
|
||||
final PatientSearchViewModel patientSearchViewModel;
|
||||
|
||||
InPatientListPage(this.isMyInPatient, this.patientSearchViewModel);
|
||||
|
||||
@override
|
||||
_InPatientListPageState createState() => _InPatientListPageState();
|
||||
}
|
||||
|
||||
class _InPatientListPageState extends State<InPatientListPage> {
|
||||
TextEditingController _searchController = TextEditingController();
|
||||
|
||||
bool isSortDes = false;
|
||||
bool isAllClinic = true;
|
||||
bool hasQuery = false;
|
||||
bool showBottomSheet = false;
|
||||
String selectedClinicName;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_searchController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
baseViewModel: widget.patientSearchViewModel,
|
||||
isShowAppBar: false,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (!widget.isMyInPatient)
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 10.0, right: 10, top: 10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 1,
|
||||
groupValue: isAllClinic ? 1 : 2,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
setState(() {
|
||||
isAllClinic = true;
|
||||
showBottomSheet = false;
|
||||
selectedClinicName = null;
|
||||
});
|
||||
widget.patientSearchViewModel
|
||||
.setDefaultInPatientList();
|
||||
});
|
||||
},
|
||||
activeColor: Colors.red,
|
||||
),
|
||||
AppText(
|
||||
"${TranslationBase.of(context).allClinic}",
|
||||
fontSize: 15,
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isAllClinic = true;
|
||||
selectedClinicName = null;
|
||||
showBottomSheet = false;
|
||||
});
|
||||
widget.patientSearchViewModel.setDefaultInPatientList();
|
||||
},
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
|
||||
if (widget.patientSearchViewModel.InpatientClinicList
|
||||
.length >
|
||||
0) showBottomSheet = true;
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 2,
|
||||
groupValue: isAllClinic ? 1 : 2,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
setState(() {
|
||||
if (widget.patientSearchViewModel
|
||||
.InpatientClinicList.length >
|
||||
0) showBottomSheet = true;
|
||||
});
|
||||
});
|
||||
},
|
||||
activeColor: Colors.red,
|
||||
),
|
||||
AppText(
|
||||
selectedClinicName ?? TranslationBase.of(context).clinicSelect,
|
||||
fontSize: 15,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 10),
|
||||
child: Icon(FontAwesomeIcons.sortDown))
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 16,
|
||||
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(() {
|
||||
hasQuery = true;
|
||||
});
|
||||
widget.patientSearchViewModel.filterSearchResults(value,
|
||||
isAllClinic: isAllClinic,
|
||||
isMyInPatient: widget.isMyInPatient);
|
||||
}),
|
||||
Positioned(
|
||||
right: 35,
|
||||
top: 5,
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
isSortDes
|
||||
? FontAwesomeIcons.sortAmountDown
|
||||
: FontAwesomeIcons.sortAmountUp,
|
||||
color: Colors.black,
|
||||
),
|
||||
iconSize: 20,
|
||||
// padding: EdgeInsets.only(bottom: 30),
|
||||
onPressed: () {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
widget.patientSearchViewModel.sortInPatient(
|
||||
isDes: isSortDes,
|
||||
isAllClinic: isAllClinic,
|
||||
isMyInPatient: widget.isMyInPatient);
|
||||
isSortDes = !isSortDes;
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
widget.patientSearchViewModel.state == ViewState.Idle
|
||||
? (widget.isMyInPatient &&
|
||||
widget.patientSearchViewModel.myIinPatientList.length > 0)
|
||||
? ListOfMyInpatient(
|
||||
isAllClinic: isAllClinic,
|
||||
hasQuery: hasQuery,
|
||||
patientSearchViewModel: widget.patientSearchViewModel)
|
||||
: widget.patientSearchViewModel.filteredInPatientItems
|
||||
.length >
|
||||
0
|
||||
? (widget.isMyInPatient &&
|
||||
widget.patientSearchViewModel.myIinPatientList
|
||||
.length ==
|
||||
0)
|
||||
? NoData()
|
||||
: ListOfAllInPatient(
|
||||
isAllClinic: isAllClinic,
|
||||
hasQuery: hasQuery,
|
||||
patientSearchViewModel:
|
||||
widget.patientSearchViewModel)
|
||||
: NoData()
|
||||
: Center(
|
||||
child: Container(
|
||||
height: 300,
|
||||
width: 300,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
bottomSheet: !showBottomSheet
|
||||
? Container(
|
||||
height: 0,
|
||||
)
|
||||
: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey, width: 0.5),
|
||||
color: Colors.white,
|
||||
),
|
||||
height: MediaQuery.of(context).size.height * 0.5,
|
||||
padding: EdgeInsets.only(top: 13, left: 10, right: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
showBottomSheet = false;
|
||||
});
|
||||
},
|
||||
child: Icon(DoctorApp.close_1,
|
||||
size: SizeConfig.getTextMultiplierBasedOnWidth() *
|
||||
4.5,
|
||||
color: Color(0xFF2B353E)))
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
AppText(
|
||||
"${TranslationBase.of(context).clinicSelect} :",
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 18,
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: widget
|
||||
.patientSearchViewModel.InpatientClinicList.length,
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isAllClinic = false;
|
||||
showBottomSheet = false;
|
||||
selectedClinicName = widget
|
||||
.patientSearchViewModel
|
||||
.InpatientClinicList[index];
|
||||
});
|
||||
widget.patientSearchViewModel.filterByClinic(
|
||||
clinicName: widget.patientSearchViewModel
|
||||
.InpatientClinicList[index]);
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: widget.patientSearchViewModel
|
||||
.InpatientClinicList[index],
|
||||
groupValue: selectedClinicName,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
setState(() {
|
||||
isAllClinic = false;
|
||||
showBottomSheet = false;
|
||||
selectedClinicName = widget
|
||||
.patientSearchViewModel
|
||||
.InpatientClinicList[index];
|
||||
});
|
||||
widget.patientSearchViewModel
|
||||
.filterByClinic(clinicName: value);
|
||||
});
|
||||
},
|
||||
activeColor: Colors.red,
|
||||
),
|
||||
AppText(
|
||||
widget.patientSearchViewModel
|
||||
.InpatientClinicList[index],
|
||||
fontFamily: 'Poppins',
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 15,
|
||||
),
|
||||
],
|
||||
));
|
||||
}),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,273 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/In_patient/InPatientHeader.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_toast_msg.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_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../DischargedPatientPage.dart';
|
||||
import 'in_patient_list_page.dart';
|
||||
|
||||
class InPatientScreen extends StatefulWidget {
|
||||
GetSpecialClinicalCareListResponseModel specialClinic;
|
||||
|
||||
InPatientScreen({Key key, this.specialClinic});
|
||||
|
||||
@override
|
||||
_InPatientScreenState createState() => _InPatientScreenState();
|
||||
}
|
||||
|
||||
class _InPatientScreenState extends State<InPatientScreen>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
int _activeTab = 0;
|
||||
|
||||
int selectedMapId;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 3, vsync: this);
|
||||
_tabController.addListener(_handleTabSelection);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
_handleTabSelection() {
|
||||
setState(() {
|
||||
_activeTab = _tabController.index;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
|
||||
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
|
||||
|
||||
return BaseView<PatientSearchViewModel>(
|
||||
onModelReady: (model) async {
|
||||
model.clearPatientList();
|
||||
if (widget.specialClinic != null) {
|
||||
await model
|
||||
.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID);
|
||||
requestModel.nursingStationID =
|
||||
model.specialClinicalCareMappingList[0].nursingStationID;
|
||||
}
|
||||
requestModel.clinicID = 0;
|
||||
await model.getInPatientList(requestModel);
|
||||
},
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: true,
|
||||
appBar: InPatientHeader(),
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (model.specialClinicalCareMappingList.isNotEmpty &&
|
||||
widget.specialClinic != null &&
|
||||
_activeTab != 2)
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * .3,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
dropdownColor: Colors.white,
|
||||
iconEnabledColor: Colors.black,
|
||||
isExpanded: true,
|
||||
value: selectedMapId == null
|
||||
? model.specialClinicalCareMappingList[0].nursingStationID
|
||||
: selectedMapId,
|
||||
iconSize: 25,
|
||||
elevation: 16,
|
||||
selectedItemBuilder: (BuildContext context) {
|
||||
return model.specialClinicalCareMappingList.map((item) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(2),
|
||||
margin: EdgeInsets.all(2),
|
||||
decoration: new BoxDecoration(
|
||||
color: Colors.red[800],
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 20,
|
||||
minHeight: 20,
|
||||
),
|
||||
child: Center(
|
||||
child: AppText(
|
||||
model
|
||||
.specialClinicalCareMappingList.length
|
||||
.toString(),
|
||||
color: Colors.white,
|
||||
fontSize:
|
||||
projectsProvider.isArabic ? 10 : 11,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
AppText(item.description,
|
||||
fontSize: 12,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
textAlign: TextAlign.end),
|
||||
],
|
||||
);
|
||||
}).toList();
|
||||
},
|
||||
onChanged: (newValue) async {
|
||||
setState(() {
|
||||
selectedMapId = newValue;
|
||||
});
|
||||
model.clearPatientList();
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
|
||||
PatientSearchRequestModel requestModel =
|
||||
PatientSearchRequestModel(
|
||||
nursingStationID: selectedMapId, clinicID: 0);
|
||||
await model.getInPatientList(requestModel,
|
||||
isLocalBusy: true);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
if (model.state == ViewState.ErrorLocal) {
|
||||
DrAppToastMsg.showErrorToast(model.error);
|
||||
}
|
||||
},
|
||||
items: model.specialClinicalCareMappingList.map((item) {
|
||||
return DropdownMenuItem(
|
||||
child: AppText(
|
||||
item.description,
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
value: item.nursingStationID,
|
||||
);
|
||||
}).toList(),
|
||||
)),
|
||||
),
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
extendBodyBehindAppBar: false,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(
|
||||
MediaQuery.of(context).size.height * 0.070),
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.070,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.5), //width: 0.7
|
||||
),
|
||||
color: Colors.white),
|
||||
child: Center(
|
||||
child: TabBar(
|
||||
isScrollable: false,
|
||||
controller: _tabController,
|
||||
indicatorColor: Colors.transparent,
|
||||
indicatorWeight: 1.0,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
labelColor: Theme.of(context).primaryColor,
|
||||
labelPadding: EdgeInsets.only(
|
||||
top: 0, left: 0, right: 0, bottom: 0),
|
||||
unselectedLabelColor: Colors.grey[800],
|
||||
tabs: [
|
||||
tabWidget(screenSize, _activeTab == 0,
|
||||
TranslationBase.of(context).inPatientAll,
|
||||
counter: model.inPatientList.length),
|
||||
tabWidget(screenSize, _activeTab == 1,
|
||||
TranslationBase.of(context).myInPatientTitle,
|
||||
counter: model.myIinPatientList.length),
|
||||
tabWidget(screenSize, _activeTab == 2,
|
||||
TranslationBase.of(context).discharged),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: [
|
||||
InPatientListPage(false, model),
|
||||
InPatientListPage(true, model),
|
||||
DischargedPatient(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget tabWidget(Size screenSize, bool isActive, String title,
|
||||
{int counter = -1}) {
|
||||
return Center(
|
||||
child: Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration: TextFieldsUtils.containerBorderDecoration(
|
||||
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
|
||||
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
|
||||
borderRadius: 4,
|
||||
borderWidth: 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
title,
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: isActive ? Colors.white : Color(0xFF2B353E),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
if (counter != -1)
|
||||
Container(
|
||||
margin: EdgeInsets.all(4),
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: isActive ? Colors.white : Color(0xFFD02127),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: FittedBox(
|
||||
child: AppText(
|
||||
"$counter",
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: !isActive ? Colors.white : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../routes.dart';
|
||||
import 'NoData.dart';
|
||||
|
||||
class ListOfAllInPatient extends StatelessWidget {
|
||||
const ListOfAllInPatient({
|
||||
Key key,
|
||||
@required this.isAllClinic,
|
||||
@required this.hasQuery,
|
||||
this.patientSearchViewModel,
|
||||
}) : super(key: key);
|
||||
|
||||
final bool isAllClinic;
|
||||
final bool hasQuery;
|
||||
|
||||
|
||||
final PatientSearchViewModel patientSearchViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: patientSearchViewModel.filteredInPatientItems.length == 0
|
||||
? NoData()
|
||||
: NotificationListener(
|
||||
child: ListView.builder(
|
||||
itemCount:
|
||||
patientSearchViewModel.filteredInPatientItems.length,
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return PatientCard(
|
||||
patientInfo: patientSearchViewModel
|
||||
.filteredInPatientItems[index],
|
||||
patientType: "1",
|
||||
arrivalType: "1",
|
||||
isInpatient: true,
|
||||
isMyPatient: patientSearchViewModel
|
||||
.filteredInPatientItems[index].doctorId ==
|
||||
patientSearchViewModel.doctorProfile.doctorID,
|
||||
onTap: () {
|
||||
FocusScopeNode currentFocus = FocusScope.of(context);
|
||||
if (!currentFocus.hasPrimaryFocus) {
|
||||
currentFocus.unfocus();
|
||||
}
|
||||
|
||||
Navigator.of(context)
|
||||
.pushNamed(PATIENTS_PROFILE, arguments: {
|
||||
"patient": patientSearchViewModel
|
||||
.filteredInPatientItems[index],
|
||||
"patientType": "1",
|
||||
"from": "0",
|
||||
"to": "0",
|
||||
"isSearch": false,
|
||||
"isInpatient": true,
|
||||
"arrivalType": "1",
|
||||
"isMyPatient": patientSearchViewModel
|
||||
.filteredInPatientItems[index].doctorId ==
|
||||
patientSearchViewModel.doctorProfile.doctorID,
|
||||
});
|
||||
},
|
||||
);
|
||||
}),
|
||||
onNotification: (notification) {
|
||||
if (isAllClinic && !hasQuery) if (notification
|
||||
is ScrollUpdateNotification) {
|
||||
if (notification.metrics.pixels >= notification.metrics.maxScrollExtent - 50) {
|
||||
patientSearchViewModel.addOnFilteredList();
|
||||
}
|
||||
|
||||
if (notification.metrics.pixels <= notification.metrics.minScrollExtent - 50) {
|
||||
patientSearchViewModel.removeOnFilteredList();
|
||||
}
|
||||
}
|
||||
return;
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../routes.dart';
|
||||
import 'NoData.dart';
|
||||
class ListOfMyInpatient extends StatelessWidget {
|
||||
const ListOfMyInpatient({
|
||||
Key key,
|
||||
@required this.isAllClinic,
|
||||
@required this.hasQuery,
|
||||
this.patientSearchViewModel,
|
||||
}) : super(key: key);
|
||||
|
||||
final bool isAllClinic;
|
||||
final bool hasQuery;
|
||||
final PatientSearchViewModel patientSearchViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child:Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: patientSearchViewModel.filteredMyInPatientItems.length == 0
|
||||
? NoData():NotificationListener(
|
||||
child: ListView.builder(
|
||||
itemCount: patientSearchViewModel.filteredMyInPatientItems.length,
|
||||
scrollDirection: Axis.vertical,
|
||||
// physics: ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
return PatientCard(
|
||||
patientInfo: patientSearchViewModel.filteredMyInPatientItems[index],
|
||||
patientType: "1",
|
||||
arrivalType: "1",
|
||||
isInpatient: true,
|
||||
isMyPatient: true,
|
||||
onTap: () {
|
||||
FocusScopeNode currentFocus = FocusScope.of(context);
|
||||
if (!currentFocus.hasPrimaryFocus) {
|
||||
currentFocus.unfocus();
|
||||
}
|
||||
|
||||
Navigator.of(context)
|
||||
.pushNamed(PATIENTS_PROFILE, arguments: {
|
||||
"patient":
|
||||
patientSearchViewModel.filteredMyInPatientItems[index],
|
||||
"patientType": "1",
|
||||
"from": "0",
|
||||
"to": "0",
|
||||
"isSearch": false,
|
||||
"isInpatient": true,
|
||||
"arrivalType": "1",
|
||||
"isMyPatient": true,
|
||||
});
|
||||
},
|
||||
);
|
||||
}),
|
||||
onNotification: (t) {
|
||||
return;
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,329 +0,0 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/dashboard/get_special_clinical_care_List_Respose_Model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_toast_msg.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_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'DischargedPatientPage.dart';
|
||||
import 'InPatientPage.dart';
|
||||
|
||||
class PatientInPatientScreen extends StatefulWidget {
|
||||
GetSpecialClinicalCareListResponseModel specialClinic;
|
||||
|
||||
PatientInPatientScreen({Key key, this.specialClinic});
|
||||
|
||||
@override
|
||||
_PatientInPatientScreenState createState() => _PatientInPatientScreenState();
|
||||
}
|
||||
|
||||
class _PatientInPatientScreenState extends State<PatientInPatientScreen>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
int _activeTab = 0;
|
||||
|
||||
int selectedMapId;
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 3, vsync: this);
|
||||
_tabController.addListener(_handleTabSelection);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
_handleTabSelection() {
|
||||
setState(() {
|
||||
_activeTab = _tabController.index;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final screenSize = MediaQuery
|
||||
.of(context)
|
||||
.size;
|
||||
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
|
||||
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
|
||||
|
||||
|
||||
return BaseView<PatientSearchViewModel>(
|
||||
onModelReady: (model) async {
|
||||
model.clearPatientList();
|
||||
if (widget.specialClinic != null) {
|
||||
await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID);
|
||||
requestModel.nursingStationID =
|
||||
model.specialClinicalCareMappingList[0].nursingStationID;
|
||||
|
||||
}
|
||||
requestModel.clinicID = 0;
|
||||
await model.getInPatientList(requestModel);
|
||||
},
|
||||
builder: (_, model, w) =>
|
||||
AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: false,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
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(
|
||||
TranslationBase
|
||||
.of(context)
|
||||
.inPatient,
|
||||
fontSize: SizeConfig.textMultiplier * 2.8,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF2B353E),
|
||||
),
|
||||
),
|
||||
if (model.specialClinicalCareMappingList.isNotEmpty &&
|
||||
widget.specialClinic != null &&
|
||||
_activeTab != 2)
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * .3,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
dropdownColor: Colors.white,
|
||||
iconEnabledColor: Colors.black,
|
||||
isExpanded: true,
|
||||
value: selectedMapId == null ? model
|
||||
.specialClinicalCareMappingList[0]
|
||||
.nursingStationID : selectedMapId,
|
||||
iconSize: 25,
|
||||
elevation: 16,
|
||||
selectedItemBuilder:
|
||||
(BuildContext context) {
|
||||
return model
|
||||
.specialClinicalCareMappingList
|
||||
.map((item) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Column(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.center,
|
||||
children: [
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.all(2),
|
||||
margin:
|
||||
EdgeInsets.all(2),
|
||||
decoration:
|
||||
new BoxDecoration(
|
||||
color:
|
||||
Colors.red[800],
|
||||
borderRadius:
|
||||
BorderRadius
|
||||
.circular(
|
||||
20),
|
||||
),
|
||||
constraints:
|
||||
BoxConstraints(
|
||||
minWidth: 20,
|
||||
minHeight: 20,
|
||||
),
|
||||
child: Center(
|
||||
child: AppText(
|
||||
model
|
||||
.specialClinicalCareMappingList
|
||||
.length
|
||||
.toString(),
|
||||
color:
|
||||
Colors.white,
|
||||
fontSize:
|
||||
projectsProvider
|
||||
.isArabic
|
||||
? 10
|
||||
: 11,
|
||||
textAlign:
|
||||
TextAlign
|
||||
.center,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
AppText(item.description,
|
||||
fontSize: 12,
|
||||
color: Colors.black,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
textAlign: TextAlign.end),
|
||||
],
|
||||
);
|
||||
}).toList();
|
||||
},
|
||||
onChanged: (newValue) async {
|
||||
setState(() {
|
||||
selectedMapId = newValue;
|
||||
});
|
||||
model.clearPatientList();
|
||||
GifLoaderDialogUtils.showMyDialog(
|
||||
context);
|
||||
|
||||
PatientSearchRequestModel requestModel = PatientSearchRequestModel(
|
||||
nursingStationID: selectedMapId, clinicID: 0);
|
||||
await model.getInPatientList(requestModel, isLocalBusy: true);
|
||||
GifLoaderDialogUtils.hideDialog(
|
||||
context);
|
||||
if (model.state ==
|
||||
ViewState.ErrorLocal) {
|
||||
DrAppToastMsg.showErrorToast(
|
||||
model.error);
|
||||
}
|
||||
},
|
||||
items: model
|
||||
.specialClinicalCareMappingList
|
||||
.map((item) {
|
||||
return DropdownMenuItem(
|
||||
child: AppText(
|
||||
item.description,
|
||||
textAlign: TextAlign.left,
|
||||
),
|
||||
value: item.nursingStationID,
|
||||
);
|
||||
}).toList(),
|
||||
)),
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(
|
||||
MediaQuery.of(context).size.height * 0.070),
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.070,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.5), //width: 0.7
|
||||
),
|
||||
color: Colors.white),
|
||||
child: Center(
|
||||
child: TabBar(
|
||||
isScrollable: false,
|
||||
controller: _tabController,
|
||||
indicatorColor: Colors.transparent,
|
||||
indicatorWeight: 1.0,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
labelColor: Theme.of(context).primaryColor,
|
||||
labelPadding: EdgeInsets.only(
|
||||
top: 0, left: 0, right: 0, bottom: 0),
|
||||
unselectedLabelColor: Colors.grey[800],
|
||||
tabs: [
|
||||
tabWidget(screenSize, _activeTab == 0,
|
||||
TranslationBase.of(context).inPatientAll,
|
||||
counter: model.inPatientList.length),
|
||||
tabWidget(
|
||||
screenSize, _activeTab == 1, TranslationBase.of(context).inPatient,
|
||||
counter: model.myIinPatientList.length),
|
||||
tabWidget(screenSize, _activeTab == 2,
|
||||
TranslationBase.of(context).discharged),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: [
|
||||
InPatientPage(false, model),
|
||||
InPatientPage(true,model),
|
||||
DischargedPatient(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget tabWidget(Size screenSize, bool isActive, String title,
|
||||
{int counter = -1}) {
|
||||
return Center(
|
||||
child: Container(
|
||||
height: screenSize.height * 0.070,
|
||||
decoration: TextFieldsUtils.containerBorderDecoration(
|
||||
isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA),
|
||||
isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
|
||||
borderRadius: 4,
|
||||
borderWidth: 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
title,
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: isActive ? Colors.white : Color(0xFF2B353E),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
if (counter != -1)
|
||||
Container(
|
||||
margin: EdgeInsets.all(4),
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: BoxDecoration(
|
||||
color: isActive ? Colors.white : Color(0xFFD02127),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: FittedBox(
|
||||
child: AppText(
|
||||
"$counter",
|
||||
fontSize: SizeConfig.textMultiplier * 1.5,
|
||||
color: !isActive ? Colors.white : Color(0xFFD02127),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,214 @@
|
||||
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/screens/patients/profile/UCAF/page-stepper-widget.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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/buttons/app_buttons_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../routes.dart';
|
||||
import 'UCAF-detail-screen.dart';
|
||||
import 'UCAF-input-screen.dart';
|
||||
|
||||
class UCAFPagerScreen extends StatefulWidget {
|
||||
const UCAFPagerScreen({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_UCAFPagerScreenState createState() => _UCAFPagerScreenState();
|
||||
}
|
||||
|
||||
class _UCAFPagerScreenState extends State<UCAFPagerScreen>
|
||||
with TickerProviderStateMixin {
|
||||
PageController _controller;
|
||||
int _currentIndex = 0;
|
||||
bool _isLoading = true;
|
||||
|
||||
PatiantInformtion patient;
|
||||
String patientType;
|
||||
String arrivalType;
|
||||
|
||||
changePageViewIndex(pageIndex, {isChangeState = true}) {
|
||||
if (pageIndex != _currentIndex && isChangeState) changeLoadingState(true);
|
||||
_controller.jumpToPage(pageIndex);
|
||||
setState(() {
|
||||
_currentIndex = pageIndex;
|
||||
});
|
||||
}
|
||||
|
||||
void changeLoadingState(bool isLoading) {
|
||||
setState(() {
|
||||
_isLoading = isLoading;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_controller = new PageController();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
patient = routeArgs['patient'];
|
||||
patientType = routeArgs['patientType'];
|
||||
arrivalType = routeArgs['arrivalType'];
|
||||
|
||||
final screenSize = MediaQuery.of(context).size;
|
||||
|
||||
return BaseView<UcafViewModel>(
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
isLoading: _isLoading,
|
||||
appBar: PatientProfileAppBar(patient),
|
||||
appBarTitle: TranslationBase.of(context).ucaf,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// PatientHeaderWidgetNoAvatar(patient),
|
||||
Container(
|
||||
margin: EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"${TranslationBase.of(context).patient}",
|
||||
fontFamily: 'Poppins',
|
||||
fontSize: SizeConfig.textMultiplier * 1.6,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
AppText(
|
||||
"${TranslationBase.of(context).ucaf}",
|
||||
fontFamily: 'Poppins',
|
||||
fontSize: SizeConfig.textMultiplier * 3,
|
||||
fontWeight: FontWeight.bold,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
PageStepperWidget(
|
||||
stepsCount: 2,
|
||||
currentStepIndex: _currentIndex + 1,
|
||||
screenSize: screenSize,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: PageView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: _controller,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
UCAFInputScreen(
|
||||
patient,
|
||||
changeLoadingState: changeLoadingState,
|
||||
),
|
||||
UcafDetailScreen(
|
||||
patient,
|
||||
model,
|
||||
changeLoadingState: changeLoadingState,
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
_isLoading
|
||||
? Container(
|
||||
height: 0,
|
||||
)
|
||||
: ucafButtons(model),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
Widget ucafButtons(UcafViewModel model) {
|
||||
switch (_currentIndex) {
|
||||
case 0:
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: AppButton(
|
||||
title: TranslationBase.of(context).next,
|
||||
color: Color(0xFFD02127),
|
||||
onPressed: () {
|
||||
changePageViewIndex(1);
|
||||
// Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: {
|
||||
// 'patient': patient,
|
||||
// 'patientType': patientType,
|
||||
// 'arrivalType': arrivalType
|
||||
// });
|
||||
},
|
||||
),
|
||||
);
|
||||
case 1:
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: AppButton(
|
||||
title: TranslationBase.of(context).cancel,
|
||||
hasBorder: true,
|
||||
vPadding: 8,
|
||||
hPadding: 8,
|
||||
borderColor: Colors.white,
|
||||
color: Colors.white,
|
||||
fontColor: Color(0xFFB8382B),
|
||||
fontSize: 2.2,
|
||||
onPressed: () {
|
||||
Navigator.of(context).popUntil((route) {
|
||||
return route.settings.name == PATIENTS_PROFILE;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: AppButton(
|
||||
title: TranslationBase.of(context).save,
|
||||
hasBorder: true,
|
||||
vPadding: 8,
|
||||
hPadding: 8,
|
||||
borderColor: Color(0xFFB8382B),
|
||||
color: Color(0xFFB8382B),
|
||||
fontColor: Colors.white,
|
||||
fontSize: 2.0,
|
||||
onPressed: () {
|
||||
model.saveUCAFOnTap();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
default:
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue