dashboard changes

merge-requests/197/head
Sultan Khan 6 years ago
parent e61f3f0281
commit 8d58348267

@ -96,7 +96,8 @@ var SERVICES_PATIANT = [
"GtMyReferredPatient", "GtMyReferredPatient",
"GtMyDischargeReferralPatient", "GtMyDischargeReferralPatient",
"GtMyTomorrowPatient", "GtMyTomorrowPatient",
"GtMyReferralPatient" "GtMyReferralPatient",
"PatientArrivalList"
]; ];
var SERVICES_PATIANT2 = [ var SERVICES_PATIANT2 = [
"List_MyOutPatient", "List_MyOutPatient",
@ -114,7 +115,8 @@ var SERVICES_PATIANT_HEADER = [
"Referred", "Referred",
"Referral Discharge", "Referral Discharge",
"Tomorrow", "Tomorrow",
"Referral" "Referral",
"Arrived"
]; ];
var SERVICES_PATIANT_HEADER_AR = [ var SERVICES_PATIANT_HEADER_AR = [
"المريض الخارجي", "المريض الخارجي",
@ -123,7 +125,8 @@ var SERVICES_PATIANT_HEADER_AR = [
"المريض المحول الي", "المريض المحول الي",
"المريض المحال المعافى", "المريض المحال المعافى",
"مريض الغد", "مريض الغد",
"المريض المحول مني" "المريض المحول مني",
"وصل المريض"
]; ];
//****************** //******************

@ -305,4 +305,5 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "EXTEND SICK LEAVE", 'en': "EXTEND SICK LEAVE",
'ar': 'قم بتمديد الإجازة المرضية' 'ar': 'قم بتمديد الإجازة المرضية'
}, },
'patient-target': {'en': 'Target Patient', 'ar': 'الهدف المريض'}
}; };

@ -1,20 +1,22 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
// import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
class DashboardService extends BaseService { class DashboardService extends BaseService {
var _dashboardItemsList = []; List<DashboardModel> _dashboardItemsList = [];
get dashboardItemsList => _dashboardItemsList; List<DashboardModel> get dashboardItemsList => _dashboardItemsList;
// DashboardModel _dashboard = DashboardModel(); // DashboardModel _dashboard = DashboardModel();
Future getDashboard() async { Future getDashboard() async {
return Future.value(null); hasError = false;
await baseAppClient.post( await baseAppClient.post(
GET_DASHBOARD, GET_DASHBOARD,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_dashboardItemsList.clear(); _dashboardItemsList.clear();
_dashboardItemsList = response['listDoctorDashboarKPI']; response['listDoctorDashboarKPI'].forEach((v) {
_dashboardItemsList.add(DashboardModel.fromJson(v));
});
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -11,7 +11,7 @@ class SickLeaveService extends BaseService {
List<GetAllSickLeaveResponse> get getAllSickLeave => _getAllsickLeave; List<GetAllSickLeaveResponse> get getAllSickLeave => _getAllsickLeave;
List<GetAllSickLeaveResponse> _getAllsickLeave = []; List<GetAllSickLeaveResponse> _getAllsickLeave = [];
Future getStatistics() async { Future getStatistics(appoNo, patientMRN) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
GET_SICKLEAVE_STATISTIC, GET_SICKLEAVE_STATISTIC,
@ -24,7 +24,7 @@ class SickLeaveService extends BaseService {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, },
body: {"PatientMRN": 3120746, "AppointmentNo": 2016054661}, body: {"PatientMRN": patientMRN, "AppointmentNo": appoNo},
); );
} }

@ -32,9 +32,9 @@ class SickLeaveViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future preSickLeaveStatistics() async { Future preSickLeaveStatistics(appoNo, patientMRN) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _sickLeaveService.getStatistics(); await _sickLeaveService.getStatistics(appoNo, patientMRN);
if (_sickLeaveService.hasError) { if (_sickLeaveService.hasError) {
error = _sickLeaveService.error; error = _sickLeaveService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -19,7 +19,7 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import '../routes.dart'; import '../routes.dart';
import '../widgets/shared/app_texts_widget.dart'; import '../widgets/shared/app_texts_widget.dart';
import 'doctor/doctor_reply_screen.dart'; import 'doctor/doctor_reply_screen.dart';
@ -47,7 +47,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
ProjectProvider projectsProvider; ProjectProvider projectsProvider;
var _isInit = true; var _isInit = true;
DoctorProfileModel profile; DoctorProfileModel profile;
bool isExpanded = false;
String isInpatient = "";
void didChangeDependencies() async { void didChangeDependencies() async {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) { if (_isInit) {
@ -77,7 +78,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
isLoading: isLoading,
body: ListView(children: [ body: ListView(children: [
Column( Column(
children: <Widget>[ children: <Widget>[
@ -211,182 +211,437 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
Container( Container(
color: Colors.white, color: Colors.white,
height: 90, height: this.isExpanded ? 150 : 90,
), ),
], ],
), ),
Positioned( Positioned(
right: 9.0, right: 9.0,
left: 9, left: 9,
bottom: 19, bottom: 15,
child: Container( child: ExpandableCardContainer(
decoration: BoxDecoration( expandedChild: Container(
color: HexColor("#DED8CF"),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
height: 140, height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.22
: MediaQuery.of(context).size.height * 0.25,
width: double.infinity, width: double.infinity,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Divider(),
Padding(
padding: const EdgeInsets.only(
top: 8.0, bottom: 8, right: 40, left: 8),
child: CircularPercentIndicator(
radius: 100,
animation: true,
animationDuration: 1200,
lineWidth: 7.0,
percent: .75,
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
DashboardItem(
onTap: () {
setState(() {
this.isExpanded = false;
});
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
Expanded(
child: Column(
children: [
AppText( AppText(
"38", model.dashboardItemsList
fontSize: SizeConfig.textMultiplier * 3.7, .length >
color: HexColor('#5D4C35'), 0
? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[0]
.value
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[0]
.value
.toString()
: "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 24,
), ),
AppText( AppText(
TranslationBase.of(context).outPatients, model.dashboardItemsList
fontWeight: FontWeight.normal, .length >
fontSize: SizeConfig.textMultiplier * 1.4, 0
color: HexColor('#5D4C35'), ? isInpatient == 'in'
), ? model
.dashboardItemsList[
0]
.summaryoptions[0]
.kPIParameter
: model
.dashboardItemsList[
1]
.summaryoptions[0]
.kPIParameter
: "",
//'My Admitted Patient',
color: Colors.white,
textAlign: TextAlign.center,
fontSize: 12,
)
], ],
), )),
circularStrokeCap: CircularStrokeCap.butt, Expanded(
backgroundColor: Colors.blueGrey[100],
progressColor: HexColor('#B8382C'),
),
),
Container(
child: Table(
defaultColumnWidth: FixedColumnWidth(
MediaQuery.of(context).size.width / 5),
// border: TableBorder.all(
// color: Colors.black26,
// width: 1,
// style: BorderStyle.solid),
border: TableBorder.symmetric(
inside: BorderSide(
width: 0.5,
color: HexColor('#5D4C35'),
),
),
children: [
TableRow(
children: [
TableCell(
child: Center(
child: Column( child: Column(
children: <Widget>[ children: [
InkWell(
child: AppText(
TranslationBase.of(context).arrived,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: HexColor('#5D4C35'),
),
onTap: () {},
),
AppText( AppText(
"23", model.dashboardItemsList
fontSize: .length >
SizeConfig.textMultiplier * 2.7, 0
color: HexColor('#5D4C35'), ? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[1]
.value
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[1]
.value
.toString()
: "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 28,
), ),
SizedBox( AppText(
height: 6, model.dashboardItemsList
), .length >
0
? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[1]
.kPIParameter
: model
.dashboardItemsList[
1]
.summaryoptions[1]
.kPIParameter
: "",
color: Colors.white,
textAlign: TextAlign.center,
fontSize: 12,
)
], ],
),
)), )),
TableCell( Expanded(
child: Column( child: Column(
children: <Widget>[ children: [
AppText( AppText(
TranslationBase.of(context).er, model.dashboardItemsList
fontSize: .length >
SizeConfig.textMultiplier * 1.5, 0
color: HexColor('#5D4C35'), ? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[2]
.value
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[2]
.value
.toString()
: "",
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 28),
AppText(
model.dashboardItemsList
.length >
0
? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[2]
.kPIParameter
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[2]
.kPIParameter
.toString()
: "",
color: Colors.white,
fontSize: 12,
textAlign: TextAlign.center)
],
))
],
), ),
Row(
children: [
Expanded(
child: Column(
children: [
AppText( AppText(
"03", model.dashboardItemsList
fontSize: .length >
SizeConfig.textMultiplier * 2.7, 0
color: HexColor('#5D4C35'), ? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[3]
.value
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[3]
.value
.toString()
: "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), color: Colors.white,
SizedBox( fontSize: 28),
height: 6, AppText(
), model.dashboardItemsList
.length >
0
? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[3]
.kPIParameter
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[3]
.kPIParameter
.toString()
: "",
color: Colors.white,
fontSize: 12,
textAlign: TextAlign.center)
],
)),
Expanded(
child: Column(
children: [
AppText(
model.dashboardItemsList
.length >
0
? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[
4]
.value
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[
4]
.value
.toString()
: "",
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 28),
AppText(
model.dashboardItemsList
.length >
0
? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[
4]
.kPIParameter
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[
4]
.kPIParameter
.toString()
: "",
color: Colors.white,
fontSize: 12,
textAlign: TextAlign.center)
], ],
), ),
), ),
Expanded(
child: Container(),
)
],
)
], ],
// )),
imageName: '5.png',
color: HexColor('#B8382C'),
hasBorder: false,
width: MediaQuery.of(context).size.width * 0.9,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.22
: MediaQuery.of(context).size.height * 0.25,
), ),
TableRow(children: [ ],
TableCell(
child: Column(
children: <Widget>[
SizedBox(
height: 6,
), ),
AppText(
TranslationBase.of(context).notArrived,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: HexColor('#5D4C35'),
), ),
collapsedChild: Container(
margin: EdgeInsets.only(left: 10, right: 10),
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.15
: MediaQuery.of(context).size.height * 0.25,
width: double.infinity,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
DashboardItem(
onTap: () {
setState(() {
this.isExpanded = true;
this.isInpatient = 'in';
});
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText( AppText(
"15", model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[0])
: "",
fontSize: fontSize:
SizeConfig.textMultiplier * 2.7, SizeConfig.textMultiplier * 6,
color: HexColor('#5D4C35'), color: Colors.white,
fontWeight: FontWeight.bold,
), ),
Flexible(
child: AppText(
TranslationBase.of(context).inPatient,
color: Colors.white,
textOverflow: TextOverflow.ellipsis,
)),
], ],
), ),
), Padding(
TableCell( padding: EdgeInsets.all(5),
child: Column( child: Column(
children: <Widget>[ mainAxisAlignment:
SizedBox( MainAxisAlignment.end,
height: 6, children: [
Icon(
DoctorApp.in_patient_white,
size: 35,
color: Colors.white,
)
],
))
],
), ),
AppText(
TranslationBase.of(context).walkIn,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: HexColor('#5D4C35'),
), ),
imageName: '4.png',
color: HexColor('#B8382C'),
hasBorder: false,
width: MediaQuery.of(context).size.width * 0.44,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.15
: MediaQuery.of(context).size.height * 0.25,
),
DashboardItem(
onTap: () {
setState(() {
isExpanded = true;
this.isInpatient = 'out';
});
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText( AppText(
"04", model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[1])
: "",
fontSize: fontSize:
SizeConfig.textMultiplier * 2.7, SizeConfig.textMultiplier * 6,
color: HexColor('#5D4C35'), color: Colors.white,
fontWeight: FontWeight.bold,
), ),
Flexible(
child: AppText(
TranslationBase.of(context)
.outPatients,
color: Colors.white,
textOverflow: TextOverflow.ellipsis,
)),
], ],
), ),
), Padding(
]), padding: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Icon(
DoctorApp.out_patient,
size: 35,
color: Colors.white,
)
],
))
], ],
), ),
), ),
Divider(), imageName: '5.png',
color: HexColor('#B8382C'),
hasBorder: false,
width: MediaQuery.of(context).size.width * 0.44,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.15
: MediaQuery.of(context).size.height * 0.25,
),
], ],
), ),
), ),
) isExpanded: isExpanded,
))
]), ]),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.90, widthFactor: 0.90,
@ -412,16 +667,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 10), // margin: EdgeInsets.only(bottom: 10),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
AppText( AppText(
"08", model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[7])
: "",
fontSize: SizeConfig.textMultiplier * 6, fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white, color: Colors.white,
), ),
AppText( AppText(
TranslationBase.of(context).labResult, TranslationBase.of(context)
.targetPatient,
textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
) )
], ],
@ -449,7 +709,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
AppText( AppText(
"10", model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[6])
: "",
fontSize: SizeConfig.textMultiplier * 6, fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white, color: Colors.white,
), ),
@ -482,7 +745,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
AppText( AppText(
"05", model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[2])
: "",
fontSize: SizeConfig.textMultiplier * 6, fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white, color: Colors.white,
), ),
@ -503,99 +769,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
SizedBox( SizedBox(
height: 15, height: 15,
), ),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
DashboardItem(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
children: <Widget>[
Icon(
DoctorApp.in_patient_white,
size: 40,
color: Colors.white,
),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
AppText(
"14",
fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white,
),
AppText(
TranslationBase.of(context).inPatient,
color: Colors.white,
)
],
)
],
),
),
imageName: '4.png',
color: HexColor('#B8382C'),
hasBorder: false,
width: MediaQuery.of(context).size.width * 0.44,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.13
: MediaQuery.of(context).size.height * 0.25,
),
DashboardItem(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
children: <Widget>[
Icon(
DoctorApp.operations,
size: 40,
color: Colors.white,
),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
AppText(
"07",
fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white,
),
AppText(
TranslationBase.of(context).operations,
color: Colors.white,
)
],
)
],
),
),
imageName: '5.png',
color: HexColor('#B8382C'),
hasBorder: false,
width: MediaQuery.of(context).size.width * 0.44,
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.13
: MediaQuery.of(context).size.height * 0.25,
),
],
),
SizedBox(
height: 15,
),
Row( Row(
children: <Widget>[ children: <Widget>[
AppText( AppText(
@ -909,8 +1082,17 @@ class _DashboardScreenState extends State<DashboardScreen> {
this.isLoading = val; this.isLoading = val;
}); });
} }
getPatientCount(DashboardModel inPatientCount) {
int value = 0;
inPatientCount.summaryoptions.forEach((result) => {value += result.value});
return value.toString();
}
} }
getSummaryResult(item) {}
// TODO Move to it file // TODO Move to it file
class DashboardItem extends StatelessWidget { class DashboardItem extends StatelessWidget {
const DashboardItem( const DashboardItem(
@ -970,3 +1152,28 @@ class DashboardItem extends StatelessWidget {
); );
} }
} }
class ExpandableCardContainer extends StatefulWidget {
final bool isExpanded;
final Widget collapsedChild;
final Widget expandedChild;
const ExpandableCardContainer(
{Key key, this.isExpanded, this.collapsedChild, this.expandedChild})
: super(key: key);
@override
_ExpandableCardContainerState createState() =>
_ExpandableCardContainerState();
}
class _ExpandableCardContainerState extends State<ExpandableCardContainer> {
@override
Widget build(BuildContext context) {
return new AnimatedContainer(
duration: new Duration(milliseconds: 1000),
curve: Curves.easeInOut,
child: widget.isExpanded ? widget.expandedChild : widget.collapsedChild,
);
}
}

@ -246,24 +246,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_locations = [ _locations = [
TranslationBase TranslationBase.of(context).all,
.of(context) TranslationBase.of(context).today,
.all, TranslationBase.of(context).tomorrow,
TranslationBase TranslationBase.of(context).nextWeek,
.of(context)
.today,
TranslationBase
.of(context)
.tomorrow,
TranslationBase
.of(context)
.nextWeek,
]; ];
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
final routeArgs = ModalRoute final routeArgs = ModalRoute.of(context).settings.arguments as Map;
.of(context)
.settings
.arguments as Map;
patient = routeArgs['patientSearchForm']; patient = routeArgs['patientSearchForm'];
@ -300,8 +289,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
}); });
}); });
}, },
builder: (_, model, w) => builder: (_, model, w) => AppScaffold(
AppScaffold(
appBarTitle: patientTypeTitle, appBarTitle: patientTypeTitle,
body: _isLoading body: _isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
@ -309,9 +297,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
? DrAppEmbeddedError(error: error) ? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0 : lItems == null || lItems.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: TranslationBase error:
.of(context) TranslationBase.of(context).youDontHaveAnyPatient)
.youDontHaveAnyPatient)
: Container( : Container(
child: ListView( child: ListView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
@ -350,7 +337,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
SizedBox(height: 18.5), SizedBox(height: 18.5),
Container( Container(
width: SizeConfig.screenWidth * 0.9, width: SizeConfig.screenWidth * 0.9,
height: SizeConfig.screenHeight * 0.05, height:
SizeConfig.screenHeight * 0.05,
child: TextField( child: TextField(
controller: _controller, controller: _controller,
onChanged: (String str) { onChanged: (String str) {
@ -374,12 +362,14 @@ class _PatientsScreenState extends State<PatientsScreen> {
color: Color(0Xffffffff), color: Color(0Xffffffff),
borderRadius: borderRadius:
BorderRadius.circular(20)), BorderRadius.circular(20)),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), margin:
EdgeInsets.fromLTRB(0, 0, 0, 0),
child: (responseModelList.length > 0) child: (responseModelList.length > 0)
? Column( ? Column(
// mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
children: responseModelList.map( children: responseModelList
(PatiantInformtion item) { .map((PatiantInformtion
item) {
return Container( return Container(
decoration: decoration:
myBoxDecoration(), myBoxDecoration(),
@ -390,7 +380,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment MainAxisAlignment
.start, .start,
children: <Widget>[ children: <
Widget>[
Padding( Padding(
padding: EdgeInsets padding: EdgeInsets
.only( .only(
@ -407,8 +398,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
0, 0,
0, 0,
0.08), 0.08),
offset: Offset( offset: Offset(0.0,
0.0,
5.0), 5.0),
blurRadius: blurRadius:
16.0) 16.0)
@ -465,8 +455,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
" " + " " +
item.lastName, item.lastName,
fontSize: fontSize:
2.0 * 2.0 * SizeConfig.textMultiplier,
SizeConfig.textMultiplier,
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
backGroundcolor: backGroundcolor:
@ -482,8 +471,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment CrossAxisAlignment.start,
.start,
children: < children: <
Widget>[ Widget>[
Wrap( Wrap(
@ -520,8 +508,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
height: height:
15.5, 15.5,
), ),
SERVICES_PATIANT2[int.parse(patientType)] == SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
"List_MyOutPatient"
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
@ -562,8 +549,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
), ),
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment CrossAxisAlignment.start,
.start,
// mainAxisAlignment: // mainAxisAlignment:
// MainAxisAlignment // MainAxisAlignment
// .spaceBetween, // .spaceBetween,
@ -617,8 +603,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
height: height:
8, 8,
), ),
SERVICES_PATIANT2[int.parse(patientType)] == SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
"List_MyOutPatient"
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
@ -690,7 +675,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
], ],
), ),
), ),
),); ),
);
} }
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -760,7 +746,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
), ),
), ),
onTap: () { onTap: () {
filterBooking(item.toString()); filterBooking(item.toString());
setState(() { setState(() {

@ -35,9 +35,9 @@ class AddSickLeavScreen extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 4,
child: Row( child: Wrap(
mainAxisAlignment: // mainAxisAlignment:
MainAxisAlignment.start, // MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( Column(
crossAxisAlignment: crossAxisAlignment:
@ -69,11 +69,17 @@ class AddSickLeavScreen extends StatelessWidget {
AppText( AppText(
TranslationBase.of( TranslationBase.of(
context) context)
.leaveStartDate, .leaveStartDate +
' ',
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
), ),
AppText(item.startDate) Flexible(
child: Text(
item.startDate,
overflow:
TextOverflow.ellipsis,
))
], ],
), ),
AppText( AppText(
@ -176,6 +182,8 @@ class AddSickLeavScreen extends StatelessWidget {
builder: (context) { builder: (context) {
return new Container( return new Container(
child: SickLeaveScreen( child: SickLeaveScreen(
appointmentNo: extendedData.appointmentNo,
patientMRN: extendedData.patientMRN,
isExtended: isExtend, isExtended: isExtend,
extendedData: extendedData, extendedData: extendedData,
)); ));

@ -26,7 +26,13 @@ Helpers helpers = Helpers();
class SickLeaveScreen extends StatefulWidget { class SickLeaveScreen extends StatefulWidget {
final bool isExtended; final bool isExtended;
final GetAllSickLeaveResponse extendedData; final GetAllSickLeaveResponse extendedData;
SickLeaveScreen({this.isExtended = false, this.extendedData}); final appointmentNo;
final patientMRN;
SickLeaveScreen(
{this.appointmentNo,
this.patientMRN,
this.isExtended = false,
this.extendedData});
@override @override
_SickLeaveScreenState createState() => _SickLeaveScreenState(); _SickLeaveScreenState createState() => _SickLeaveScreenState();
} }
@ -69,7 +75,8 @@ class _SickLeaveScreenState extends State<SickLeaveScreen> {
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => model.getClinicsList(), onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => BaseView<SickLeaveViewModel>( builder: (_, model, w) => BaseView<SickLeaveViewModel>(
onModelReady: (model2) => model2.preSickLeaveStatistics(), onModelReady: (model2) => model2.preSickLeaveStatistics(
widget.appointmentNo, widget.patientMRN),
builder: (_, model2, w) => AppScaffold( builder: (_, model2, w) => AppScaffold(
baseViewModel: model2, baseViewModel: model2,
isShowAppBar: false, isShowAppBar: false,

@ -336,6 +336,8 @@ class TranslationBase {
String get extend => localizedValues['extend'][locale.languageCode]; String get extend => localizedValues['extend'][locale.languageCode];
String get extendSickLeave => String get extendSickLeave =>
localizedValues['extend-sickleave'][locale.languageCode]; localizedValues['extend-sickleave'][locale.languageCode];
String get targetPatient =>
localizedValues['patient-target'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,11 +1,13 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
import 'package:doctor_app_flutter/screens/patients/out_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient_prescription_details_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'large_avatar.dart'; import 'large_avatar.dart';
@ -18,7 +20,41 @@ class PrescriptionOutPatientWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
child: patientPrescriptionsList.length == 0 child: patientPrescriptionsList.length == 0
? DrAppEmbeddedError(error: 'You don\'t have any Prescriptions') ? Center(
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(40),
decoration: BoxDecoration(
border:
Border.all(color: HexColor('#B8382C'), width: 4),
borderRadius: BorderRadius.all(Radius.circular(100))),
child: IconButton(
icon: Icon(
Icons.add,
size: 35,
),
onPressed: () {
openAddPrescription(context);
}),
),
Padding(
child: AppText(
TranslationBase.of(context).noSickLeaveApplied,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.all(10),
),
AppText(
TranslationBase.of(context).applyNow,
fontWeight: FontWeight.bold,
color: HexColor('#B8382C'),
)
],
),
))
: Container( : Container(
margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0,
SizeConfig.realScreenWidth * 0.05, 0), SizeConfig.realScreenWidth * 0.05, 0),
@ -91,4 +127,12 @@ class PrescriptionOutPatientWidget extends StatelessWidget {
), ),
); );
} }
openAddPrescription(BuildContext context) {
showModalBottomSheet(
context: context,
builder: (context) {
return new Container();
});
}
} }

@ -20,7 +20,7 @@ class AppText extends StatefulWidget {
final bool visibility; final bool visibility;
final TextAlign textAlign; final TextAlign textAlign;
final Color backGroundcolor; final Color backGroundcolor;
final TextOverflow textOverflow;
AppText(this.data, AppText(this.data,
{this.color = Colors.black, {this.color = Colors.black,
this.fontWeight = FontWeight.normal, this.fontWeight = FontWeight.normal,
@ -33,6 +33,7 @@ class AppText extends StatefulWidget {
this.marginLeft = 0, this.marginLeft = 0,
this.visibility = true, this.visibility = true,
this.textAlign, this.textAlign,
this.textOverflow,
this.backGroundcolor = Colors.white}); this.backGroundcolor = Colors.white});
@override @override
@ -55,7 +56,7 @@ class _AppTextState extends State<AppText> {
child: Text( child: Text(
widget.data, widget.data,
textAlign: widget.textAlign, textAlign: widget.textAlign,
overflow: TextOverflow.clip, overflow: widget.textOverflow ?? TextOverflow.clip,
style: TextStyle( style: TextStyle(
color: widget.color, color: widget.color,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,

Loading…
Cancel
Save