cpd_2022_zi/lib/widgets/mood_form.dart

41 lines
1.2 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-02-22 01:28:01 +01:00
import 'package:smoke_cess_app/models/mood.dart';
2023-02-26 14:10:06 +01:00
import 'package:smoke_cess_app/services/database_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>();
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,
),
ElevatedButton(
onPressed: () => inputModel.saveMood(),
child: const Text('Speichern'),
)
],
);
2023-02-15 23:02:29 +01:00
}
}