From f8964cab462bbc5b56bd04af4a2c98a6c318a31f Mon Sep 17 00:00:00 2001 From: problematicconsumer Date: Thu, 24 Aug 2023 22:19:36 +0330 Subject: [PATCH] Add button tooltips --- lib/features/common/profile_tile.dart | 46 ++++++++++++++++----------- lib/features/home/view/home_page.dart | 1 + 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/lib/features/common/profile_tile.dart b/lib/features/common/profile_tile.dart index d2005ad6..a63d70da 100644 --- a/lib/features/common/profile_tile.dart +++ b/lib/features/common/profile_tile.dart @@ -153,30 +153,38 @@ class ProfileActionButton extends HookConsumerWidget { ); if (!showAllActions) { - return InkWell( - onTap: () { - if (updateProfileMutation.state.isInProgress) { - return; - } - updateProfileMutation.setFuture( - ref.read(profilesNotifierProvider.notifier).updateProfile(profile), - ); - }, - child: const Icon(Icons.update), + return Tooltip( + message: t.profile.update.buttonTxt, + child: InkWell( + onTap: () { + if (updateProfileMutation.state.isInProgress) { + return; + } + updateProfileMutation.setFuture( + ref + .read(profilesNotifierProvider.notifier) + .updateProfile(profile), + ); + }, + child: const Icon(Icons.update), + ), ); } return ProfileActionsMenu( profile, (context, controller, child) { - return InkWell( - onTap: () { - if (controller.isOpen) { - controller.close(); - } else { - controller.open(); - } - }, - child: const Icon(Icons.more_vert), + return Tooltip( + message: MaterialLocalizations.of(context).showMenuTooltip, + child: InkWell( + onTap: () { + if (controller.isOpen) { + controller.close(); + } else { + controller.open(); + } + }, + child: const Icon(Icons.more_vert), + ), ); }, ); diff --git a/lib/features/home/view/home_page.dart b/lib/features/home/view/home_page.dart index 3abd6891..669cd1ad 100644 --- a/lib/features/home/view/home_page.dart +++ b/lib/features/home/view/home_page.dart @@ -39,6 +39,7 @@ class HomePage extends HookConsumerWidget { IconButton( onPressed: () => const AddProfileRoute().push(context), icon: const Icon(Icons.add_circle), + tooltip: t.profile.add.buttonText, ), ], ),