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"), margin: EdgeInsets.only(left: 10, right: 10),
borderRadius: BorderRadius.all( height: MediaQuery.of(context).orientation ==
Radius.circular(10.0), Orientation.portrait
), ? MediaQuery.of(context).size.height * 0.22
), : MediaQuery.of(context).size.height * 0.25,
margin: EdgeInsets.only(left: 10, right: 10), width: double.infinity,
height: 140, child: Row(
width: double.infinity, mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Row( crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.center, DashboardItem(
children: <Widget>[ onTap: () {
Divider(), setState(() {
Padding( this.isExpanded = false;
padding: const EdgeInsets.only( });
top: 8.0, bottom: 8, right: 40, left: 8), },
child: CircularPercentIndicator( child: Padding(
radius: 100, padding: const EdgeInsets.all(8.0),
animation: true, child: Column(
animationDuration: 1200, children: [
lineWidth: 7.0, Row(
percent: .75, children: [
center: Column( Expanded(
mainAxisAlignment: MainAxisAlignment.center, child: Column(
children: <Widget>[ children: [
AppText( AppText(
"38", model.dashboardItemsList
fontSize: SizeConfig.textMultiplier * 3.7, .length >
color: HexColor('#5D4C35'), 0
fontWeight: FontWeight.bold, ? isInpatient == 'in'
), ? model
AppText( .dashboardItemsList[
TranslationBase.of(context).outPatients, 0]
fontWeight: FontWeight.normal, .summaryoptions[0]
fontSize: SizeConfig.textMultiplier * 1.4, .value
color: HexColor('#5D4C35'), .toString()
), : model
], .dashboardItemsList[
1]
.summaryoptions[0]
.value
.toString()
: "",
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 24,
),
AppText(
model.dashboardItemsList
.length >
0
? 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,
)
],
)),
Expanded(
child: Column(
children: [
AppText(
model.dashboardItemsList
.length >
0
? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[1]
.value
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[1]
.value
.toString()
: "",
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 28,
),
AppText(
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,
)
],
)),
Expanded(
child: Column(
children: [
AppText(
model.dashboardItemsList
.length >
0
? 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(
model.dashboardItemsList
.length >
0
? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[3]
.value
.toString()
: model
.dashboardItemsList[
1]
.summaryoptions[3]
.value
.toString()
: "",
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: 28),
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,
), ),
circularStrokeCap: CircularStrokeCap.butt, ],
backgroundColor: Colors.blueGrey[100],
progressColor: HexColor('#B8382C'),
),
), ),
Container( ),
child: Table( collapsedChild: Container(
defaultColumnWidth: FixedColumnWidth( margin: EdgeInsets.only(left: 10, right: 10),
MediaQuery.of(context).size.width / 5), height: MediaQuery.of(context).orientation ==
// border: TableBorder.all( Orientation.portrait
// color: Colors.black26, ? MediaQuery.of(context).size.height * 0.15
// width: 1, : MediaQuery.of(context).size.height * 0.25,
// style: BorderStyle.solid), width: double.infinity,
border: TableBorder.symmetric( child: Row(
inside: BorderSide( mainAxisAlignment: MainAxisAlignment.spaceBetween,
width: 0.5, crossAxisAlignment: CrossAxisAlignment.start,
color: HexColor('#5D4C35'), children: <Widget>[
), DashboardItem(
), onTap: () {
children: [ setState(() {
TableRow( this.isExpanded = true;
children: [ this.isInpatient = 'in';
TableCell( });
child: Center( },
child: Column( child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
InkWell(
child: AppText(
TranslationBase.of(context).arrived,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: HexColor('#5D4C35'),
),
onTap: () {},
),
AppText( AppText(
"23", 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,
),
SizedBox(
height: 6,
), ),
Flexible(
child: AppText(
TranslationBase.of(context).inPatient,
color: Colors.white,
textOverflow: TextOverflow.ellipsis,
)),
], ],
), ),
)), Padding(
TableCell( padding: EdgeInsets.all(5),
child: Column( child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Icon(
DoctorApp.in_patient_white,
size: 35,
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.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>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).er, model.dashboardItemsList.length > 0
fontSize: ? getPatientCount(
SizeConfig.textMultiplier * 1.5, model.dashboardItemsList[1])
color: HexColor('#5D4C35'), : "",
),
AppText(
"03",
fontSize: fontSize:
SizeConfig.textMultiplier * 2.7, SizeConfig.textMultiplier * 6,
color: HexColor('#5D4C35'), color: Colors.white,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 6,
), ),
Flexible(
child: AppText(
TranslationBase.of(context)
.outPatients,
color: Colors.white,
textOverflow: TextOverflow.ellipsis,
)),
], ],
), ),
), Padding(
], padding: EdgeInsets.all(5),
// child: Column(
), mainAxisAlignment:
TableRow(children: [ MainAxisAlignment.end,
TableCell( children: [
child: Column( Icon(
children: <Widget>[ DoctorApp.out_patient,
SizedBox( size: 35,
height: 6, color: Colors.white,
), )
AppText( ],
TranslationBase.of(context).notArrived, ))
fontSize: ],
SizeConfig.textMultiplier * 1.5,
color: HexColor('#5D4C35'),
),
AppText(
"15",
fontSize:
SizeConfig.textMultiplier * 2.7,
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,
),
],
),
),
TableCell(
child: Column(
children: <Widget>[
SizedBox(
height: 6,
),
AppText(
TranslationBase.of(context).walkIn,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: HexColor('#5D4C35'),
),
AppText(
"04",
fontSize:
SizeConfig.textMultiplier * 2.7,
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,
),
],
),
), ),
]), ),
], 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,
),
],
), ),
Divider(), ),
], 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,397 +289,394 @@ class _PatientsScreenState extends State<PatientsScreen> {
}); });
}); });
}, },
builder: (_, model, w) => builder: (_, model, w) => AppScaffold(
AppScaffold( appBarTitle: patientTypeTitle,
appBarTitle: patientTypeTitle, body: _isLoading
body: _isLoading ? DrAppCircularProgressIndeicator()
? DrAppCircularProgressIndeicator() : _isError
: _isError
? 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, children: <Widget>[
children: <Widget>[ Container(
Container( child: lItems == null
child: lItems == null ? Column(
? Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ Container(
Container( child: Center(
child: Center( child: Padding(
child: Padding( padding: const EdgeInsets.fromLTRB(
padding: const EdgeInsets.fromLTRB( 0, 0, 0, 0), //250
0, 0, 0, 0), //250 child:
child: DrAppCircularProgressIndeicator(),
DrAppCircularProgressIndeicator(), )),
)),
),
],
)
: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context)
.size
.height *
0.03),
child: SERVICES_PATIANT2[
int.parse(patientType)] ==
"List_MyOutPatient"
? _locationBar(context)
: Container(),
),
SizedBox(height: 18.5),
Container(
width: SizeConfig.screenWidth * 0.9,
height: SizeConfig.screenHeight * 0.05,
child: TextField(
controller: _controller,
onChanged: (String str) {
this.searchData(str);
},
decoration: buildInputDecoration(
context,
TranslationBase.of(context)
.searchPatient),
), ),
), ],
SizedBox( )
height: 10.0, : Column(
), children: <Widget>[
Divider( Padding(
thickness: 0.8, padding: EdgeInsets.only(
color: Color(0xffCCCCCC), top: MediaQuery.of(context)
), .size
Container( .height *
decoration: BoxDecoration( 0.03),
color: Color(0Xffffffff), child: SERVICES_PATIANT2[
borderRadius: int.parse(patientType)] ==
BorderRadius.circular(20)), "List_MyOutPatient"
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), ? _locationBar(context)
child: (responseModelList.length > 0) : Container(),
? Column( ),
// mainAxisAlignment: MainAxisAlignment.center, SizedBox(height: 18.5),
children: responseModelList.map( Container(
(PatiantInformtion item) { width: SizeConfig.screenWidth * 0.9,
return Container( height:
decoration: SizeConfig.screenHeight * 0.05,
myBoxDecoration(), child: TextField(
child: InkWell( controller: _controller,
child: Row( onChanged: (String str) {
children: <Widget>[ this.searchData(str);
Column( },
mainAxisAlignment: decoration: buildInputDecoration(
MainAxisAlignment context,
.start, TranslationBase.of(context)
children: <Widget>[ .searchPatient),
Padding( ),
padding: EdgeInsets ),
.only( SizedBox(
left: height: 10.0,
12.0), ),
child: Divider(
Container( thickness: 0.8,
decoration: color: Color(0xffCCCCCC),
BoxDecoration( ),
boxShadow: [ Container(
BoxShadow( decoration: BoxDecoration(
color: Color.fromRGBO( color: Color(0Xffffffff),
0, borderRadius:
0, BorderRadius.circular(20)),
0, margin:
0.08), EdgeInsets.fromLTRB(0, 0, 0, 0),
offset: Offset( child: (responseModelList.length > 0)
0.0, ? Column(
5.0), // mainAxisAlignment: MainAxisAlignment.center,
blurRadius: children: responseModelList
16.0) .map((PatiantInformtion
], item) {
borderRadius: return Container(
BorderRadius.all( decoration:
Radius.circular(35.0)), myBoxDecoration(),
color: Color( child: InkWell(
0xffCCCCCC), child: Row(
), children: <Widget>[
width: 70, Column(
height: 70, mainAxisAlignment:
child: Icon( MainAxisAlignment
item.genderDescription == .start,
"Male" children: <
? DoctorApp Widget>[
.male Padding(
: DoctorApp padding: EdgeInsets
.female_icon, .only(
size: 70, left:
color: Colors 12.0),
.white, child:
Container(
decoration:
BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
0,
0,
0,
0.08),
offset: Offset(0.0,
5.0),
blurRadius:
16.0)
],
borderRadius:
BorderRadius.all(
Radius.circular(35.0)),
color: Color(
0xffCCCCCC),
),
width: 70,
height: 70,
child: Icon(
item.genderDescription ==
"Male"
? DoctorApp
.male
: DoctorApp
.female_icon,
size: 70,
color: Colors
.white,
),
), ),
), ),
), ],
], ),
),
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment CrossAxisAlignment
.start, .start,
children: [ children: [
Column( Column(
children: [ children: [
SizedBox( SizedBox(
height: height:
10.0, 10.0,
),
Padding(
padding: EdgeInsets.symmetric(
vertical:
5.5,
horizontal:
22.5),
child:
AppText(
item.firstName +
" " +
item.lastName,
fontSize:
2.0 *
SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
), ),
), Padding(
], padding: EdgeInsets.symmetric(
), vertical:
Row( 5.5,
mainAxisAlignment: horizontal:
MainAxisAlignment 22.5),
.spaceAround, child:
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Wrap(
children: [
AppText( AppText(
TranslationBase.of(context).fileNo, item.firstName +
fontSize: 1.8 * SizeConfig.textMultiplier, " " +
fontWeight: FontWeight.bold, item.lastName,
backGroundcolor: Colors.white,
),
AppText(
item.patientId.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
2.5,
),
AppText(
'NATIONALITY: ' +
item.nationalityName.toString(),
fontSize: fontSize:
1.8 * SizeConfig.textMultiplier, 2.0 * SizeConfig.textMultiplier,
fontWeight: fontWeight:
FontWeight.bold, FontWeight.bold,
backGroundcolor: backGroundcolor:
Colors.white, Colors.white,
), ),
SizedBox( ),
height: ],
15.5, ),
), Row(
SERVICES_PATIANT2[int.parse(patientType)] == mainAxisAlignment:
"List_MyOutPatient" MainAxisAlignment
? Row( .spaceAround,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: <Widget>[ Column(
Container( crossAxisAlignment:
height: 15, CrossAxisAlignment.start,
width: 60, children: <
decoration: BoxDecoration( Widget>[
borderRadius: BorderRadius.circular(25), Wrap(
color: HexColor("#20A169"), children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.patientId.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
2.5,
),
AppText(
'NATIONALITY: ' +
item.nationalityName.toString(),
fontSize:
1.8 * SizeConfig.textMultiplier,
fontWeight:
FontWeight.bold,
backGroundcolor:
Colors.white,
),
SizedBox(
height:
15.5,
),
SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
), ),
child: AppText( SizedBox(
item.startTime, width: 3.5,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
), ),
), Container(
SizedBox( child: AppText(
width: 3.5, convertDateFormat2(item.appointmentDate.toString()),
), fontSize: 1.5 * SizeConfig.textMultiplier,
Container( fontWeight: FontWeight.bold,
child: AppText( ),
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
), ),
), SizedBox(
SizedBox( height: 0.5,
height: 0.5, )
) ],
], )
) : SizedBox(
: SizedBox( height: 5,
height: 5, ),
],
),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
// mainAxisAlignment:
// MainAxisAlignment
// .spaceBetween,
children: <
Widget>[
SizedBox(
height:
0.5,
),
SizedBox(
height:
0,
),
Wrap(
children: [
AppText(
TranslationBase.of(context).age2,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
), ),
], AppText(
), item.age.toString(),
Column( fontSize: 1.8 * SizeConfig.textMultiplier,
crossAxisAlignment: fontWeight: FontWeight.w300,
CrossAxisAlignment backGroundcolor: Colors.white,
.start, ),
// mainAxisAlignment: ],
// MainAxisAlignment ),
// .spaceBetween, SizedBox(
children: < height:
Widget>[ 2.5,
SizedBox( ),
height: Wrap(
0.5, children: [
), AppText(
SizedBox( TranslationBase.of(context).gender2,
height: fontSize: 1.8 * SizeConfig.textMultiplier,
0, fontWeight: FontWeight.bold,
), backGroundcolor: Colors.white,
Wrap( ),
children: [ AppText(
AppText( item.gender.toString() == '1' ? 'Male' : 'Female',
TranslationBase.of(context).age2, fontSize: 1.8 * SizeConfig.textMultiplier,
fontSize: 1.8 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300,
fontWeight: FontWeight.bold, backGroundcolor: Colors.white,
backGroundcolor: Colors.white, ),
), ],
AppText( ),
item.age.toString(), SizedBox(
fontSize: 1.8 * SizeConfig.textMultiplier, height:
fontWeight: FontWeight.w300, 8,
backGroundcolor: Colors.white, ),
), SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient"
], ? Row(
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
SizedBox( children: <Widget>[
height: Container(
2.5, height: 15,
), width: 60,
Wrap( decoration: BoxDecoration(
children: [ borderRadius: BorderRadius.circular(25),
AppText( color: HexColor("#20A169"),
TranslationBase.of(context).gender2, ),
fontSize: 1.8 * SizeConfig.textMultiplier, child: AppText(
fontWeight: FontWeight.bold, item.startTime,
backGroundcolor: Colors.white, color: Colors.white,
), fontSize: 1.5 * SizeConfig.textMultiplier,
AppText( textAlign: TextAlign.center,
item.gender.toString() == '1' ? 'Male' : 'Female', fontWeight: FontWeight.bold,
fontSize: 1.8 * SizeConfig.textMultiplier, ),
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
8,
),
SERVICES_PATIANT2[int.parse(patientType)] ==
"List_MyOutPatient"
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
), ),
child: AppText( SizedBox(
item.startTime, width: 3.5,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
), ),
), Container(
SizedBox( child: AppText(
width: 3.5, convertDateFormat2(item.appointmentDate.toString()),
), fontSize: 1.5 * SizeConfig.textMultiplier,
Container( fontWeight: FontWeight.bold,
child: AppText( ),
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
), ),
), SizedBox(
SizedBox( height: 25.5,
height: 25.5, ),
), ],
], )
) : SizedBox(
: SizedBox( height: 15,
height: 15, ),
), ],
], ),
), ],
], ),
), ],
], ),
), ),
), // Divider(color: Colors.grey)
// Divider(color: Colors.grey) ],
], ),
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item
});
},
), ),
onTap: () { );
Navigator.of(context) }).toList(),
.pushNamed( )
PATIENTS_PROFILE, : Center(
arguments: { child: DrAppEmbeddedError(
"patient": item error: TranslationBase.of(
}); context)
}, .youDontHaveAnyPatient),
), ),
);
}).toList(),
)
: Center(
child: DrAppEmbeddedError(
error: TranslationBase.of(
context)
.youDontHaveAnyPatient),
), ),
), ],
], ),
), )
) ],
], ),
), ),
), ),
),); );
} }
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:
@ -68,12 +68,18 @@ class AddSickLeavScreen extends StatelessWidget {
children: [ children: [
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