mirror of
https://github.com/Iconica-Development/flutter_date_time_picker.git
synced 2025-05-18 18:33:49 +02:00
Change magic number 7 for DateTime.daysPerWeek
This commit is contained in:
parent
2fe07a9747
commit
900b88a442
1 changed files with 4 additions and 4 deletions
|
@ -38,12 +38,12 @@ class DatePicker extends StatelessWidget {
|
|||
|
||||
int addedIndex = 0;
|
||||
|
||||
if (daysToSkip >= 7) {
|
||||
addedIndex = 7;
|
||||
if (daysToSkip >= DateTime.daysPerWeek) {
|
||||
addedIndex = DateTime.daysPerWeek;
|
||||
}
|
||||
|
||||
int length = DateTime(date.year, date.month).daysInMonth() + daysToSkip;
|
||||
int daysToAdd = 7 - length % 7;
|
||||
int daysToAdd = DateTime.daysPerWeek - length % DateTime.daysPerWeek;
|
||||
return Column(
|
||||
children: [
|
||||
if (showWeekDays) ...[
|
||||
|
@ -72,7 +72,7 @@ class DatePicker extends StatelessWidget {
|
|||
Expanded(
|
||||
child: GridView.count(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
crossAxisCount: 7,
|
||||
crossAxisCount: DateTime.daysPerWeek,
|
||||
children: List.generate(
|
||||
length + daysToAdd,
|
||||
(index) {
|
||||
|
|
Loading…
Reference in a new issue