From a574e7f718f2fd94e064664b47d744898fa6abbb Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Sun, 26 Feb 2023 23:30:00 +0100 Subject: [PATCH] Add relapse form --- lib/pages/relapse_page.dart | 9 ++++++++- lib/widgets/relapse_form.dart | 31 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 lib/widgets/relapse_form.dart diff --git a/lib/pages/relapse_page.dart b/lib/pages/relapse_page.dart index 7710e10..75e007d 100644 --- a/lib/pages/relapse_page.dart +++ b/lib/pages/relapse_page.dart @@ -1,10 +1,17 @@ import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:smoke_cess_app/widgets/relapse_form.dart'; +import '../providers/input_provider.dart'; class RelapsePage extends StatelessWidget { const RelapsePage({super.key}); @override Widget build(BuildContext context) { - return const Center(child: Text('Hier werden Rückfälle dokumentiert')); + return Center( + child: ChangeNotifierProvider( + create: (context) => InputProvider(), + child: const RelapseForm(), + )); } } diff --git a/lib/widgets/relapse_form.dart b/lib/widgets/relapse_form.dart new file mode 100644 index 0000000..825e303 --- /dev/null +++ b/lib/widgets/relapse_form.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:smoke_cess_app/widgets/text_formfield.dart'; + +import '../providers/input_provider.dart'; +import 'elevated_card.dart'; + +class RelapseForm extends StatelessWidget { + const RelapseForm({super.key}); + + @override + Widget build(BuildContext context) { + var inputModel = context.watch(); + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const ElevatedCard( + title: 'Beschreibe deinen Rückfall', + child: MyTextFormField('Beschreibe deinen Rückfall'), + ), + const SizedBox( + height: 80, + ), + ElevatedButton( + onPressed: () {}, + child: const Text('Speichern'), + ) + ], + ); + } +}