cpd_2022_zi/lib/widgets/relapse_form.dart

39 lines
1.1 KiB
Dart
Raw Normal View History

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>();
var settingsModel = 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',
child: DropDown(settingsModel.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'),
)
],
);
}
}