shcedule page

merge-update-with-lab-changes
Sultan Khan 4 years ago
parent abcd207554
commit 233a273316

@ -44,7 +44,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
TabController _tabController;
bool showFooterButton = false;
var event = RobotProvider();
dynamic doctorSchedule;
AppSharedPreferences sharedPref = AppSharedPreferences();
List<DoctorRateDetails> doctorDetailsList = List();
@ -122,7 +122,11 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
FadePage(
page: SchedulePage(doctorList: widget.doctor),
),
);
).then((value) {
setState(() {
this.doctorSchedule = value;
});
});
},
onRatingAndReviewTap: () {
getDoctorRatingsDetails();
@ -170,7 +174,11 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
physics: NeverScrollableScrollPhysics(),
children: [
DoctorInformation(docProfileList: widget.docProfileList),
DocAvailableAppointments(doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment),
DocAvailableAppointments(
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
doctorSchedule: doctorSchedule,
),
],
controller: _tabController,
),

@ -24,10 +24,7 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedTime;
bool isLiveCareAppointment;
final dynamic doctorSchedule;
DocAvailableAppointments(
{@required this.doctor,
this.doctorSchedule,
@required this.isLiveCareAppointment});
DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment});
@override
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState();
@ -55,6 +52,15 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
var language;
@override
void didUpdateWidget(covariant DocAvailableAppointments oldWidget) {
if (oldWidget.doctorSchedule != widget.doctorSchedule) {
_calendarController.setSelectedDay(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), isProgrammatic: true);
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), List());
}
super.didUpdateWidget(oldWidget);
}
@override
void initState() {
// TODO: implement initState
@ -121,7 +127,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
children: <Widget>[
_buildTableCalendarWithBuilders(),
Padding(
padding: const EdgeInsets.only(left: 16,right: 16,bottom: 16),
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
),
Container(
@ -132,12 +138,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: (index==dayEvents.length-1)?16:5.0,left: index==0?16:5),
margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color:index == selectedButtonIndex ? CustomColors.green:Colors.black, //Color of the border
color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border
),
@ -345,14 +351,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_events = value,
if (widget.doctorSchedule != null)
{
_calendarController.setSelectedDay(
DateUtil.convertStringToDate(
widget.doctorSchedule['Date']),
isProgrammatic: true),
_onDaySelected(
DateUtil.convertStringToDate(
widget.doctorSchedule['Date']),
List())
_calendarController.setSelectedDay(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), isProgrammatic: true),
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), List())
}
});
});

@ -28,7 +28,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
class AppointmentDetails extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
static bool isLoading = false;
final dynamic doctorSchedule;
dynamic doctorSchedule;
static bool showFooterButton = false;
final int parentIndex;
@ -182,9 +182,13 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
Navigator.push(
context,
FadePage(
page: SchedulePage(doctorList: doctorList),
page: SchedulePage(doctorList: doctorList, appo: widget.appo),
),
);
).then((value) {
setState(() {
widget.doctorSchedule = value;
});
});
},
),
SizedBox(height: 10),
@ -586,7 +590,13 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}
void openSchedule() {
Navigator.push(context, FadePage(page: SchedulePage(doctorList: getDoctorObject())));
Navigator.push(
context,
FadePage(
page: SchedulePage(
doctorList: getDoctorObject(),
appo: widget.appo,
)));
}
setTab() async {

@ -17,8 +17,8 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
class SchedulePage extends StatefulWidget {
final DoctorList doctorList;
final AppoitmentAllHistoryResultList appo;
DoctorList doctorList;
AppoitmentAllHistoryResultList appo;
SchedulePage({
this.appo,
this.doctorList,
@ -202,14 +202,15 @@ class _SchedulePageState extends State<SchedulePage> {
openBookAppointment(selectedDate) {
//sharedPref.setObject(DOCTOR_SCHEDULE_DATE_SEL, selectedDate);
Navigator.push(
context,
FadePage(
page: AppointmentDetails(
appo: widget.appo,
doctorSchedule: selectedDate,
),
),
);
Navigator.of(context).pop(selectedDate);
// Navigator.push(
// context,
// FadePage(
// page: AppointmentDetails(
// appo: widget.appo,
// doctorSchedule: selectedDate,
// ),
// ),
// );
}
}

Loading…
Cancel
Save