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';
|
|
|
|
|
2023-02-26 16:17:57 +01:00
|
|
|
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) {
|
2023-02-26 16:17:57 +01:00
|
|
|
var inputModel = context.watch<InputProvider>();
|
|
|
|
return Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
2023-02-26 17:09:25 +01:00
|
|
|
const ElevatedCard(
|
2023-02-26 16:17:57 +01:00
|
|
|
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-26 16:17:57 +01:00
|
|
|
ElevatedButton(
|
|
|
|
onPressed: () => inputModel.saveMood(),
|
|
|
|
child: const Text('Speichern'),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
2023-02-15 23:02:29 +01:00
|
|
|
}
|
|
|
|
}
|