fix: remove icon button not working in popover (#2885)

This commit is contained in:
Richard Shiue 2023-06-23 10:01:06 +08:00 committed by GitHub
parent bef7fe87aa
commit 9834eccc7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ class _EmojiPopoverState extends State<EmojiPopover> {
padding: const EdgeInsets.only(bottom: 4.0),
child: Align(
alignment: Alignment.centerRight,
child: DeleteButton(onPressed: widget.removeIcon),
child: DeleteButton(onTap: widget.removeIcon),
),
),
Expanded(
@ -67,13 +67,13 @@ class _EmojiPopoverState extends State<EmojiPopover> {
}
class DeleteButton extends StatelessWidget {
final VoidCallback onPressed;
const DeleteButton({required this.onPressed, Key? key}) : super(key: key);
final VoidCallback onTap;
const DeleteButton({required this.onTap, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return FlowyButton(
onTap: () => onPressed,
onTap: onTap,
useIntrinsicWidth: true,
text: FlowyText(
LocaleKeys.document_plugins_cover_removeIcon.tr(),