feat: add haptic feedback for various user interactions
Some checks failed
Pull Request Pipeline / test (pull_request) Successful in 45s
Pull Request Pipeline / lint (pull_request) Failing after 48s

This commit is contained in:
2026-05-10 23:04:43 +02:00
parent 699d4378b2
commit 1d20127af4
13 changed files with 131 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:tallee/core/adaptive_page_route.dart';
import 'package:tallee/core/custom_theme.dart';
import 'package:tallee/l10n/generated/app_localizations.dart';
@@ -55,8 +56,9 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
actions: [
IconButton(
onPressed: () async {
await Navigator.push(
context,
final navigator = Navigator.of(context);
await HapticFeedback.selectionClick();
await navigator.push(
adaptivePageRoute(builder: (_) => const SettingsView()),
);
setState(() {
@@ -125,7 +127,8 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
}
/// Handles tab tap events. Updates the current [index] state.
void onTabTapped(int index) {
void onTabTapped(int index) async {
await HapticFeedback.selectionClick();
setState(() {
currentIndex = index;
});