25 lines
841 B
Dart
25 lines
841 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:smoke_cess_app/models/relapse.dart';
|
|
import 'package:smoke_cess_app/providers/tasks_provider.dart';
|
|
import 'package:smoke_cess_app/widgets/history_list_widget.dart';
|
|
|
|
class RelapseView extends StatelessWidget {
|
|
const RelapseView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
TasksProvider tasksModel = context.watch<TasksProvider>();
|
|
return Column(children: [
|
|
HistoryList<Relapse>(
|
|
history: tasksModel.relapseHistory,
|
|
dateSelector: (Relapse relapse) => relapse.date,
|
|
entryDataSelector: (Relapse relapse) => relapse.category,
|
|
entryCommentSelector: (Relapse relapse) =>
|
|
'Kommentar: ${relapse.comment}',
|
|
icon: Icons.smoke_free_outlined,
|
|
)
|
|
]);
|
|
}
|
|
}
|