feat: add haptic feedback to more user interactions
Some checks failed
Pull Request Pipeline / test (pull_request) Successful in 49s
Pull Request Pipeline / lint (pull_request) Failing after 50s

This commit is contained in:
2026-05-11 10:27:35 +02:00
parent 1d20127af4
commit bc59d1d91c
20 changed files with 165 additions and 53 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:tallee/core/custom_theme.dart';
class ChooseTile extends StatefulWidget {
@@ -30,7 +31,12 @@ class _ChooseTileState extends State<ChooseTile> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: widget.onPressed,
onTap: () async {
await HapticFeedback.vibrate();
if (widget.onPressed != null) {
widget.onPressed!.call();
}
},
child: Container(
margin: CustomTheme.tileMargin,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:tallee/core/custom_theme.dart';
class CustomCheckboxListTile extends StatelessWidget {
@@ -16,7 +17,10 @@ class CustomCheckboxListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => onChanged(!value),
onTap: () async {
await HapticFeedback.selectionClick();
onChanged(!value);
},
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
padding: const EdgeInsets.symmetric(horizontal: 2),
@@ -29,7 +33,8 @@ class CustomCheckboxListTile extends StatelessWidget {
children: [
Checkbox(
value: value,
onChanged: (bool? v) {
onChanged: (bool? v) async {
await HapticFeedback.selectionClick();
if (v == null) return;
onChanged(v);
},

View File

@@ -1,6 +1,7 @@
import 'dart:core' hide Match;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:tallee/core/common.dart';
import 'package:tallee/core/custom_theme.dart';
@@ -51,7 +52,10 @@ class _MatchTileState extends State<MatchTile> {
final loc = AppLocalizations.of(context);
return GestureDetector(
onTap: widget.onTap,
onTap: () async {
await HapticFeedback.selectionClick();
widget.onTap.call();
},
child: Container(
margin: EdgeInsets.zero,
width: widget.width,