We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This code was working fine suddenly In release mode the calendar screen is blank and in debug mode it's working
@OverRide void initState() { _focusedDay = DateTime.now(); super.initState();
}
TableCalendar( firstDay: DateTime.utc(_startYear, _startMonth, _startDate), lastDay: DateTime.utc(_endYear, _endMonth, _endDate), focusedDay: _focusedDay, rowHeight: 45, calendarFormat: _calendarFormat, startingDayOfWeek: StartingDayOfWeek.monday, selectedDayPredicate: (day) { return isSameDay(_selectedDay, day); }, onDaySelected: (selectedDay, focusedDay) { print("selected date is " + selectedDay.toString()); var dayOfWeek = DateFormat.EEEE().format(selectedDay); // widget.foodDateSelectionCallback.onFoodDateSelected( // selectedDay.toString().split(" ")[0], dayOfWeek); // Navigator.pop(context);
if (!isSameDay(_selectedDay, selectedDay)) { setState(() { _selectedDay = selectedDay; _focusedDay = focusedDay; }); } }, onPageChanged: (focusedDay) { _focusedDay = focusedDay; presentMonth = focusedDay.month.toString(); getCalendarEvents(); //Helper.showToast(presentMonth); }, locale: 'en_US', calendarStyle: CalendarStyle( outsideDaysVisible: false, weekendTextStyle: TextStyle( color: Colors.red, fontFamily: 'PoppinsMedium', fontSize: AppFontSize.font_medium), defaultTextStyle: TextStyle( color: Colors.black, fontFamily: 'PoppinsMedium', fontSize: AppFontSize.font_medium)), daysOfWeekStyle: DaysOfWeekStyle( weekendStyle: TextStyle( color: Colors.black, fontFamily: 'PoppinsMedium', fontSize: AppFontSize.font_medium), weekdayStyle: TextStyle( color: Colors.black, fontFamily: 'PoppinsMedium', fontSize: AppFontSize.font_medium), ), headerStyle: HeaderStyle( titleCentered: true, formatButtonVisible: false, titleTextStyle: TextStyle( color: Colors.black, fontFamily: 'PoppinsMedium', fontSize: AppFontSize.font_medium)), ),
The text was updated successfully, but these errors were encountered:
error isSameDat(focusday,lastday)|| focusday.isBefore(lastDay) is not true
Looks like your _focusedDay is after your lastDay. It has to be between the firstDay and the lastDay in order for the widget to work properly.
_focusedDay
lastDay
firstDay
Sorry, something went wrong.
No branches or pull requests
This code was working fine suddenly In release mode the calendar screen is blank and in debug mode it's working
@OverRide
void initState() {
_focusedDay = DateTime.now();
super.initState();
}
TableCalendar(
firstDay:
DateTime.utc(_startYear, _startMonth, _startDate),
lastDay: DateTime.utc(_endYear, _endMonth, _endDate),
focusedDay: _focusedDay,
rowHeight: 45,
calendarFormat: _calendarFormat,
startingDayOfWeek: StartingDayOfWeek.monday,
selectedDayPredicate: (day) {
return isSameDay(_selectedDay, day);
},
onDaySelected: (selectedDay, focusedDay) {
print("selected date is " + selectedDay.toString());
var dayOfWeek = DateFormat.EEEE().format(selectedDay);
// widget.foodDateSelectionCallback.onFoodDateSelected(
// selectedDay.toString().split(" ")[0], dayOfWeek);
// Navigator.pop(context);
The text was updated successfully, but these errors were encountered: