fix: Too big tap hint being drawn

This commit is contained in:
Alberto Ponces 2022-09-07 11:55:37 +01:00
parent 75544f1f51
commit 3b830cf15a

View file

@ -37,13 +37,14 @@ class PatchItem extends StatefulWidget {
class _PatchItemState extends State<PatchItem> { class _PatchItemState extends State<PatchItem> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return Padding(
onTap: () { padding: const EdgeInsets.symmetric(vertical: 4.0),
setState(() => widget.isSelected = !widget.isSelected); child: InkWell(
widget.onChanged(widget.isSelected); borderRadius: BorderRadius.circular(16),
}, onTap: () {
child: Padding( setState(() => widget.isSelected = !widget.isSelected);
padding: const EdgeInsets.symmetric(vertical: 4.0), widget.onChanged(widget.isSelected);
},
child: CustomCard( child: CustomCard(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -84,6 +85,12 @@ class _PatchItemState extends State<PatchItem> {
child: Checkbox( child: Checkbox(
value: widget.isSelected, value: widget.isSelected,
activeColor: Theme.of(context).colorScheme.primary, activeColor: Theme.of(context).colorScheme.primary,
checkColor:
Theme.of(context).colorScheme.secondaryContainer,
side: BorderSide(
width: 1.5,
color: Theme.of(context).colorScheme.primary,
),
onChanged: (newValue) { onChanged: (newValue) {
setState(() => widget.isSelected = newValue!); setState(() => widget.isSelected = newValue!);
widget.onChanged(widget.isSelected); widget.onChanged(widget.isSelected);
@ -109,7 +116,7 @@ class _PatchItemState extends State<PatchItem> {
side: BorderSide( side: BorderSide(
width: 1, width: 1,
color: color:
Theme.of(context).colorScheme.primary, Theme.of(context).colorScheme.secondary,
), ),
), ),
), ),
@ -117,7 +124,7 @@ class _PatchItemState extends State<PatchItem> {
Colors.transparent, Colors.transparent,
), ),
foregroundColor: MaterialStateProperty.all( foregroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.primary, Theme.of(context).colorScheme.secondary,
), ),
), ),
), ),
@ -138,6 +145,7 @@ class _PatchItemState extends State<PatchItem> {
context: context, context: context,
builder: (context) => AlertDialog( builder: (context) => AlertDialog(
title: I18nText('patchItem.alertDialogTitle'), title: I18nText('patchItem.alertDialogTitle'),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
content: I18nText( content: I18nText(
'patchItem.alertDialogText', 'patchItem.alertDialogText',
translationParams: { translationParams: {
@ -152,7 +160,6 @@ class _PatchItemState extends State<PatchItem> {
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
) )
], ],
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
), ),
); );
} }