feat: add haptic feedback for various user interactions
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tallee/core/constants.dart';
|
||||
import 'package:tallee/core/custom_theme.dart';
|
||||
@@ -133,8 +134,10 @@ class _CreateGroupViewState extends State<CreateGroupView> {
|
||||
if (!mounted) return;
|
||||
|
||||
if (success) {
|
||||
await HapticFeedback.successNotification();
|
||||
Navigator.pop(context, updatedGroup);
|
||||
} else {
|
||||
await HapticFeedback.errorNotification();
|
||||
showSnackbar(
|
||||
message: widget.groupToEdit == null
|
||||
? loc.error_creating_group
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tallee/core/adaptive_page_route.dart';
|
||||
@@ -68,6 +69,7 @@ class _GroupDetailViewState extends State<GroupDetailView> {
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
onPressed: () async {
|
||||
await HapticFeedback.selectionClick();
|
||||
showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => CustomAlertDialog(
|
||||
@@ -75,11 +77,17 @@ class _GroupDetailViewState extends State<GroupDetailView> {
|
||||
content: Text(loc.this_cannot_be_undone),
|
||||
actions: [
|
||||
CustomDialogAction(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
onPressed: () async {
|
||||
await HapticFeedback.warningNotification();
|
||||
Navigator.of(context).pop(true);
|
||||
},
|
||||
text: loc.delete,
|
||||
),
|
||||
CustomDialogAction(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
onPressed: () async {
|
||||
await HapticFeedback.selectionClick();
|
||||
Navigator.of(context).pop(false);
|
||||
},
|
||||
buttonType: ButtonType.secondary,
|
||||
text: loc.cancel,
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:tallee/core/adaptive_page_route.dart';
|
||||
import 'package:tallee/core/constants.dart';
|
||||
@@ -102,6 +103,7 @@ class _GroupViewState extends State<GroupView> {
|
||||
text: loc.create_group,
|
||||
icon: Icons.group_add,
|
||||
onPressed: () async {
|
||||
await HapticFeedback.selectionClick();
|
||||
await Navigator.push(
|
||||
context,
|
||||
adaptivePageRoute(
|
||||
|
||||
Reference in New Issue
Block a user