Updated CustomFormRow padding and pressed handler
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:cabo_counter/presentation/widgets/stepper.dart';
|
||||||
import 'package:cabo_counter/utility/custom_theme.dart';
|
import 'package:cabo_counter/utility/custom_theme.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
@@ -5,12 +6,12 @@ class CustomFormRow extends StatefulWidget {
|
|||||||
final String prefixText;
|
final String prefixText;
|
||||||
final IconData prefixIcon;
|
final IconData prefixIcon;
|
||||||
final Widget? suffixWidget;
|
final Widget? suffixWidget;
|
||||||
final void Function()? onTap;
|
final void Function()? onPressed;
|
||||||
const CustomFormRow({
|
const CustomFormRow({
|
||||||
super.key,
|
super.key,
|
||||||
required this.prefixText,
|
required this.prefixText,
|
||||||
required this.prefixIcon,
|
required this.prefixIcon,
|
||||||
required this.onTap,
|
this.onPressed,
|
||||||
this.suffixWidget,
|
this.suffixWidget,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -28,8 +29,9 @@ class _CustomFormRowState extends State<CustomFormRow> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return GestureDetector(
|
return CupertinoButton(
|
||||||
onTap: widget.onTap,
|
padding: EdgeInsets.zero,
|
||||||
|
onPressed: widget.onPressed,
|
||||||
child: CupertinoFormRow(
|
child: CupertinoFormRow(
|
||||||
prefix: Row(
|
prefix: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -41,7 +43,9 @@ class _CustomFormRowState extends State<CustomFormRow> {
|
|||||||
Text(widget.prefixText),
|
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,
|
child: suffixWidget,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user