Appointment Details page, ToDo List Page implemented
parent
9842c3a0b1
commit
a0173c5b4d
@ -0,0 +1,44 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"title": "confirm",
|
||||||
|
"subtitle": "appointment",
|
||||||
|
"icon": "assets/images/new-design/confirm_icon.png",
|
||||||
|
"caller": "confirmAppointment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "reschedule",
|
||||||
|
"subtitle": "appointment",
|
||||||
|
"icon": "assets/images/new-design/reschedule_icon.png",
|
||||||
|
"caller": "openReschedule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "cancel",
|
||||||
|
"subtitle": "appointment",
|
||||||
|
"icon": "assets/images/new-design/cancel_icon.png",
|
||||||
|
"caller": "onCancelAppointment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "raise",
|
||||||
|
"subtitle": "complaint",
|
||||||
|
"icon": "assets/images/new-design/Complaint_icon.png",
|
||||||
|
"caller": "insertComplaint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "add",
|
||||||
|
"subtitle": "reminder",
|
||||||
|
"icon": "assets/images/new-design/reminder_icon.png",
|
||||||
|
"caller": "addReminder"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "hospital",
|
||||||
|
"subtitle": "locations",
|
||||||
|
"icon": "assets/images/new-design/location_icon.png",
|
||||||
|
"caller": "navigateToProject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "online",
|
||||||
|
"subtitle": "payment",
|
||||||
|
"icon": "assets/images/new-design/check-in.png",
|
||||||
|
"caller": "goToTodoList(31)"
|
||||||
|
}
|
||||||
|
]
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"title": "confirm",
|
||||||
|
"subtitle": "appointment",
|
||||||
|
"icon": "assets/images/new-design/confirm_icon.png",
|
||||||
|
"caller": "confirmAppointment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "reschedule",
|
||||||
|
"subtitle": "appointment",
|
||||||
|
"icon": "assets/images/new-design/reschedule_icon.png",
|
||||||
|
"caller": "openReschedule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "cancel",
|
||||||
|
"subtitle": "appointment",
|
||||||
|
"icon": "assets/images/new-design/cancel_icon.png",
|
||||||
|
"caller": "onCancelAppointment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "raise",
|
||||||
|
"subtitle": "complaint",
|
||||||
|
"icon": "assets/images/new-design/Complaint_icon.png",
|
||||||
|
"caller": "insertComplaint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "add",
|
||||||
|
"subtitle": "reminder",
|
||||||
|
"icon": "assets/images/new-design/reminder_icon.png",
|
||||||
|
"caller": "addReminder"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "hospital",
|
||||||
|
"subtitle": "locations",
|
||||||
|
"icon": "assets/images/new-design/location_icon.png",
|
||||||
|
"caller": "navigateToProject"
|
||||||
|
}
|
||||||
|
]
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
class FreeSlot {
|
||||||
|
List event;
|
||||||
|
DateTime slot;
|
||||||
|
|
||||||
|
|
||||||
|
FreeSlot(this.slot, this.event);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return '{ ${this.slot}, ${this.event} }';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
class AppoDetailsButton {
|
||||||
|
String title;
|
||||||
|
String subtitle;
|
||||||
|
String icon;
|
||||||
|
String caller;
|
||||||
|
|
||||||
|
AppoDetailsButton({this.title, this.subtitle, this.icon, this.caller});
|
||||||
|
|
||||||
|
AppoDetailsButton.fromJson(Map<String, dynamic> json) {
|
||||||
|
title = json['title'];
|
||||||
|
subtitle = json['subtitle'];
|
||||||
|
icon = json['icon'];
|
||||||
|
caller = json['caller'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['title'] = this.title;
|
||||||
|
data['subtitle'] = this.subtitle;
|
||||||
|
data['icon'] = this.icon;
|
||||||
|
data['caller'] = this.caller;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,139 @@
|
|||||||
|
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:rating_bar/rating_bar.dart';
|
||||||
|
import 'Components/AppointmentActions.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class AppointmentDetails extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_AppointmentDetailsState createState() => _AppointmentDetailsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTickerProviderStateMixin {
|
||||||
|
|
||||||
|
TabController _tabController;
|
||||||
|
bool showFooterButton = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
_tabController = new TabController(length: 2, vsync: this);
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text("Eyad Ismail Abu-Jayab"),
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
color: new Color(0xFFf6f6f6),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 20.0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
|
child: Image.network(
|
||||||
|
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
height: 120.0,
|
||||||
|
width: 120.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 10.0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text("Dr. EYAD ISMAIL ABU-JAYAD",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20.0,
|
||||||
|
color: Colors.grey[900],
|
||||||
|
letterSpacing: 1.0)),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 10.0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text("INTERNAL MEDICINE CLINIC",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0,
|
||||||
|
color: Colors.grey[900],
|
||||||
|
letterSpacing: 1.0)),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 5.0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: RatingBar.readOnly(
|
||||||
|
initialRating: 4.0,
|
||||||
|
size: 35.0,
|
||||||
|
filledColor: Colors.yellow[700],
|
||||||
|
emptyColor: Colors.grey[500],
|
||||||
|
isHalfAllowed: true,
|
||||||
|
halfFilledIcon: Icons.star_half,
|
||||||
|
filledIcon: Icons.star,
|
||||||
|
emptyIcon: Icons.star,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 5.0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text("(2322 Reviews)",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
color: Colors.blue[800],
|
||||||
|
letterSpacing: 1.0,
|
||||||
|
decoration: TextDecoration.underline,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 10.0),
|
||||||
|
child: Divider(
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TabBar(
|
||||||
|
onTap: (index) {
|
||||||
|
setState(() {
|
||||||
|
index == 1
|
||||||
|
? showFooterButton = true
|
||||||
|
: showFooterButton = false;
|
||||||
|
print(showFooterButton);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
tabs: [
|
||||||
|
Tab(
|
||||||
|
child: Text(TranslationBase.of(context).appoActions,
|
||||||
|
style: TextStyle(color: Colors.black))),
|
||||||
|
Tab(
|
||||||
|
child: Text(TranslationBase.of(context).availableAppo,
|
||||||
|
style: TextStyle(color: Colors.black)),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
controller: _tabController,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.8,
|
||||||
|
child: TabBarView(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
children: [AppointmentActions(), DocAvailableAppointments()],
|
||||||
|
controller: _tabController,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,272 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtons.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AppointmentActions extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_AppointmentActionsState createState() => _AppointmentActionsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AppointmentActionsState extends State<AppointmentActions> {
|
||||||
|
List<AppoDetailsButton> appoButtonsList = [];
|
||||||
|
var appointment = new AppointmentModel();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
appointment.PatientStatusType = 0;
|
||||||
|
appointment.IsOnlineCheckedIN = true;
|
||||||
|
|
||||||
|
_getAppointmentActionButtons();
|
||||||
|
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var size = MediaQuery.of(context).size;
|
||||||
|
final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2;
|
||||||
|
final double itemWidth = size.width / 2;
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.all(5.0),
|
||||||
|
child: CustomScrollView(
|
||||||
|
primary: false,
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
slivers: <Widget>[
|
||||||
|
SliverPadding(
|
||||||
|
padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
|
||||||
|
sliver: SliverGrid.count(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
childAspectRatio: (itemWidth / itemHeight),
|
||||||
|
children: appoButtonsList
|
||||||
|
.map((e) => GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
_handleButtonClicks(e);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: 100.0,
|
||||||
|
margin: EdgeInsets.all(9.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.grey[400],
|
||||||
|
blurRadius: 2.0,
|
||||||
|
spreadRadius: 0.0)
|
||||||
|
],
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
color: Colors.white),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
margin:
|
||||||
|
EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
|
||||||
|
child: Text(e.title,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
color: new Color(0xFFc5272d),
|
||||||
|
letterSpacing: 1.0,
|
||||||
|
fontSize: 20.0)),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin:
|
||||||
|
EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
|
||||||
|
child: Text(e.subtitle,
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
letterSpacing: 1.0,
|
||||||
|
fontSize: 15.0)),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.bottomRight,
|
||||||
|
margin:
|
||||||
|
EdgeInsets.fromLTRB(0.0, 20.0, 10.0, 8.0),
|
||||||
|
child: Image.asset(e.icon,
|
||||||
|
width: 40.0, height: 40.0),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_handleButtonClicks(AppoDetailsButton) {
|
||||||
|
print(AppoDetailsButton.caller);
|
||||||
|
}
|
||||||
|
|
||||||
|
_getAppointmentActionButtons() {
|
||||||
|
if (appointment != null) {
|
||||||
|
if (isConfirmed()) {
|
||||||
|
if (appointment.IsOnlineCheckedIN) {
|
||||||
|
_getConfirmedCheckInAppoActionsList();
|
||||||
|
} else {
|
||||||
|
_getConfirmedAppoActionsList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print("isConfirmed Null");
|
||||||
|
}
|
||||||
|
if (isBooked()) {
|
||||||
|
if (appointment.IsOnlineCheckedIN) {
|
||||||
|
_getBookedCheckInAppoActionsList();
|
||||||
|
} else {
|
||||||
|
_getBookedAppoActionsList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print("isBooked Null");
|
||||||
|
}
|
||||||
|
if (isArrived()) {
|
||||||
|
if (appointment.ClinicID == 17) {
|
||||||
|
_getArrivedInvoiceAppoActionsList();
|
||||||
|
} else {
|
||||||
|
_getArrivedAppoActionsList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print("isArrived Null");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print("Appo Null");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isConfirmed() {
|
||||||
|
return AppointmentType.isConfirmed(this.appointment);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isArrived() {
|
||||||
|
return AppointmentType.isArrived(this.appointment);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isCheckedIn() {
|
||||||
|
return this.appointment.IsOnlineCheckedIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isBooked() {
|
||||||
|
return AppointmentType.isBooked(this.appointment);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<AppoDetailsButton>> _getBookedAppoActionsList() async {
|
||||||
|
print("_getBookedAppoActionsList");
|
||||||
|
var bookButtonsJson;
|
||||||
|
List<AppoDetailsButton> buttonsList = [];
|
||||||
|
String data = await DefaultAssetBundle.of(context)
|
||||||
|
.loadString("assets/json/bookedButtons.json");
|
||||||
|
bookButtonsJson = json.decode(data);
|
||||||
|
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||||
|
buttonsList.add(AppoDetailsButton(
|
||||||
|
title: bookButtonsJson[i]['title'],
|
||||||
|
subtitle: bookButtonsJson[i]['subtitle'],
|
||||||
|
icon: bookButtonsJson[i]['icon'],
|
||||||
|
caller: bookButtonsJson[i]['caller'],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
appoButtonsList = buttonsList;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<AppoDetailsButton>> _getBookedCheckInAppoActionsList() async {
|
||||||
|
// BookedButtons.getContext(context);
|
||||||
|
print("_getBookedCheckInAppoActionsList");
|
||||||
|
List<AppoDetailsButton> buttonsList = [];
|
||||||
|
for (var i = 0; i < BookedButtons.buttons.length; i++) {
|
||||||
|
buttonsList.add(AppoDetailsButton(
|
||||||
|
title: BookedButtons.buttons[i]['title'],
|
||||||
|
subtitle: BookedButtons.buttons[i]['subtitle'],
|
||||||
|
icon: BookedButtons.buttons[i]['icon'],
|
||||||
|
caller: BookedButtons.buttons[i]['caller'],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
appoButtonsList = buttonsList;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<AppoDetailsButton>> _getConfirmedAppoActionsList() async {
|
||||||
|
var bookButtonsJson;
|
||||||
|
List<AppoDetailsButton> buttonsList = [];
|
||||||
|
String data = await DefaultAssetBundle.of(context)
|
||||||
|
.loadString("assets/json/bookedButtons.json");
|
||||||
|
bookButtonsJson = json.decode(data);
|
||||||
|
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||||
|
buttonsList.add(AppoDetailsButton(
|
||||||
|
title: bookButtonsJson[i]['title'],
|
||||||
|
subtitle: bookButtonsJson[i]['subtitle'],
|
||||||
|
icon: bookButtonsJson[i]['icon'],
|
||||||
|
caller: bookButtonsJson[i]['caller'],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
appoButtonsList = buttonsList;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<AppoDetailsButton>> _getConfirmedCheckInAppoActionsList() async {
|
||||||
|
var bookButtonsJson;
|
||||||
|
List<AppoDetailsButton> buttonsList = [];
|
||||||
|
String data = await DefaultAssetBundle.of(context)
|
||||||
|
.loadString("assets/json/bookedButtons.json");
|
||||||
|
bookButtonsJson = json.decode(data);
|
||||||
|
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||||
|
buttonsList.add(AppoDetailsButton(
|
||||||
|
title: bookButtonsJson[i]['title'],
|
||||||
|
subtitle: bookButtonsJson[i]['subtitle'],
|
||||||
|
icon: bookButtonsJson[i]['icon'],
|
||||||
|
caller: bookButtonsJson[i]['caller'],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
appoButtonsList = buttonsList;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<AppoDetailsButton>> _getArrivedAppoActionsList() async {
|
||||||
|
var bookButtonsJson;
|
||||||
|
List<AppoDetailsButton> buttonsList = [];
|
||||||
|
String data = await DefaultAssetBundle.of(context)
|
||||||
|
.loadString("assets/json/bookedButtons.json");
|
||||||
|
bookButtonsJson = json.decode(data);
|
||||||
|
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||||
|
buttonsList.add(AppoDetailsButton(
|
||||||
|
title: bookButtonsJson[i]['title'],
|
||||||
|
subtitle: bookButtonsJson[i]['subtitle'],
|
||||||
|
icon: bookButtonsJson[i]['icon'],
|
||||||
|
caller: bookButtonsJson[i]['caller'],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
appoButtonsList = buttonsList;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<AppoDetailsButton>> _getArrivedInvoiceAppoActionsList() async {
|
||||||
|
var bookButtonsJson;
|
||||||
|
List<AppoDetailsButton> buttonsList = [];
|
||||||
|
String data = await DefaultAssetBundle.of(context)
|
||||||
|
.loadString("assets/json/bookedButtons.json");
|
||||||
|
bookButtonsJson = json.decode(data);
|
||||||
|
for (var i = 0; i < bookButtonsJson.length; i++) {
|
||||||
|
buttonsList.add(AppoDetailsButton(
|
||||||
|
title: bookButtonsJson[i]['title'],
|
||||||
|
subtitle: bookButtonsJson[i]['subtitle'],
|
||||||
|
icon: bookButtonsJson[i]['icon'],
|
||||||
|
caller: bookButtonsJson[i]['caller'],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
appoButtonsList = buttonsList;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
//Appointment Model to be used in all the appointment based pages & components
|
||||||
|
|
||||||
|
class AppointmentModel {
|
||||||
|
|
||||||
|
static var SHARED_DATA = 'appointment-model';
|
||||||
|
static var PATIENT_DATA = 'patient-model';
|
||||||
|
var DoctorSpeciality = [];
|
||||||
|
|
||||||
|
var List_HIS_GetContactLensPerscription = [];
|
||||||
|
var List_HIS_GetGlassPerscription = [];
|
||||||
|
var SetupID;
|
||||||
|
var ProjectID;
|
||||||
|
var AppointmentNo;
|
||||||
|
var AppointmentDate;
|
||||||
|
var AppointmentDateN;
|
||||||
|
var AppointmentType;
|
||||||
|
var BookDate;
|
||||||
|
var PatientType;
|
||||||
|
var PatientID;
|
||||||
|
var ClinicID;
|
||||||
|
var DoctorID;
|
||||||
|
var EndDate;
|
||||||
|
var StartTime;
|
||||||
|
var EndTime;
|
||||||
|
var Status;
|
||||||
|
var VisitType;
|
||||||
|
var VisitFor;
|
||||||
|
var PatientStatusType;
|
||||||
|
var CompanyID;
|
||||||
|
var BookedBy;
|
||||||
|
var BookedOn;
|
||||||
|
var ConfirmedBy;
|
||||||
|
var ConfirmedOn;
|
||||||
|
var ArrivalChangedBy;
|
||||||
|
var ArrivedOn;
|
||||||
|
var EditedBy;
|
||||||
|
var EditedOn;
|
||||||
|
var DoctorName;
|
||||||
|
var DoctorNameN;
|
||||||
|
var StatusDesc;
|
||||||
|
var StatusDescN;
|
||||||
|
var VitalStatus;
|
||||||
|
var VitalSignAppointmentNo;
|
||||||
|
var ClinicName;
|
||||||
|
var ComplainExists;
|
||||||
|
var DoctorImageURL;
|
||||||
|
var DoctorNameObj;
|
||||||
|
var DoctorRate;
|
||||||
|
var DoctorTitle;
|
||||||
|
var Gender;
|
||||||
|
var GenderDescription;
|
||||||
|
var IsActiveDoctor;
|
||||||
|
var IsActiveDoctorProfile;
|
||||||
|
var IsExecludeDoctor;
|
||||||
|
var IsMedicalReportRequested;
|
||||||
|
var ProjectName;
|
||||||
|
var QR;
|
||||||
|
var SMSButtonVisable;
|
||||||
|
var DoctorRatingDetailsList;
|
||||||
|
var AvgDoctorRatingList;
|
||||||
|
var IsLiveCareAppointment;
|
||||||
|
var OriginalClinicID;
|
||||||
|
var OriginalProjectID;
|
||||||
|
var StrAppointmentDate;
|
||||||
|
/*
|
||||||
|
the check in parameters
|
||||||
|
*/
|
||||||
|
// if onlince checked in mean user paid the appointment
|
||||||
|
var IsOnlineCheckedIN;
|
||||||
|
|
||||||
|
// if user is allowed to pay for the appointment
|
||||||
|
var ISAllowOnlineCheckedIN;
|
||||||
|
|
||||||
|
var PatientShare;
|
||||||
|
var CompanyName;
|
||||||
|
var PatientTaxAmount;
|
||||||
|
var PatientShareWithTax;
|
||||||
|
var IsFollowup;
|
||||||
|
var IsDoctorAllowVedioCall;
|
||||||
|
|
||||||
|
static String getAppointmentTransID(appo) {
|
||||||
|
return appo.ProjectID + '-' + appo.ClinicID + '-' + appo.AppointmentNo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
class AppointmentType {
|
||||||
|
static var BOOKED = 0;
|
||||||
|
static const BOOKED_STR = 'booked';
|
||||||
|
static var CONFIRMED = 42;
|
||||||
|
static const CONFIRMED_STR = 'confirmed';
|
||||||
|
static var ARRIVED = 43;
|
||||||
|
static const ARRIVED_STR = 'arrived';
|
||||||
|
|
||||||
|
static bool isConfirmed(appo) {
|
||||||
|
return AppointmentType.isValid(appo) &&
|
||||||
|
appo.PatientStatusType == AppointmentType.CONFIRMED;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isBooked(appo) {
|
||||||
|
return AppointmentType.isValid(appo) &&
|
||||||
|
appo.PatientStatusType == AppointmentType.BOOKED;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isArrived(appo) {
|
||||||
|
return AppointmentType.isValid(appo) &&
|
||||||
|
appo.PatientStatusType == AppointmentType.ARRIVED;
|
||||||
|
}
|
||||||
|
|
||||||
|
static isValid(appo) {
|
||||||
|
return appo != null && appo.PatientStatusType != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int getType(typeName) {
|
||||||
|
switch (typeName) {
|
||||||
|
case AppointmentType.BOOKED_STR:
|
||||||
|
return AppointmentType.BOOKED;
|
||||||
|
case AppointmentType.ARRIVED_STR:
|
||||||
|
return AppointmentType.ARRIVED;
|
||||||
|
case AppointmentType.CONFIRMED_STR:
|
||||||
|
return AppointmentType.CONFIRMED;
|
||||||
|
default:
|
||||||
|
return AppointmentType.BOOKED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
|
||||||
|
class BookedButtons {
|
||||||
|
static var context;
|
||||||
|
|
||||||
|
static var buttons = [
|
||||||
|
{
|
||||||
|
"title": TranslationBase.of(context).confirm,
|
||||||
|
"subtitle": TranslationBase.of(context).appointment,
|
||||||
|
"icon": "assets/images/new-design/confirm_icon.png",
|
||||||
|
"caller": "confirmAppointment"
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// "title": "confirm",
|
||||||
|
// "subtitle": "Appointment",
|
||||||
|
// "icon": "assets/images/new-design/confirm_icon.png",
|
||||||
|
// "caller": "confirmAppointment"
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
"title": "reschedule",
|
||||||
|
"subtitle": "appointment",
|
||||||
|
"icon": "assets/images/new-design/reschedule_icon.png",
|
||||||
|
"caller": "openReschedule"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "cancel",
|
||||||
|
"subtitle": "appointment",
|
||||||
|
"icon": "assets/images/new-design/cancel_icon.png",
|
||||||
|
"caller": "onCancelAppointment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "raise",
|
||||||
|
"subtitle": "complaint",
|
||||||
|
"icon": "assets/images/new-design/Complaint_icon.png",
|
||||||
|
"caller": "insertComplaint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "add",
|
||||||
|
"subtitle": "reminder",
|
||||||
|
"icon": "assets/images/new-design/reminder_icon.png",
|
||||||
|
"caller": "addReminder"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "hospital",
|
||||||
|
"subtitle": "locations",
|
||||||
|
"icon": "assets/images/new-design/location_icon.png",
|
||||||
|
"caller": "navigateToProject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "online",
|
||||||
|
"subtitle": "payment",
|
||||||
|
"icon": "assets/images/new-design/check-in.png",
|
||||||
|
"caller": "goToTodoList(31)"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// static getContext(context) {
|
||||||
|
// BookedButtons.context = context;
|
||||||
|
// }
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/upcomingCard.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ToDo extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_ToDoState createState() => _ToDoState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ToDoState extends State<ToDo> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(TranslationBase.of(context).todoList),
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
TodoListCard(),
|
||||||
|
TodoListCard(),
|
||||||
|
TodoListCard(),
|
||||||
|
TodoListCard(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,181 @@
|
|||||||
|
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rating_bar/rating_bar.dart';
|
||||||
|
|
||||||
|
class TodoListCard extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_TodoListCardState createState() => _TodoListCardState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _TodoListCardState extends State<TodoListCard> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.all(10.0),
|
||||||
|
child: Card(
|
||||||
|
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
|
||||||
|
color: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
padding: EdgeInsets.all(10.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
|
Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Image.asset("assets/images/new-design/time_icon.png",
|
||||||
|
width: 20.0, height: 20.0),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 10.0, right: 30.0),
|
||||||
|
child: Text("Monday, 31 August 2020 09:30",
|
||||||
|
style: TextStyle(fontSize: 12.0)),
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
"assets/images/new-design/hospital_address_icon.png",
|
||||||
|
width: 20.0,
|
||||||
|
height: 20.0),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 10.0, right: 10.0),
|
||||||
|
child: Text("Olaya Hospital",
|
||||||
|
style: TextStyle(fontSize: 12.0)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 5.0),
|
||||||
|
child: Divider(
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Flex(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.1,
|
||||||
|
margin: EdgeInsets.only(top: 5.0),
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(100.0),
|
||||||
|
child: Image.network(
|
||||||
|
"https://hmgwebservices.com/Images/MobileImages/OALAY/2477.png",
|
||||||
|
fit: BoxFit.fill),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Container(
|
||||||
|
margin:
|
||||||
|
EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
|
||||||
|
height: MediaQuery.of(context).size.height * 0.1,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Text("Dr. EYAD ISMAIL ABU-JAYAD",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
letterSpacing: 1.0)),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
|
||||||
|
child: Text("General Practioner",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0,
|
||||||
|
color: Colors.grey[600],
|
||||||
|
letterSpacing: 1.0)),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: <Widget>[
|
||||||
|
RatingBar.readOnly(
|
||||||
|
initialRating: 4.0,
|
||||||
|
size: 20.0,
|
||||||
|
filledColor: Colors.yellow[700],
|
||||||
|
emptyColor: Colors.grey[500],
|
||||||
|
isHalfAllowed: true,
|
||||||
|
halfFilledIcon: Icons.star_half,
|
||||||
|
filledIcon: Icons.star,
|
||||||
|
emptyIcon: Icons.star,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.1,
|
||||||
|
margin: EdgeInsets.only(top: 20.0),
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Image.asset(
|
||||||
|
"assets/images/new-design/confirm_button.png",
|
||||||
|
width: 50.0,
|
||||||
|
height: 50.0),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(top: 5.0),
|
||||||
|
child: Text("Confirm",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(fontSize: 12.0)),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
Flex(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Container(
|
||||||
|
child: Text(
|
||||||
|
"Please confirm the appointment to avoid cancellation",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0, color: Colors.grey[700])),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
navigateToAppointmentDetails(context);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
child: Text("More Details",
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.0,
|
||||||
|
color: Colors.red[600],
|
||||||
|
decoration: TextDecoration.underline)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future navigateToAppointmentDetails(context) async {
|
||||||
|
Navigator.push(
|
||||||
|
context, MaterialPageRoute(builder: (context) => AppointmentDetails()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue