feat(App): update Finlytic Flutter app UI and blocs

This commit is contained in:
2026-08-09 21:01:46 +02:00
parent e7427b7464
commit a708d2977c
591 changed files with 1095105 additions and 0 deletions
@@ -0,0 +1,70 @@
import 'package:equatable/equatable.dart';
import 'package:finlytic_app/features/calendar/models/corporate_event_model.dart';
abstract class CalendarState extends Equatable {
const CalendarState();
@override
List<Object?> get props => [];
}
class CalendarInitial extends CalendarState {}
class CalendarLoading extends CalendarState {}
class CalendarLoaded extends CalendarState {
final List<CorporateEventModel> allEvents;
final String selectedCategory;
final DateTime currentMonth;
final DateTime? selectedDate;
const CalendarLoaded({
required this.allEvents,
this.selectedCategory = 'Alle',
required this.currentMonth,
this.selectedDate,
});
List<CorporateEventModel> get filteredEvents {
return allEvents.where((e) {
if (selectedCategory != 'Alle' && e.eventType != selectedCategory) {
return false;
}
if (selectedDate != null) {
if (e.eventDate.year != selectedDate!.year ||
e.eventDate.month != selectedDate!.month ||
e.eventDate.day != selectedDate!.day) {
return false;
}
}
return true;
}).toList();
}
CalendarLoaded copyWith({
List<CorporateEventModel>? allEvents,
String? selectedCategory,
DateTime? currentMonth,
DateTime? selectedDate,
bool clearSelectedDate = false,
}) {
return CalendarLoaded(
allEvents: allEvents ?? this.allEvents,
selectedCategory: selectedCategory ?? this.selectedCategory,
currentMonth: currentMonth ?? this.currentMonth,
selectedDate: clearSelectedDate ? null : (selectedDate ?? this.selectedDate),
);
}
@override
List<Object?> get props => [allEvents, selectedCategory, currentMonth, selectedDate];
}
class CalendarError extends CalendarState {
final String message;
const CalendarError(this.message);
@override
List<Object?> get props => [message];
}