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(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
monthDateSelector,
|
monthDateSelector,
|
||||||
const Divider(),
|
const Divider(height: 1),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
calendarGrid,
|
calendarGrid,
|
||||||
],
|
],
|
||||||
|
|
|
@ -43,28 +43,26 @@ class CalendarGrid extends StatelessWidget {
|
||||||
return translations.weekDayAbbreviatedFormatter(context, day);
|
return translations.weekDayAbbreviatedFormatter(context, day);
|
||||||
});
|
});
|
||||||
|
|
||||||
var calendarDaysRow = GridView.builder(
|
var calendarDaysRow = Row(
|
||||||
padding: EdgeInsets.zero,
|
children: List.generate(13, (index) {
|
||||||
shrinkWrap: true,
|
// This adds a space between the days of the week
|
||||||
itemCount: 7,
|
if ((index % 2).isOdd) return const SizedBox(width: 12);
|
||||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 7,
|
var day = dayNames[index ~/ 2];
|
||||||
crossAxisSpacing: 12,
|
return Expanded(
|
||||||
mainAxisSpacing: 0,
|
child: Text(
|
||||||
),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
var day = dayNames[index];
|
|
||||||
return Text(
|
|
||||||
day,
|
day,
|
||||||
style: textTheme.bodyLarge,
|
style: textTheme.bodyLarge,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
calendarDaysRow,
|
calendarDaysRow,
|
||||||
|
const SizedBox(height: 10),
|
||||||
GridView.builder(
|
GridView.builder(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
|
|
Loading…
Reference in a new issue