feat: add haptic feedback to more user interactions
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user