mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-19 13:13:44 +02:00
fix: add correct spacing around calendar day header
This commit is contained in:
parent
440b1e7caa
commit
1b8aa07874
2 changed files with 15 additions and 17 deletions
|
@ -113,7 +113,7 @@ class CalendarView extends StatelessWidget {
|
|||
return Column(
|
||||
children: [
|
||||
monthDateSelector,
|
||||
const Divider(),
|
||||
const Divider(height: 1),
|
||||
const SizedBox(height: 20),
|
||||
calendarGrid,
|
||||
],
|
||||
|
|
|
@ -43,28 +43,26 @@ class CalendarGrid extends StatelessWidget {
|
|||
return translations.weekDayAbbreviatedFormatter(context, day);
|
||||
});
|
||||
|
||||
var calendarDaysRow = GridView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
itemCount: 7,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 7,
|
||||
crossAxisSpacing: 12,
|
||||
mainAxisSpacing: 0,
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
var day = dayNames[index];
|
||||
return Text(
|
||||
day,
|
||||
style: textTheme.bodyLarge,
|
||||
textAlign: TextAlign.center,
|
||||
var calendarDaysRow = Row(
|
||||
children: List.generate(13, (index) {
|
||||
// This adds a space between the days of the week
|
||||
if ((index % 2).isOdd) return const SizedBox(width: 12);
|
||||
|
||||
var day = dayNames[index ~/ 2];
|
||||
return Expanded(
|
||||
child: Text(
|
||||
day,
|
||||
style: textTheme.bodyLarge,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
);
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
calendarDaysRow,
|
||||
const SizedBox(height: 10),
|
||||
GridView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
|
|
Loading…
Reference in a new issue