mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-05-10 19:50:35 +00:00
- Added UpcomingUIModel for managing upcoming manga list items with headers and items. - Introduced CalendarDay widget to display individual days with event indicators. - Created CalendarHeader widget for navigating between months. - Developed CalendarIndicator for visualizing events on specific days. - Implemented UpcomingCalendar to manage the calendar view and event loading. - Added UpcomingItem widget for displaying individual upcoming manga with cover images. - Introduced FetchInterval utility to calculate fetch intervals based on chapter upload dates. - Refactored updateMangaDetail to utilize FetchInterval for smart update days. - Enhanced MedianExtension to ensure correct median calculation. - Removed unused imports and commented-out code for cleaner implementation.
63 lines
1.8 KiB
Dart
63 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:intl/intl.dart';
|
|
|
|
class CalendarHeader extends StatelessWidget {
|
|
final DateTime yearMonth;
|
|
final VoidCallback onPreviousClick;
|
|
final VoidCallback onNextClick;
|
|
|
|
const CalendarHeader({
|
|
required this.yearMonth,
|
|
required this.onPreviousClick,
|
|
required this.onNextClick,
|
|
super.key,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
final locale = Localizations.localeOf(context);
|
|
final formatter = DateFormat('MMMM yyyy', locale.toLanguageTag());
|
|
final title = formatter.format(yearMonth);
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
AnimatedSwitcher(
|
|
duration: const Duration(milliseconds: 200),
|
|
transitionBuilder: (child, animation) => FadeTransition(
|
|
opacity: animation,
|
|
child: SlideTransition(
|
|
position: Tween<Offset>(
|
|
begin: const Offset(0, 0.3),
|
|
end: Offset.zero,
|
|
).animate(animation),
|
|
child: child,
|
|
),
|
|
),
|
|
child: Text(
|
|
title,
|
|
key: ValueKey(title),
|
|
style: theme.textTheme.titleLarge,
|
|
),
|
|
),
|
|
Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
IconButton(
|
|
icon: const Icon(Icons.keyboard_arrow_left),
|
|
onPressed: onPreviousClick,
|
|
),
|
|
IconButton(
|
|
icon: const Icon(Icons.keyboard_arrow_right),
|
|
onPressed: onNextClick,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|