From 9bc80a8cd94e827576bc726d506b9319b5ba1220 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Wed, 9 Jul 2025 17:15:00 +0200 Subject: [PATCH] Updated CustomFormRow padding and pressed handler --- lib/presentation/widgets/custom_form_row.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/presentation/widgets/custom_form_row.dart b/lib/presentation/widgets/custom_form_row.dart index 61d0fdb..f03b453 100644 --- a/lib/presentation/widgets/custom_form_row.dart +++ b/lib/presentation/widgets/custom_form_row.dart @@ -1,3 +1,4 @@ +import 'package:cabo_counter/presentation/widgets/stepper.dart'; import 'package:cabo_counter/utility/custom_theme.dart'; import 'package:flutter/cupertino.dart'; @@ -5,12 +6,12 @@ class CustomFormRow extends StatefulWidget { final String prefixText; final IconData prefixIcon; final Widget? suffixWidget; - final void Function()? onTap; + final void Function()? onPressed; const CustomFormRow({ super.key, required this.prefixText, required this.prefixIcon, - required this.onTap, + this.onPressed, this.suffixWidget, }); @@ -28,8 +29,9 @@ class _CustomFormRowState extends State { @override Widget build(BuildContext context) { - return GestureDetector( - onTap: widget.onTap, + return CupertinoButton( + padding: EdgeInsets.zero, + onPressed: widget.onPressed, child: CupertinoFormRow( prefix: Row( children: [ @@ -41,7 +43,9 @@ class _CustomFormRowState extends State { Text(widget.prefixText), ], ), - padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15), + padding: suffixWidget is Stepper + ? const EdgeInsets.fromLTRB(15, 0, 0, 0) + : const EdgeInsets.symmetric(vertical: 10, horizontal: 15), child: suffixWidget, ), );