0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-21 00:52:43 -05:00

Added haptic feedback to incorect login

This commit is contained in:
Alex Tran 2022-10-14 16:13:35 -05:00
parent e99c400f59
commit f05d5bdb9e
2 changed files with 4 additions and 1 deletions

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/constants/hive_box.dart'; import 'package:immich_mobile/constants/hive_box.dart';
@ -120,6 +121,7 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
.delete(savedLoginInfoKey); .delete(savedLoginInfoKey);
} }
} catch (e) { } catch (e) {
HapticFeedback.vibrate();
debugPrint("Error logging in $e"); debugPrint("Error logging in $e");
return false; return false;
} }

View file

@ -1,6 +1,7 @@
import 'package:auto_route/auto_route.dart'; import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/modules/home/providers/multiselect.provider.dart'; import 'package:immich_mobile/modules/home/providers/multiselect.provider.dart';
import 'package:immich_mobile/routing/router.dart'; import 'package:immich_mobile/routing/router.dart';
@ -34,7 +35,6 @@ class TabControllerPage extends ConsumerWidget {
bottomNavigationBar: multiselectEnabled bottomNavigationBar: multiselectEnabled
? null ? null
: BottomNavigationBar( : BottomNavigationBar(
enableFeedback: true,
selectedLabelStyle: const TextStyle( selectedLabelStyle: const TextStyle(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -45,6 +45,7 @@ class TabControllerPage extends ConsumerWidget {
), ),
currentIndex: tabsRouter.activeIndex, currentIndex: tabsRouter.activeIndex,
onTap: (index) { onTap: (index) {
HapticFeedback.selectionClick();
tabsRouter.setActiveIndex(index); tabsRouter.setActiveIndex(index);
}, },
items: [ items: [