mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-19 05:03:44 +02:00
fix: revert calendar UI changes from bad rebase
This commit is contained in:
parent
67842ed2f5
commit
5931b4c29a
1 changed files with 24 additions and 9 deletions
|
@ -115,6 +115,8 @@ class _CalendarDay extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var theme = Theme.of(context);
|
||||
var textTheme = theme.textTheme;
|
||||
var colorScheme = theme.colorScheme;
|
||||
var availabilityScope = AvailabilityScope.of(context);
|
||||
var options = availabilityScope.options;
|
||||
var colors = options.colors;
|
||||
|
@ -125,30 +127,43 @@ class _CalendarDay extends StatelessWidget {
|
|||
Color? textColor;
|
||||
TextStyle? textStyle;
|
||||
if (day.outsideMonth) {
|
||||
textColor = colors.outsideMonthTextColor ?? theme.colorScheme.onSurface;
|
||||
textStyle = theme.textTheme.bodyMedium?.copyWith(color: textColor);
|
||||
textColor = colors.outsideMonthTextColor ?? colorScheme.onSurface;
|
||||
textStyle = textTheme.bodyMedium?.copyWith(color: textColor);
|
||||
} else if (day.hasAvailability) {
|
||||
textColor = dayColor;
|
||||
textStyle = theme.textTheme.titleMedium?.copyWith(color: textColor);
|
||||
textStyle = textTheme.titleMedium?.copyWith(color: textColor);
|
||||
}
|
||||
|
||||
var decoration = day.outsideMonth
|
||||
? null
|
||||
: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: textColor ?? Colors.transparent,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return InkWell(
|
||||
onTap: () => onDayTap(day.date),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: dayColor,
|
||||
borderRadius: options.borderRadius,
|
||||
border: Border.all(
|
||||
color: day.isSelected && !day.outsideMonth
|
||||
? theme.colorScheme.primary
|
||||
: Colors.transparent,
|
||||
color: day.isSelected ? theme.dividerColor : Colors.transparent,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
decoration: decoration,
|
||||
child: Text(day.date.day.toString(), style: textStyle),
|
||||
),
|
||||
),
|
||||
if (day.templateDeviation) ...[
|
||||
Positioned(
|
||||
right: 4,
|
||||
|
@ -236,7 +251,7 @@ List<CalendarDay> _generateCalendarDays(
|
|||
for (var i = 0; i < count; i++) {
|
||||
var day = isNextMonth
|
||||
? DateTime(startDay.year, startDay.month, startDay.day + i + 1)
|
||||
: DateTime(startDay.year, startDay.month, startDay.day - count - 1);
|
||||
: DateTime(startDay.year, startDay.month, startDay.day - count + i);
|
||||
var isSelected = selectedRange != null &&
|
||||
!day.isBefore(selectedRange.start) &&
|
||||
!day.isAfter(selectedRange.end);
|
||||
|
|
Loading…
Reference in a new issue