mirror of
https://github.com/Iconica-Development/flutter_date_time_picker.git
synced 2025-05-19 10:53:51 +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;
|
int addedIndex = 0;
|
||||||
|
|
||||||
if (daysToSkip >= 7) {
|
if (daysToSkip >= DateTime.daysPerWeek) {
|
||||||
addedIndex = 7;
|
addedIndex = DateTime.daysPerWeek;
|
||||||
}
|
}
|
||||||
|
|
||||||
int length = DateTime(date.year, date.month).daysInMonth() + daysToSkip;
|
int length = DateTime(date.year, date.month).daysInMonth() + daysToSkip;
|
||||||
int daysToAdd = 7 - length % 7;
|
int daysToAdd = DateTime.daysPerWeek - length % DateTime.daysPerWeek;
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
if (showWeekDays) ...[
|
if (showWeekDays) ...[
|
||||||
|
@ -72,7 +72,7 @@ class DatePicker extends StatelessWidget {
|
||||||
Expanded(
|
Expanded(
|
||||||
child: GridView.count(
|
child: GridView.count(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
crossAxisCount: 7,
|
crossAxisCount: DateTime.daysPerWeek,
|
||||||
children: List.generate(
|
children: List.generate(
|
||||||
length + daysToAdd,
|
length + daysToAdd,
|
||||||
(index) {
|
(index) {
|
||||||
|
|
Loading…
Reference in a new issue