2023-02-26 23:30:00 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
2023-02-27 02:28:26 +01:00
|
|
|
import 'package:smoke_cess_app/widgets/drop_down.dart';
|
2023-02-26 23:30:00 +01:00
|
|
|
import 'package:smoke_cess_app/widgets/text_formfield.dart';
|
|
|
|
|
|
|
|
import '../providers/input_provider.dart';
|
2023-02-27 02:35:17 +01:00
|
|
|
import '../providers/settings_provider.dart';
|
2023-02-26 23:30:00 +01:00
|
|
|
import 'elevated_card.dart';
|
|
|
|
|
|
|
|
class RelapseForm extends StatelessWidget {
|
|
|
|
const RelapseForm({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
var inputModel = context.watch<InputProvider>();
|
2023-02-27 02:35:17 +01:00
|
|
|
var settings = context.watch<SettingsProvider>();
|
2023-02-26 23:30:00 +01:00
|
|
|
return Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
2023-02-27 02:35:17 +01:00
|
|
|
ElevatedCard(
|
2023-02-27 02:28:26 +01:00
|
|
|
title: 'Rückfallkategorie',
|
2023-02-27 02:35:17 +01:00
|
|
|
child: DropDown(settings.settings?.relapseCategories ?? []),
|
2023-02-27 02:28:26 +01:00
|
|
|
),
|
2023-02-26 23:30:00 +01:00
|
|
|
const ElevatedCard(
|
|
|
|
title: 'Beschreibe deinen Rückfall',
|
|
|
|
child: MyTextFormField('Beschreibe deinen Rückfall'),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
height: 80,
|
|
|
|
),
|
|
|
|
ElevatedButton(
|
2023-02-27 02:28:26 +01:00
|
|
|
onPressed: () => inputModel.saveRelapse(),
|
2023-02-26 23:30:00 +01:00
|
|
|
child: const Text('Speichern'),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|