Warnings removed
parent
1c0734b6e7
commit
58080c09f1
|
|
@ -201,8 +201,8 @@ class _CalendarTabState extends State<CalendarTab> {
|
|||
final timeParts = (timeStr as String).split(':');
|
||||
if (timeParts.length != 2) return;
|
||||
|
||||
final hour = int.tryParse(timeParts[0]) ?? 0;
|
||||
final minute = int.tryParse(timeParts[1]) ?? 0;
|
||||
//final hour = int.tryParse(timeParts[0]) ?? 0;
|
||||
//final minute = int.tryParse(timeParts[1]) ?? 0;
|
||||
final duration = trainingDurations[day] ?? 60;
|
||||
final targetWeekday = weekdays[day] ?? 1;
|
||||
|
||||
|
|
@ -391,7 +391,7 @@ class _CalendarTabState extends State<CalendarTab> {
|
|||
),
|
||||
],
|
||||
),
|
||||
) ?? false;
|
||||
); //?? false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -512,7 +512,7 @@ class _CalendarTabState extends State<CalendarTab> {
|
|||
if (trainingId != null && trainingId.startsWith('weekly_')) {
|
||||
// Füge das Datum zu cancelledTrainings hinzu, wenn es noch nicht existiert
|
||||
if (!cancelledTrainings.any((cancelled) =>
|
||||
cancelled is Map<String, dynamic> &&
|
||||
//cancelled is Map<String, dynamic> &&
|
||||
cancelled['date'] == dateString
|
||||
)) {
|
||||
cancelledTrainings.add({
|
||||
|
|
@ -552,7 +552,7 @@ class _CalendarTabState extends State<CalendarTab> {
|
|||
// Wenn an diesem Tag kein regelmäßiges Training stattfindet, entferne den Eintrag aus cancelledTrainings
|
||||
if (!trainingTimes.containsKey(weekdayName)) {
|
||||
cancelledTrainings.removeWhere((cancelled) =>
|
||||
cancelled is Map<String, dynamic> &&
|
||||
//cancelled is Map<String, dynamic> &&
|
||||
cancelled.containsKey('date') &&
|
||||
cancelled['date'] == dateString
|
||||
);
|
||||
|
|
@ -671,25 +671,6 @@ class _CalendarTabState extends State<CalendarTab> {
|
|||
}
|
||||
}
|
||||
|
||||
int _getDaysUntilNext(String day, int currentWeekday) {
|
||||
final weekdays = {
|
||||
'Montag': 1,
|
||||
'Dienstag': 2,
|
||||
'Mittwoch': 3,
|
||||
'Donnerstag': 4,
|
||||
'Freitag': 5,
|
||||
'Samstag': 6,
|
||||
'Sonntag': 7,
|
||||
};
|
||||
|
||||
final targetWeekday = weekdays[day] ?? 1;
|
||||
var daysUntilNext = targetWeekday - currentWeekday;
|
||||
if (daysUntilNext <= 0) {
|
||||
daysUntilNext += 7;
|
||||
}
|
||||
return daysUntilNext;
|
||||
}
|
||||
|
||||
List<Map<String, dynamic>> _getEventsForDay(DateTime day) {
|
||||
final normalizedDate = DateTime(day.year, day.month, day.day);
|
||||
return _events[normalizedDate] ?? [];
|
||||
|
|
@ -1141,7 +1122,7 @@ class _CalendarTabState extends State<CalendarTab> {
|
|||
// Wenn an diesem Tag ein regelmäßiges Training stattfindet, füge es zu cancelledTrainings hinzu
|
||||
if (trainingTimes.containsKey(weekdayName)) {
|
||||
if (!cancelledTrainings.any((cancelled) =>
|
||||
cancelled is Map<String, dynamic> &&
|
||||
//cancelled is Map<String, dynamic> &&
|
||||
cancelled['date'] == dateString
|
||||
)) {
|
||||
cancelledTrainings.add({
|
||||
|
|
@ -1151,7 +1132,7 @@ class _CalendarTabState extends State<CalendarTab> {
|
|||
} else {
|
||||
// Wenn kein regelmäßiges Training stattfindet, entferne den Eintrag aus cancelledTrainings
|
||||
cancelledTrainings.removeWhere((cancelled) =>
|
||||
cancelled is Map<String, dynamic> &&
|
||||
//cancelled is Map<String, dynamic> &&
|
||||
cancelled.containsKey('date') &&
|
||||
cancelled['date'] == dateString
|
||||
);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||
final exercisesSnapshot = await FirebaseFirestore.instance.collection('Training').get();
|
||||
|
||||
final allExercises = exercisesSnapshot.docs.map((doc) {
|
||||
return {'id': doc.id, ...doc.data() as Map<String, dynamic>};
|
||||
return {'id': doc.id, ...doc.data()};
|
||||
}).toList();
|
||||
|
||||
// 3. Filter for unused and highly rated exercises
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class ProfileTab extends StatefulWidget {
|
|||
|
||||
class _ProfileTabState extends State<ProfileTab> {
|
||||
// Form key for validating the profile form.
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
//final _formKey = GlobalKey<FormState>();
|
||||
// Indicates if the user is a trainer.
|
||||
bool _isTrainer = false;
|
||||
// Indicates if data is currently loading.
|
||||
|
|
@ -157,7 +157,7 @@ class _ProfileTabState extends State<ProfileTab> {
|
|||
|
||||
// Remove cancelledTrainings for these dates.
|
||||
cancelledTrainings.removeWhere((cancelled) =>
|
||||
cancelled is Map<String, dynamic> &&
|
||||
//cancelled is Map<String, dynamic> &&
|
||||
cancelled.containsKey('date') &&
|
||||
newTrainingDates.contains(cancelled['date'])
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue