From 40f03ec1776671d63bc5a5185ca2ea0f234e5592 Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Sun, 5 Mar 2023 17:33:27 +0100 Subject: [PATCH] wip layout add button --- lib/widgets/round_button_widget.dart | 6 +++++- lib/widgets/view_form_page.dart | 14 ++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/widgets/round_button_widget.dart b/lib/widgets/round_button_widget.dart index 21482bf..bfe5cc3 100644 --- a/lib/widgets/round_button_widget.dart +++ b/lib/widgets/round_button_widget.dart @@ -15,7 +15,11 @@ class RoundAddButton extends StatelessWidget { backgroundColor: Colors.green, // <-- Button color foregroundColor: Colors.blue, // <-- Splash color ), - child: const Icon(Icons.add_outlined, color: Colors.white), + child: Icon( + Icons.add_outlined, + color: Colors.white, + size: MediaQuery.of(context).size.height * 0.5, + ), ); } } diff --git a/lib/widgets/view_form_page.dart b/lib/widgets/view_form_page.dart index 2fa8af3..6916097 100644 --- a/lib/widgets/view_form_page.dart +++ b/lib/widgets/view_form_page.dart @@ -16,6 +16,7 @@ class ViewFormPage extends StatelessWidget { @override Widget build(BuildContext context) { + final height = MediaQuery.of(context).size.height; PageProvider pageProvider = context.watch(); TasksProvider tasksProvider = context.watch(); return Column(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -27,10 +28,15 @@ class ViewFormPage extends StatelessWidget { )) : Center(child: view), if (!pageProvider.showForm) - RoundAddButton( - onPressed: tasksProvider.tasks[page] == true - ? () => pageProvider.swap() - : () => showTaskDonePopup(context, page), + Container( + height: height / 8, + width: height / 8, + margin: EdgeInsets.only(bottom: height / 10), + child: RoundAddButton( + onPressed: tasksProvider.tasks[page] == true + ? () => pageProvider.swap() + : () => showTaskDonePopup(context, page), + ), ) ]); }