dashboard changes

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

@ -96,7 +96,8 @@ var SERVICES_PATIANT = [
"GtMyReferredPatient",
"GtMyDischargeReferralPatient",
"GtMyTomorrowPatient",
"GtMyReferralPatient"
"GtMyReferralPatient",
"PatientArrivalList"
];
var SERVICES_PATIANT2 = [
"List_MyOutPatient",
@ -114,7 +115,8 @@ var SERVICES_PATIANT_HEADER = [
"Referred",
"Referral Discharge",
"Tomorrow",
"Referral"
"Referral",
"Arrived"
];
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",
'ar': 'قم بتمديد الإجازة المرضية'
},
'patient-target': {'en': 'Target Patient', 'ar': 'الهدف المريض'}
};

@ -1,20 +1,22 @@
import 'package:doctor_app_flutter/config/config.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 {
var _dashboardItemsList = [];
get dashboardItemsList => _dashboardItemsList;
List<DashboardModel> _dashboardItemsList = [];
List<DashboardModel> get dashboardItemsList => _dashboardItemsList;
// DashboardModel _dashboard = DashboardModel();
Future getDashboard() async {
return Future.value(null);
hasError = false;
await baseAppClient.post(
GET_DASHBOARD,
onSuccess: (dynamic response, int statusCode) {
_dashboardItemsList.clear();
_dashboardItemsList = response['listDoctorDashboarKPI'];
response['listDoctorDashboarKPI'].forEach((v) {
_dashboardItemsList.add(DashboardModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;

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

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

@ -19,7 +19,7 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:provider/provider.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import '../routes.dart';
import '../widgets/shared/app_texts_widget.dart';
import 'doctor/doctor_reply_screen.dart';
@ -47,7 +47,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
ProjectProvider projectsProvider;
var _isInit = true;
DoctorProfileModel profile;
bool isExpanded = false;
String isInpatient = "";
void didChangeDependencies() async {
super.didChangeDependencies();
if (_isInit) {
@ -77,7 +78,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
isLoading: isLoading,
body: ListView(children: [
Column(
children: <Widget>[
@ -211,182 +211,437 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
Container(
color: Colors.white,
height: 90,
height: this.isExpanded ? 150 : 90,
),
],
),
Positioned(
right: 9.0,
left: 9,
bottom: 19,
child: Container(
decoration: BoxDecoration(
color: HexColor("#DED8CF"),
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
),
margin: EdgeInsets.only(left: 10, right: 10),
height: 140,
width: double.infinity,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
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>[
AppText(
"38",
fontSize: SizeConfig.textMultiplier * 3.7,
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,
),
AppText(
TranslationBase.of(context).outPatients,
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.4,
color: HexColor('#5D4C35'),
),
],
right: 9.0,
left: 9,
bottom: 15,
child: ExpandableCardContainer(
expandedChild: Container(
margin: EdgeInsets.only(left: 10, right: 10),
height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.22
: 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 = false;
});
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
children: [
Expanded(
child: Column(
children: [
AppText(
model.dashboardItemsList
.length >
0
? isInpatient == 'in'
? model
.dashboardItemsList[
0]
.summaryoptions[0]
.value
.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(
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(
),
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>[
InkWell(
child: AppText(
TranslationBase.of(context).arrived,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: HexColor('#5D4C35'),
),
onTap: () {},
),
AppText(
"23",
model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[0])
: "",
fontSize:
SizeConfig.textMultiplier * 2.7,
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,
),
SizedBox(
height: 6,
SizeConfig.textMultiplier * 6,
color: Colors.white,
),
Flexible(
child: AppText(
TranslationBase.of(context).inPatient,
color: Colors.white,
textOverflow: TextOverflow.ellipsis,
)),
],
),
)),
TableCell(
child: Column(
Padding(
padding: EdgeInsets.all(5),
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>[
AppText(
TranslationBase.of(context).er,
fontSize:
SizeConfig.textMultiplier * 1.5,
color: HexColor('#5D4C35'),
),
AppText(
"03",
model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[1])
: "",
fontSize:
SizeConfig.textMultiplier * 2.7,
color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,
),
SizedBox(
height: 6,
SizeConfig.textMultiplier * 6,
color: Colors.white,
),
Flexible(
child: AppText(
TranslationBase.of(context)
.outPatients,
color: Colors.white,
textOverflow: TextOverflow.ellipsis,
)),
],
),
),
],
//
),
TableRow(children: [
TableCell(
child: Column(
children: <Widget>[
SizedBox(
height: 6,
),
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,
),
],
),
Padding(
padding: EdgeInsets.all(5),
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: [
Icon(
DoctorApp.out_patient,
size: 35,
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.15
: MediaQuery.of(context).size.height * 0.25,
),
],
),
Divider(),
],
),
),
)
),
isExpanded: isExpanded,
))
]),
FractionallySizedBox(
widthFactor: 0.90,
@ -412,16 +667,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
),
Container(
margin: EdgeInsets.only(bottom: 10),
// margin: EdgeInsets.only(bottom: 10),
child: Column(
children: <Widget>[
AppText(
"08",
model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[7])
: "",
fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white,
),
AppText(
TranslationBase.of(context).labResult,
TranslationBase.of(context)
.targetPatient,
textAlign: TextAlign.center,
color: Colors.white,
)
],
@ -449,7 +709,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Column(
children: <Widget>[
AppText(
"10",
model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[6])
: "",
fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white,
),
@ -482,7 +745,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Column(
children: <Widget>[
AppText(
"05",
model.dashboardItemsList.length > 0
? getPatientCount(
model.dashboardItemsList[2])
: "",
fontSize: SizeConfig.textMultiplier * 6,
color: Colors.white,
),
@ -503,99 +769,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
SizedBox(
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(
children: <Widget>[
AppText(
@ -909,8 +1082,17 @@ class _DashboardScreenState extends State<DashboardScreen> {
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
class DashboardItem extends StatelessWidget {
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
Widget build(BuildContext context) {
_locations = [
TranslationBase
.of(context)
.all,
TranslationBase
.of(context)
.today,
TranslationBase
.of(context)
.tomorrow,
TranslationBase
.of(context)
.nextWeek,
TranslationBase.of(context).all,
TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek,
];
projectsProvider = Provider.of(context);
final routeArgs = ModalRoute
.of(context)
.settings
.arguments as Map;
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patientSearchForm'];
@ -300,397 +289,394 @@ class _PatientsScreenState extends State<PatientsScreen> {
});
});
},
builder: (_, model, w) =>
AppScaffold(
appBarTitle: patientTypeTitle,
body: _isLoading
? DrAppCircularProgressIndeicator()
: _isError
builder: (_, model, w) => AppScaffold(
appBarTitle: patientTypeTitle,
body: _isLoading
? DrAppCircularProgressIndeicator()
: _isError
? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0
? DrAppEmbeddedError(
error: TranslationBase
.of(context)
.youDontHaveAnyPatient)
: Container(
child: ListView(
scrollDirection: Axis.vertical,
children: <Widget>[
Container(
child: lItems == null
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Center(
child: Padding(
padding: const EdgeInsets.fromLTRB(
0, 0, 0, 0), //250
child:
DrAppCircularProgressIndeicator(),
)),
),
],
)
: Column(
children: <Widget>[
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),
? DrAppEmbeddedError(
error:
TranslationBase.of(context).youDontHaveAnyPatient)
: Container(
child: ListView(
scrollDirection: Axis.vertical,
children: <Widget>[
Container(
child: lItems == null
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Center(
child: Padding(
padding: const EdgeInsets.fromLTRB(
0, 0, 0, 0), //250
child:
DrAppCircularProgressIndeicator(),
)),
),
),
SizedBox(
height: 10.0,
),
Divider(
thickness: 0.8,
color: Color(0xffCCCCCC),
),
Container(
decoration: BoxDecoration(
color: Color(0Xffffffff),
borderRadius:
BorderRadius.circular(20)),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: (responseModelList.length > 0)
? Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: responseModelList.map(
(PatiantInformtion item) {
return Container(
decoration:
myBoxDecoration(),
child: InkWell(
child: Row(
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment
.start,
children: <Widget>[
Padding(
padding: EdgeInsets
.only(
left:
12.0),
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,
],
)
: 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,
),
Divider(
thickness: 0.8,
color: Color(0xffCCCCCC),
),
Container(
decoration: BoxDecoration(
color: Color(0Xffffffff),
borderRadius:
BorderRadius.circular(20)),
margin:
EdgeInsets.fromLTRB(0, 0, 0, 0),
child: (responseModelList.length > 0)
? Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: responseModelList
.map((PatiantInformtion
item) {
return Container(
decoration:
myBoxDecoration(),
child: InkWell(
child: Row(
children: <Widget>[
Column(
mainAxisAlignment:
MainAxisAlignment
.start,
children: <
Widget>[
Padding(
padding: EdgeInsets
.only(
left:
12.0),
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(
width: 10,
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Column(
children: [
SizedBox(
height:
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,
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
Column(
children: [
SizedBox(
height:
10.0,
),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <
Widget>[
Wrap(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical:
5.5,
horizontal:
22.5),
child:
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(),
item.firstName +
" " +
item.lastName,
fontSize:
1.8 * SizeConfig.textMultiplier,
2.0 * 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"),
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <
Widget>[
Wrap(
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(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
SizedBox(
width: 3.5,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
),
SizedBox(
height: 0.5,
)
],
)
: SizedBox(
height: 5,
SizedBox(
height: 0.5,
)
],
)
: SizedBox(
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,
),
],
),
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(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
2.5,
),
Wrap(
children: [
AppText(
TranslationBase.of(context).gender2,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.gender.toString() == '1' ? 'Male' : 'Female',
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"),
AppText(
item.age.toString(),
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
backGroundcolor: Colors.white,
),
],
),
SizedBox(
height:
2.5,
),
Wrap(
children: [
AppText(
TranslationBase.of(context).gender2,
fontSize: 1.8 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
backGroundcolor: Colors.white,
),
AppText(
item.gender.toString() == '1' ? 'Male' : 'Female',
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(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
SizedBox(
width: 3.5,
),
),
SizedBox(
width: 3.5,
),
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
Container(
child: AppText(
convertDateFormat2(item.appointmentDate.toString()),
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
),
SizedBox(
height: 25.5,
),
],
)
: SizedBox(
height: 15,
),
],
),
],
),
],
SizedBox(
height: 25.5,
),
],
)
: SizedBox(
height: 15,
),
],
),
],
),
],
),
),
),
// Divider(color: Colors.grey)
],
// Divider(color: Colors.grey)
],
),
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item
});
},
),
onTap: () {
Navigator.of(context)
.pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item
});
},
),
);
}).toList(),
)
: Center(
child: DrAppEmbeddedError(
error: TranslationBase.of(
context)
.youDontHaveAnyPatient),
);
}).toList(),
)
: Center(
child: DrAppEmbeddedError(
error: TranslationBase.of(
context)
.youDontHaveAnyPatient),
),
),
),
],
),
)
],
),
),
),);
],
),
)
],
),
),
),
);
}
InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -760,7 +746,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
),
),
onTap: () {
filterBooking(item.toString());
setState(() {

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

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

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

@ -1,11 +1,13 @@
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/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/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'large_avatar.dart';
@ -18,7 +20,41 @@ class PrescriptionOutPatientWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
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(
margin: EdgeInsets.fromLTRB(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 TextAlign textAlign;
final Color backGroundcolor;
final TextOverflow textOverflow;
AppText(this.data,
{this.color = Colors.black,
this.fontWeight = FontWeight.normal,
@ -33,6 +33,7 @@ class AppText extends StatefulWidget {
this.marginLeft = 0,
this.visibility = true,
this.textAlign,
this.textOverflow,
this.backGroundcolor = Colors.white});
@override
@ -55,7 +56,7 @@ class _AppTextState extends State<AppText> {
child: Text(
widget.data,
textAlign: widget.textAlign,
overflow: TextOverflow.clip,
overflow: widget.textOverflow ?? TextOverflow.clip,
style: TextStyle(
color: widget.color,
fontWeight: widget.fontWeight,

Loading…
Cancel
Save