feat: customize transition animation for popup menu (#6071)

* feat: customize transition animation for popup menu

* chore: add hint text for duplicate and favorite action

* fix: flutter analyze
This commit is contained in:
Lucas.Xu 2024-08-26 15:15:59 +08:00 committed by GitHub
parent 12cb9bde39
commit f342f5ec7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 1624 additions and 11 deletions

View File

@ -64,6 +64,10 @@ class _MobileViewItemBottomSheetState extends State<MobileViewItemBottomSheet> {
case MobileViewItemBottomSheetBodyAction.duplicate: case MobileViewItemBottomSheetBodyAction.duplicate:
Navigator.pop(context); Navigator.pop(context);
context.read<ViewBloc>().add(const ViewEvent.duplicate()); context.read<ViewBloc>().add(const ViewEvent.duplicate());
showToastNotification(
context,
message: LocaleKeys.button_duplicateSuccessfully.tr(),
);
break; break;
case MobileViewItemBottomSheetBodyAction.share: case MobileViewItemBottomSheetBodyAction.share:
// unimplemented // unimplemented
@ -79,6 +83,12 @@ class _MobileViewItemBottomSheetState extends State<MobileViewItemBottomSheet> {
context context
.read<FavoriteBloc>() .read<FavoriteBloc>()
.add(FavoriteEvent.toggle(widget.view)); .add(FavoriteEvent.toggle(widget.view));
showToastNotification(
context,
message: !widget.view.isFavorite
? LocaleKeys.button_favoriteSuccessfully.tr()
: LocaleKeys.button_unfavoriteSuccessfully.tr(),
);
break; break;
case MobileViewItemBottomSheetBodyAction.removeFromRecent: case MobileViewItemBottomSheetBodyAction.removeFromRecent:
_removeFromRecent(context); _removeFromRecent(context);

View File

@ -47,15 +47,6 @@ class MobileHomePageHeader extends StatelessWidget {
: _MobileUser(userProfile: userProfile), : _MobileUser(userProfile: userProfile),
), ),
const HomePageSettingsPopupMenu(), const HomePageSettingsPopupMenu(),
// GestureDetector(
// onTap: () => context.push(
// MobileHomeSettingPage.routeName,
// ),
// child: const Padding(
// padding: EdgeInsets.all(8.0),
// child: FlowySvg(FlowySvgs.m_notification_settings_s),
// ),
// ),
const HSpace(8.0), const HSpace(8.0),
], ],
), ),

View File

@ -3,9 +3,11 @@ import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/presentation.dart'; import 'package:appflowy/mobile/presentation/presentation.dart';
import 'package:appflowy/mobile/presentation/setting/workspace/invite_members_screen.dart'; import 'package:appflowy/mobile/presentation/setting/workspace/invite_members_screen.dart';
import 'package:appflowy/shared/popup_menu/appflowy_popup_menu.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart'
hide PopupMenuButton, PopupMenuDivider, PopupMenuItem, PopupMenuEntry;
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
enum _MobileSettingsPopupMenuItem { enum _MobileSettingsPopupMenuItem {

View File

@ -1,12 +1,14 @@
import 'package:appflowy/generated/flowy_svgs.g.dart'; import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/presentation/presentation.dart'; import 'package:appflowy/mobile/presentation/presentation.dart';
import 'package:appflowy/shared/popup_menu/appflowy_popup_menu.dart';
import 'package:appflowy/user/application/reminder/reminder_bloc.dart'; import 'package:appflowy/user/application/reminder/reminder_bloc.dart';
import 'package:appflowy/workspace/presentation/widgets/dialogs.dart'; import 'package:appflowy/workspace/presentation/widgets/dialogs.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart'
hide PopupMenuButton, PopupMenuDivider, PopupMenuItem, PopupMenuEntry;
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

File diff suppressed because it is too large Load Diff

View File

@ -349,6 +349,7 @@
"addToFavorites": "Add to favorites", "addToFavorites": "Add to favorites",
"favoriteSuccessfully": "Favorited success", "favoriteSuccessfully": "Favorited success",
"unfavoriteSuccessfully": "Unfavorited success", "unfavoriteSuccessfully": "Unfavorited success",
"duplicateSuccessfully": "Duplicated successfully",
"rename": "Rename", "rename": "Rename",
"helpCenter": "Help Center", "helpCenter": "Help Center",
"add": "Add", "add": "Add",