import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:smoke_cess_app/widgets/history_list_widget.dart'; import 'package:smoke_cess_app/widgets/line_chart_widget.dart'; import 'package:syncfusion_flutter_charts/charts.dart'; import 'package:smoke_cess_app/models/mood.dart'; import 'package:smoke_cess_app/providers/tasks_provider.dart'; class MoodView extends StatelessWidget { const MoodView({super.key}); @override Widget build(BuildContext context) { var tasksModel = context.watch(); return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ LineChart(series: [ LineSeries( dataSource: tasksModel.moodHistory, xValueMapper: (Mood value, _) => value.date, yValueMapper: (Mood value, _) => value.moodValue) ]), HistoryList( history: tasksModel.moodHistory, dateSelector: (Mood mood) => mood.date, entryDataSelector: (Mood mood) => 'Stimmung: ${mood.moodValue}', entryCommentSelector: (Mood mood) => 'Kommentar: ${mood.comment}', iconDataSelector: (Mood mood) => mood.moodValue >= 50 ? Icons.mood_outlined : Icons.mood_bad_outlined, ) ], ); } }