This commit is contained in:
mso7nueh
2026-03-17 12:18:25 +03:00
69 changed files with 2813 additions and 630 deletions

View File

@@ -8,7 +8,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:table_calendar/table_calendar.dart';
class CalendarWidget extends StatefulWidget {
const CalendarWidget({super.key});
const CalendarWidget({super.key, this.date});
final DateTime? date;
@override
State<CalendarWidget> createState() => _CalendarWidgetState();
@@ -18,6 +19,23 @@ class _CalendarWidgetState extends State<CalendarWidget> {
CalendarFormat _calendarFormat = CalendarFormat.week;
DateTime _focusedDay = DateTime.now();
DateTime _selectedDay = DateTime.now();
@override
void initState() {
super.initState();
if (widget.date != null) {
_selectedDay = widget.date!;
_focusedDay = widget.date!;
}
}
@override
void didUpdateWidget(CalendarWidget oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.date != null && widget.date != oldWidget.date) {
_selectedDay = widget.date!;
_focusedDay = widget.date!;
}
}
@override
Widget build(BuildContext context) {