cpd_2022_zi/lib/widgets/mood_form.dart

45 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-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});
2023-02-26 14:59:37 +01:00
void submitForm(BuildContext context) {
var inputModel = context.watch<InputProvider>();
2023-02-15 23:28:19 +01:00
}
2023-02-15 23:02:29 +01:00
@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
}
}