|
|
|
|
@ -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())
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|