From f05d5bdb9e527b0112d23ad046062603a65eb739 Mon Sep 17 00:00:00 2001 From: Alex Tran Date: Fri, 14 Oct 2022 16:13:35 -0500 Subject: [PATCH] Added haptic feedback to incorect login --- .../lib/modules/login/providers/authentication.provider.dart | 2 ++ mobile/lib/shared/views/tab_controller_page.dart | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mobile/lib/modules/login/providers/authentication.provider.dart b/mobile/lib/modules/login/providers/authentication.provider.dart index 2ccf616a7b..022faf49ec 100644 --- a/mobile/lib/modules/login/providers/authentication.provider.dart +++ b/mobile/lib/modules/login/providers/authentication.provider.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hive/hive.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/constants/hive_box.dart'; @@ -120,6 +121,7 @@ class AuthenticationNotifier extends StateNotifier { .delete(savedLoginInfoKey); } } catch (e) { + HapticFeedback.vibrate(); debugPrint("Error logging in $e"); return false; } diff --git a/mobile/lib/shared/views/tab_controller_page.dart b/mobile/lib/shared/views/tab_controller_page.dart index 16d52f69a3..83435edc4c 100644 --- a/mobile/lib/shared/views/tab_controller_page.dart +++ b/mobile/lib/shared/views/tab_controller_page.dart @@ -1,6 +1,7 @@ import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/modules/home/providers/multiselect.provider.dart'; import 'package:immich_mobile/routing/router.dart'; @@ -34,7 +35,6 @@ class TabControllerPage extends ConsumerWidget { bottomNavigationBar: multiselectEnabled ? null : BottomNavigationBar( - enableFeedback: true, selectedLabelStyle: const TextStyle( fontSize: 13, fontWeight: FontWeight.w600, @@ -45,6 +45,7 @@ class TabControllerPage extends ConsumerWidget { ), currentIndex: tabsRouter.activeIndex, onTap: (index) { + HapticFeedback.selectionClick(); tabsRouter.setActiveIndex(index); }, items: [