Skip to content

Commit

Permalink
Update complex example
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksanderwozniak committed Oct 30, 2022
1 parent a67f3ad commit 0e7222d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion example/lib/pages/complex_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ class TableComplexExample extends StatefulWidget {
}

class _TableComplexExampleState extends State<TableComplexExample> {
late final PageController _pageController;
late final ValueNotifier<List<Event>> _selectedEvents;
final ValueNotifier<DateTime> _focusedDay = ValueNotifier(DateTime.now());
final Set<DateTime> _selectedDays = LinkedHashSet<DateTime>(
equals: isSameDay,
hashCode: getHashCode,
);

late PageController _pageController;
CalendarFormat _calendarFormat = CalendarFormat.month;
RangeSelectionMode _rangeSelectionMode = RangeSelectionMode.toggledOff;
DateTime? _rangeStart;
Expand Down
4 changes: 3 additions & 1 deletion lib/src/widgets/calendar_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ class CalendarPage extends StatelessWidget {

Widget _buildWeekNumbers(BuildContext context) {
final rowAmount = visibleDays.length ~/ 7;

return Column(
children: [
if (dowVisible) SizedBox(height: dowHeight ?? 0),
...List.generate(rowAmount, (index) => index * 7)
.map((index) => Expanded(
child: weekNumberBuilder!(context, visibleDays[index])))
child: weekNumberBuilder!(context, visibleDays[index]),
))
.toList()
],
);
Expand Down

0 comments on commit 0e7222d

Please sign in to comment.