cpd_2022_zi/lib/widgets/mood_form.dart

42 lines
1.3 KiB
Dart
Raw Normal View History

2023-02-15 23:02:29 +01:00
import 'package:flutter/material.dart';
2023-02-26 14:59:37 +01:00
import 'package:provider/provider.dart';
2023-03-02 20:16:46 +01:00
import 'package:smoke_cess_app/providers/tasks_provider.dart';
import 'package:smoke_cess_app/services/pages_service.dart';
2023-02-15 23:02:29 +01:00
import 'package:smoke_cess_app/widgets/slider.dart';
2023-02-15 23:28:19 +01:00
import 'package:smoke_cess_app/widgets/submit_form_button.dart';
import 'package:smoke_cess_app/widgets/text_formfield.dart';
2023-02-15 23:02:29 +01:00
2023-02-26 14:59:37 +01:00
import '../providers/input_provider.dart';
2023-02-21 20:56:10 +01:00
import 'elevated_card.dart';
class MoodForm extends StatelessWidget {
2023-02-15 23:02:29 +01:00
const MoodForm({super.key});
@override
Widget build(BuildContext context) {
var inputModel = context.watch<InputProvider>();
2023-03-02 20:16:46 +01:00
var tasksModel = context.watch<TasksProvider>();
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
2023-02-26 17:09:25 +01:00
const ElevatedCard(
title: 'Stimmungsbewertung',
child: MySlider(),
),
const SizedBox(height: 16),
const ElevatedCard(
title: 'Beschreibe deine Stimmung',
child: MyTextFormField('Beschreibe deine Stimmung'),
),
2023-02-26 17:09:25 +01:00
const SizedBox(
height: 80,
),
2023-02-27 20:02:15 +01:00
SubmitFormButton(
submitCallback: inputModel.saveMood,
2023-03-02 20:16:46 +01:00
updateTasks: () => tasksModel.setTaksDone(Pages.mood),
)
],
);
2023-02-15 23:02:29 +01:00
}
}