merge-requests/33/head
Elham Rababah 5 years ago
commit 7e154e47c0

@ -0,0 +1,60 @@
class RequestDoctorReply {
int projectID;
int doctorID;
int transactionNo;
int languageID;
String stamp;
String iPAdress;
double versionID;
int channel;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
bool patientOutSA;
RequestDoctorReply(
{this.projectID = 15,
this.doctorID = 70907,
this.transactionNo = 0,
this.languageID = 2,
this.stamp = '2020-04-27T12:17:17.721Z',
this.iPAdress = '11.11.11.11',
this.versionID = 1.2,
this.channel = 9,
this.tokenID = '@dm!n',
this.sessionID = '2Z7FX4Lokp',
this.isLoginForDoctorApp = true,
this.patientOutSA = false});
RequestDoctorReply.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
doctorID = json['DoctorID'];
transactionNo = json['TransactionNo'];
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['DoctorID'] = this.doctorID;
data['TransactionNo'] = this.transactionNo;
data['LanguageID'] = this.languageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
return data;
}
}

@ -6,7 +6,7 @@ class ListDoctorWorkingHoursTable {
ListDoctorWorkingHoursTable({this.date, this.dayName, this.workingHours}); ListDoctorWorkingHoursTable({this.date, this.dayName, this.workingHours});
ListDoctorWorkingHoursTable.fromJson(Map<String, dynamic> json) { ListDoctorWorkingHoursTable.fromJson(Map<String, dynamic> json) {
date = json['Date']; date = json['Date'] ;
dayName = json['DayName']; dayName = json['DayName'];
workingHours = json['WorkingHours']; workingHours = json['WorkingHours'];
} }

@ -0,0 +1,108 @@
class ListGtMyPatientsQuestions {
String setupID;
int projectID;
int transactionNo;
int patientType;
int patientID;
int doctorID;
int requestType;
String requestDate;
String requestTime;
String remarks;
int status;
int createdBy;
String createdOn;
int editedBy;
String editedOn;
String patientName;
String patientNameN;
int gender;
String dateofBirth;
String mobileNumber;
String emailAddress;
String age;
String genderDescription;
bool isVidaCall;
ListGtMyPatientsQuestions(
{this.setupID,
this.projectID,
this.transactionNo,
this.patientType,
this.patientID,
this.doctorID,
this.requestType,
this.requestDate,
this.requestTime,
this.remarks,
this.status,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.patientName,
this.patientNameN,
this.gender,
this.dateofBirth,
this.mobileNumber,
this.emailAddress,
this.age,
this.genderDescription,
this.isVidaCall});
ListGtMyPatientsQuestions.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
transactionNo = json['TransactionNo'];
patientType = json['PatientType'];
patientID = json['PatientID'];
doctorID = json['DoctorID'];
requestType = json['RequestType'];
requestDate = json['RequestDate'];
requestTime = json['RequestTime'];
remarks = json['Remarks'];
status = json['Status'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
patientName = json['PatientName'];
patientNameN = json['PatientNameN'];
gender = json['Gender'];
dateofBirth = json['DateofBirth'];
mobileNumber = json['MobileNumber'];
emailAddress = json['EmailAddress'];
age = json['Age'];
genderDescription = json['GenderDescription'];
isVidaCall = json['IsVidaCall'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['TransactionNo'] = this.transactionNo;
data['PatientType'] = this.patientType;
data['PatientID'] = this.patientID;
data['DoctorID'] = this.doctorID;
data['RequestType'] = this.requestType;
data['RequestDate'] = this.requestDate;
data['RequestTime'] = this.requestTime;
data['Remarks'] = this.remarks;
data['Status'] = this.status;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
data['PatientName'] = this.patientName;
data['PatientNameN'] = this.patientNameN;
data['Gender'] = this.gender;
data['DateofBirth'] = this.dateofBirth;
data['MobileNumber'] = this.mobileNumber;
data['EmailAddress'] = this.emailAddress;
data['Age'] = this.age;
data['GenderDescription'] = this.genderDescription;
data['IsVidaCall'] = this.isVidaCall;
return data;
}
}

@ -0,0 +1,61 @@
import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/RequestDoctorReply.dart';
import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart';
import 'package:http_interceptor/http_client_with_interceptor.dart';
import '../interceptor/http_interceptor.dart';
class DoctorReplyProvider with ChangeNotifier {
Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
List<ListGtMyPatientsQuestions> listDoctorWorkingHoursTable = [];
bool isLoading = true;
bool isError = false;
String error = '';
RequestDoctorReply _requestSchedule = RequestDoctorReply();
DoctorReplyProvider() {
getDoctorSchedule();
}
getDoctorSchedule() async {
const url = BASE_URL + 'DoctorApplication.svc/REST/GtMyPatientsQuestions';
try {
if (await Helpers.checkConnection()) {
final response = await client.post(url,
body: json.encode(_requestSchedule.toJson()));
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) {
isLoading = false;
isError = true;
error = 'Error While Fetching data';
} else {
var parsed = json.decode(response.body.toString());
if (parsed['MessageStatus'] == 1) {
parsed['List_GtMyPatientsQuestions'].forEach((v) {
listDoctorWorkingHoursTable.add( ListGtMyPatientsQuestions.fromJson(v));
});
isError = false;
isLoading = false;
} else {
isError = true;
error = parsed['ErrorMessage'] ?? parsed['ErrorEndUserMessage'];
}
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners();
} catch (error) {
throw error;
}
}
}

@ -35,10 +35,10 @@ class ScheduleProvider with ChangeNotifier {
1); 1);
ScheduleProvider() { ScheduleProvider() {
geDoctorSchedule(); getDoctorSchedule();
} }
geDoctorSchedule() async { getDoctorSchedule() async {
const url = BASE_URL + 'Doctors.svc/REST/GetDoctorWorkingHoursTable'; const url = BASE_URL + 'Doctors.svc/REST/GetDoctorWorkingHoursTable';
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {

@ -1,3 +1,4 @@
import './screens/QR_reader_screen.dart'; import './screens/QR_reader_screen.dart';
import './screens/auth/change_password_screen.dart'; import './screens/auth/change_password_screen.dart';
import './screens/auth/login_screen.dart'; import './screens/auth/login_screen.dart';
@ -5,7 +6,7 @@ import './screens/auth/verification_methods_screen.dart';
import './screens/auth/verify_account_screen.dart'; import './screens/auth/verify_account_screen.dart';
import './screens/blood_bank_screen.dart'; import './screens/blood_bank_screen.dart';
import './screens/dashboard_screen.dart'; import './screens/dashboard_screen.dart';
import './screens/doctor_reply_screen.dart'; import 'screens/doctor/doctor_reply_screen.dart';
import './screens/medicine/medicine_search_screen.dart'; import './screens/medicine/medicine_search_screen.dart';
import './screens/my_schedule_screen.dart'; import './screens/my_schedule_screen.dart';
import './screens/patients/patient_profile_screen.dart'; import './screens/patients/patient_profile_screen.dart';

@ -1,5 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:provider/provider.dart';
import '../routes.dart'; import '../routes.dart';
import '../widgets/shared/app_texts_widget.dart'; import '../widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -9,6 +11,7 @@ import '../presentation/doctor_app_icons.dart';
import '../widgets/dashboard/dashboard_item_icons_texts.dart'; import '../widgets/dashboard/dashboard_item_icons_texts.dart';
import '../widgets/dashboard/dashboard_item_texts_widget.dart'; import '../widgets/dashboard/dashboard_item_texts_widget.dart';
import '../widgets/shared/rounded_container_widget.dart'; import '../widgets/shared/rounded_container_widget.dart';
import 'doctor/doctor_reply_screen.dart';
class DashboardScreen extends StatefulWidget { class DashboardScreen extends StatefulWidget {
DashboardScreen({Key key, this.title}) : super(key: key); DashboardScreen({Key key, this.title}) : super(key: key);
@ -23,217 +26,245 @@ class _DashboardScreenState extends State<DashboardScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle:'Home', appBarTitle: 'Home',
body: Container( body: Container(
child: Column(
child: Column( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( flex: 1,
flex: 1, child: Container(
child: Container( margin: EdgeInsets.all(10),
margin: EdgeInsets.all(10), child: AppText(
child: AppText( "Today's Statistics",
"Today's Statistics", fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, ),
alignment: Alignment.centerLeft,
),
),
Expanded(
flex: 3,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: RoundedContainer(
child: CircularPercentIndicator(
radius: 90.0,
animation: true,
animationDuration: 1200,
lineWidth: 7.0,
percent: .75,
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AppText("38",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 4),
AppText("Out-Patients",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.5,
color: Colors.grey[800]),
],
),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Colors.blueGrey[100],
progressColor: Colors.red,
), ),
alignment: Alignment.centerLeft, ),
)), ),
Expanded( Expanded(
flex: 3,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: RoundedContainer(child:CircularPercentIndicator(
radius: 90.0,
animation: true,
animationDuration: 1200,
lineWidth: 7.0,
percent: .75,
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AppText(
"38",
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 4
),
AppText(
"Out-Patients",
fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.5,
color: Colors.grey[800]
),
],
),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Colors.blueGrey[100],
progressColor: Colors.red,
))),
Expanded(
flex: 2,
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: DashboardItemTexts(
"Arrived",
"23",
)),
Expanded(
child: DashboardItemTexts(
"Not Arrived",
"23",
)),
],
)),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
child: DashboardItemTexts(
"ER",
"23",
)),
Expanded(
child: DashboardItemTexts(
"Walk-in",
"23",
)),
],
)),
],
))
])),
Expanded(
flex: 2, flex: 2,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 2, flex: 1,
child: new DashboardItemIconText( child: Column(
DoctorApp.home_icon, crossAxisAlignment: CrossAxisAlignment.stretch,
"08", children: <Widget>[
"Lab Result", Expanded(
backgroundColor: Colors.red, child: DashboardItemTexts(
)), "Arrived",
Expanded( "23",
flex: 2, )),
child: new DashboardItemIconText( Expanded(
DoctorApp.home_icon, child: DashboardItemTexts(
"10", "Not Arrived",
"Radiology", "23",
backgroundColor: Colors.red, ),
)), ),
Expanded( ],
flex: 2, ),
child: new DashboardItemIconText( ),
DoctorApp.home_icon,
"05",
"Referral",
backgroundColor: Colors.red,
)),
],
)),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded( Expanded(
flex: 2, child: Column(
child: new DashboardItemIconText( crossAxisAlignment: CrossAxisAlignment.stretch,
DoctorApp.home_icon, children: <Widget>[
Expanded(
child: DashboardItemTexts(
"ER",
"23", "23",
"In-Patient",
showBorder: true,
)), )),
Expanded( Expanded(
flex: 2, child: DashboardItemTexts(
child: new DashboardItemIconText( "Walk-in",
DoctorApp.home_icon,
"23", "23",
"Operations",
showBorder: true,
)), )),
],
)),
], ],
)), ),
Expanded( )
flex: 1, ],
child: Container( ),
margin: EdgeInsets.all(10), ),
child: AppText( Expanded(
"Patient Services", flex: 2,
fontWeight: FontWeight.bold, child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"08",
"Lab Result",
backgroundColor: Colors.red,
),
),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"10",
"Radiology",
backgroundColor: Colors.red,
)),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"05",
"Referral",
backgroundColor: Colors.red,
)),
],
),
),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"23",
"In-Patient",
showBorder: true,
),
),
Expanded(
flex: 2,
child: new DashboardItemIconText(
DoctorApp.home_icon,
"23",
"Operations",
showBorder: true,
)),
],
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.all(10),
child: AppText(
"Patient Services",
fontWeight: FontWeight.bold,
),
alignment: Alignment.centerLeft,
),
),
Expanded(
flex: 2,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Expanded(
flex: 2,
child: InkWell(
child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"Search Patient",
showBorder: false,
backgroundColor: Colors.green[200],
), ),
alignment: Alignment.centerLeft, onTap: () {
)), Navigator.of(context).pushNamed(PATIENT_SEARCH);
Expanded( },
),
),
Expanded(
flex: 2, flex: 2,
child: Row( child: InkWell(
crossAxisAlignment: CrossAxisAlignment.stretch, onTap: () {
children: <Widget>[
Expanded( Navigator.push(
flex: 2, context,
child: InkWell( child: DashboardItemIconText( MaterialPageRoute(
DoctorApp.home_icon, builder: (context) => ChangeNotifierProvider(
"", create: (_) => DoctorReplyProvider(),
"Search Patient", child: DoctorReplyScreen(),
showBorder: false, ),
backgroundColor: Colors.green[200], ),
), );
},
onTap: () { child: DashboardItemIconText(
Navigator.of(context).pushNamed(PATIENT_SEARCH); DoctorApp.home_icon,
}, "",
"Doctor Reply",
)), showBorder: false,
Expanded( backgroundColor: Colors.deepPurple[300],
flex: 2, ),
child: new DashboardItemIconText( ),
DoctorApp.home_icon, ),
"", ],
"Out Patient", ),
showBorder: false, ),
backgroundColor: Colors.deepPurple[300], Expanded(
)), flex: 2,
], child: Row(
)), crossAxisAlignment: CrossAxisAlignment.stretch,
Expanded( children: <Widget>[
Expanded(
flex: 2, flex: 2,
child: Row( child: new DashboardItemIconText(
crossAxisAlignment: CrossAxisAlignment.stretch, DoctorApp.home_icon,
children: <Widget>[ "",
Expanded( "In Patient",
flex: 2, showBorder: false,
child: new DashboardItemIconText( backgroundColor: Colors.blueGrey[900],
DoctorApp.home_icon, ),
"", ),
"In Patient", Expanded(
showBorder: false, flex: 2,
backgroundColor: Colors.blueGrey[900], child: new DashboardItemIconText(
)), DoctorApp.home_icon,
Expanded( "",
flex: 2, "Discharge Patient",
child: new DashboardItemIconText( showBorder: false,
DoctorApp.home_icon, backgroundColor: Colors.brown[400],
"", ),
"Discharge Patient", ),
showBorder: false, ],
backgroundColor: Colors.brown[400], ),
)), ),
], ],
)), ),
], ),
))); );
} }
} }

@ -0,0 +1,125 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
/*
*@author: Mohammad Aljammal
*@Date:28/4/2020
*@param:
*@return:
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
*/
class DoctorReplyScreen extends StatelessWidget {
DoctorReplyProvider _doctorReplyProvider;
@override
Widget build(BuildContext context) {
_doctorReplyProvider = Provider.of(context);
return AppScaffold(
appBarTitle: 'Doctor Reply',
showAppDrawer: false,
body:_doctorReplyProvider.isLoading? DrAppCircularProgressIndeicator():
_doctorReplyProvider.isError? Center(
child: Text(
_doctorReplyProvider.error,
style: TextStyle(color: Theme.of(context).errorColor),
),
):
Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: ListView(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: _doctorReplyProvider.listDoctorWorkingHoursTable.map((reply) {
return CardWithBgWidget(
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
reply.patientName,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
reply.remarks,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
SizedBox(
height: 5,
),
Row(
children: [
AppText(
'Time',
fontSize: 2.5 * SizeConfig.textMultiplier,
),
Container(
margin: EdgeInsets.only(left: 10),
child: AppText(
reply.requestTime,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
),
],
),
SizedBox(
height: 5,
),
Row(
children: [
AppText(
'File No',
fontSize: 2.5 * SizeConfig.textMultiplier,
),
Container(
margin: EdgeInsets.only(left: 10),
child: AppText(
'${reply.patientID}',
fontSize: 2.5 * SizeConfig.textMultiplier,
),
),
],
),
SizedBox(
height: 5,
),
Row(
children: [
AppText(
'Mobile No',
fontSize: 2.5 * SizeConfig.textMultiplier,
),
Container(
margin: EdgeInsets.only(left: 10),
child: AppText(
reply.mobileNumber,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
),
],
),
],
),
),
);
}).toList(),
)
],
),
),
);
}
}

@ -1,9 +0,0 @@
import 'package:flutter/material.dart';
class DoctorReplyScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('DoctorReply'),),
);
}
}

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/providers/schedule_provider.dart'; import 'package:doctor_app_flutter/providers/schedule_provider.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -14,23 +16,23 @@ class MyScheduleScreen extends StatelessWidget {
scheduleProvider = Provider.of(context); scheduleProvider = Provider.of(context);
return AppScaffold( return AppScaffold(
// pageOnly: false, // pageOnly: false,
showBottomBar: false,
showAppDrawer: false,
appBarTitle: 'My Schedule', appBarTitle: 'My Schedule',
body: scheduleProvider.isLoading body: scheduleProvider.isLoading
? Center( ? DrAppCircularProgressIndeicator()
child: CircularProgressIndicator(),
)
: scheduleProvider.isError : scheduleProvider.isError
? Center( ? Center(
child: Text( child: AppText(
scheduleProvider.error, scheduleProvider.error,
style: TextStyle(color: Theme.of(context).errorColor), color: Theme.of(context).errorColor,
), ),
) )
: scheduleProvider.listDoctorWorkingHoursTable.length == 0 : scheduleProvider.listDoctorWorkingHoursTable.length == 0
? Center( ? Center(
child: Text( child: AppText(
'You don\'t have any Schedule', 'You don\'t have any Schedule',
style: TextStyle(color: Theme.of(context).errorColor), color: Theme.of(context).errorColor,
), ),
) )
: Container( : Container(
@ -46,8 +48,9 @@ class MyScheduleScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Text('My Schedule', AppText('My Schedule',
style: textStyle(2.5, FontWeight.w700)), fontSize:
2.5 * SizeConfig.textMultiplier),
scheduleListByDate(), scheduleListByDate(),
// scheduleListByDate('Wednesday, 8 April '), // scheduleListByDate('Wednesday, 8 April '),
], ],
@ -71,10 +74,38 @@ class MyScheduleScreen extends StatelessWidget {
child: Column( child: Column(
children: scheduleProvider.listDoctorWorkingHoursTable.map((item) { children: scheduleProvider.listDoctorWorkingHoursTable.map((item) {
return CardWithBgWidget( return CardWithBgWidget(
line1Text: item.dayName, widget: Container(
line2Text: item.workingHours, child: Column(
heightPercentage: 0.18, crossAxisAlignment: CrossAxisAlignment.start,
widthPercentage: 0.80, children: <Widget>[
AppText(item.dayName,
fontSize: 2.5 * SizeConfig.textMultiplier),
SizedBox(
height: 8,
),
!item.workingHours.contains('and')
? AppText(item.workingHours,
fontSize: 2.5 * SizeConfig.textMultiplier)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
item.workingHours.substring(
0, item.workingHours.indexOf('a')),
fontSize: 2.5 * SizeConfig.textMultiplier),
AppText(
item.workingHours.substring(
item.workingHours.indexOf('d') + 2,
),
fontSize: 2.5 * SizeConfig.textMultiplier),
],
),
SizedBox(
width: 8,
)
],
),
),
); );
}).toList(), }).toList(),
), ),

@ -1,16 +1,17 @@
/* /*
*@author: Amjad Amireh Merge to Elham rababah *@author: Amjad Amireh Merge to Elham rababah
*@Date:27/4/2020 *@Date:27/4/2020
*@param: *@param:
*@return:PatientsScreen *@return:PatientsScreen
*@desc: *@desc:
*/ */
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart'; import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/patients/TopTenUsersModelResponse.dart'; import 'package:doctor_app_flutter/screens/patients/TopTenUsersModelResponse.dart';
import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -126,15 +127,32 @@ class _PatientsScreenState extends State<PatientsScreen> {
responseModelList.map((PatiantInformtion item) { responseModelList.map((PatiantInformtion item) {
return InkWell( return InkWell(
child: CardWithBgWidget( child: CardWithBgWidget(
line1Text: item widget: Column(
.nationalityName, //item['FirstName'],//patient.getFirstName(),//item['FirstName'], crossAxisAlignment: CrossAxisAlignment.start,
line2Text: item children: <Widget>[
.lastName, //responseModelList['LastName'],//item['LastName'],//'12/04/2020 - 02:00 PM', AppText(
// line3Text: item.middleName, item.nationalityName,
heightPercentage: 0.15, fontSize: 2.5 * SizeConfig.textMultiplier,
widthPercentage: 0.80), ),
onTap: () => SizedBox(
tapOnPatient(context, item, patientsProv), height: 8,
),
AppText(item.lastName,
fontSize:
2.5 * SizeConfig.textMultiplier),
SizedBox(
height: 8,
),
AppText(item.middleName,
fontSize:
2.5 * SizeConfig.textMultiplier),
],
),
),
onTap: () {
Navigator.of(context).pushNamed(PATIENTS_PROFILE,
arguments: {"patient": responseModelList});
},
); );
}).toList()) }).toList())
], ],
@ -144,13 +162,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
))); )));
} }
void tapOnPatient(BuildContext context, PatiantInformtion patient,
PatientsProvider patientsProv) {
patientsProv.setSelectedPatient(patient);
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {"patient": patient});
}
//***********amjad update************* //***********amjad update*************
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
return InputDecoration( return InputDecoration(
@ -177,4 +188,3 @@ class _PatientsScreenState extends State<PatientsScreen> {
//************* //*************
} }
//*********************** //***********************

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -88,17 +90,29 @@ class _VitalSignScreenState extends State<VitalSignScreen> {
child: ListView.builder( child: ListView.builder(
itemCount: patientsProv.patientVitalSignList.length, itemCount: patientsProv.patientVitalSignList.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return InkWell( return InkWell(
child: CardWithBgWidget( child: CardWithBgWidget(
line1Text: 'DoctorName - ${patientsProv.patientVitalSignList[index].doctorName}', widget: Column(
line2Text: crossAxisAlignment: CrossAxisAlignment.start,
'PainScoreDesc - ${patientsProv.patientVitalSignList[index].painScoreDesc}', children: <Widget>[
heightPercentage: 0.15, AppText(
widthPercentage: 0.80), 'DoctorName - ${patientsProv.patientVitalSignList[index].doctorName}',
onTap: () { fontSize: 2.5 * SizeConfig.textMultiplier,
// Navigator.of(context).pushNamed(VITAL_SIGN); ),
}, SizedBox(
); height: 8,
),
AppText('painScoreDesc - ${patientsProv.patientVitalSignList[index].painScoreDesc}',
fontSize:
2.5 * SizeConfig.textMultiplier),
SizedBox(
height: 8,
),
],
),
),
onTap: () {},
);
}), }),
), ),
); );

@ -30,7 +30,7 @@ class _AppDrawerState extends State<AppDrawer> {
Container( Container(
height: SizeConfig.heightMultiplier * 30, height: SizeConfig.heightMultiplier * 30,
child: InkWell( child: InkWell(
child: DrawerHeader( child: DrawerHeader(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
@ -53,26 +53,37 @@ class _AppDrawerState extends State<AppDrawer> {
], ],
), ),
), ),
onTap: () { onTap: () {
Navigator.of(context).pushNamed(PROFILE); Navigator.of(context).pushNamed(PROFILE);
}, ), },
),
), ),
InkWell( InkWell(
child: DrawerItem("My Schedule", Icons.table_chart), child: DrawerItem("My Schedule", Icons.table_chart),
onTap: () { onTap: () {
Navigator.push(context,MaterialPageRoute( Navigator.push(
builder: (context) => ChangeNotifierProvider.value(value: ScheduleProvider(),child: MyScheduleScreen(),), context,
),); MaterialPageRoute(
builder: (context) => ChangeNotifierProvider(
create: (_) => ScheduleProvider(),
child: MyScheduleScreen(),
),
),
);
}, },
), ),
InkWell(child: DrawerItem("Settings", Icons.settings), onTap: (){ InkWell(
child: DrawerItem("Settings", Icons.settings),
onTap: () {
Navigator.of(context).pushNamed(SETTINGS); Navigator.of(context).pushNamed(SETTINGS);
},
},), ),
InkWell(child: DrawerItem("QR Reader", Icons.search),onTap:(){ InkWell(
child: DrawerItem("QR Reader", Icons.search),
onTap: () {
Navigator.of(context).pushNamed(QR_READER); Navigator.of(context).pushNamed(QR_READER);
},
} ,), ),
])), ])),
), ),
width: SizeConfig.realScreenWidth * 0.55, width: SizeConfig.realScreenWidth * 0.55,

@ -24,7 +24,7 @@ class AppScaffold extends StatelessWidget {
this.appBarTitle, this.appBarTitle,
this.showAppBar, this.showAppBar,
this.showBottomBar, this.showBottomBar,
this.showAppDrawer, this.showAppDrawer = true,
this.body, this.body,
this.showbg, this.showbg,
this.showCurve, this.showCurve,
@ -45,15 +45,10 @@ class AppScaffold extends StatelessWidget {
color: Colors.black, fontWeight: FontWeight.bold)), color: Colors.black, fontWeight: FontWeight.bold)),
title: Text(appBarTitle.toUpperCase()), title: Text(appBarTitle.toUpperCase()),
leading: Builder(builder: (BuildContext context) { leading: Builder(builder: (BuildContext context) {
return new GestureDetector( return IconButton(
onTap: () { icon: showAppDrawer ? Icon(Icons.menu) : Icon(Icons.arrow_back_ios) ,
Scaffold.of(context).openDrawer(); color: Colors.black,
}, onPressed: () => showAppDrawer? Scaffold.of(context).openDrawer() : Navigator.pop(context),
child: IconButton(
icon: Icon(Icons.menu),
color: Colors.black,
onPressed: () => Scaffold.of(context).openDrawer(),
),
); );
}), }),
centerTitle: true, centerTitle: true,

@ -6,80 +6,47 @@ import 'package:hexcolor/hexcolor.dart';
/* /*
*@author: Mohammad Aljammal *@author: Mohammad Aljammal
*@Date:27/4/2020 *@Date:27/4/2020
*@param: line1Text, line2Text, heightPercentage, widthPercentage *@param: Widget
*@return: *@return:
*@desc: Card Dr Schedule *@desc: Card With Bg Widget
*/ */
class CardWithBgWidget extends StatelessWidget { class CardWithBgWidget extends StatelessWidget {
String line1Text; final Widget widget;
String line2Text;
double heightPercentage; CardWithBgWidget({@required this.widget});
double widthPercentage;
CardWithBgWidget(
{this.line1Text = '',
this.line2Text = '',
this.heightPercentage,
this.widthPercentage});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Stack( return Container(
children: <Widget>[ margin: EdgeInsets.symmetric(vertical: 10.0),
RoundedContainer( width: double.infinity,
child:Container( decoration: BoxDecoration(
height: SizeConfig.screenHeight * heightPercentage, borderRadius: BorderRadius.all(
width: SizeConfig.screenWidth * widthPercentage, Radius.circular(10.0),
),
raduis: 10,
backgroundColor: Hexcolor('#58434F'),
showBorder: true,
borderColor: Hexcolor('#707070'),
borderWidth: 0.5,
), ),
Positioned( border: Border.all(color: Hexcolor('#707070'), width: 2.0),
left: 10, ),
child: RoundedContainer( child: Material(
child:Container( borderRadius: BorderRadius.all(Radius.circular(10.0)),
padding: const EdgeInsets.all(15.0), child: Stack(
height: SizeConfig.screenHeight * heightPercentage, children: [
width: SizeConfig.screenWidth * widthPercentage, Positioned(
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, width: 10,
children: <Widget>[ color: Hexcolor('#58434F'),
Text(line1Text, style: textStyle(2.5)) ,
SizedBox(
height: 8,
),
!line2Text.contains('and')?
Text(line2Text, style: textStyle(2.5)) :
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(line2Text.substring(0,line2Text.indexOf('a')), style: textStyle(2.5)) ,
Text(line2Text.substring(line2Text.indexOf('d')+2,), style: textStyle(2.5)) ,
],
),
],
),
), ),
elevation: 0, bottom: 0,
showBorder: true, top: 0,
borderColor: Hexcolor('#707070'), left: 0,
customCornerRaduis: true, ),
bottomLeft: 0, Container(
topLeft: 0, padding: EdgeInsets.all(15.0),
bottomRight: 10, margin: EdgeInsets.only(left: 10),
topRight: 10, child: widget)
borderWidth: 0.5), ],
), ),
], ),
); );
} }
TextStyle textStyle(size, [FontWeight weight]) {
return TextStyle(
fontSize: size * SizeConfig.textMultiplier, fontWeight: weight);
}
} }

Loading…
Cancel
Save