mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-10 18:01:39 +00:00
feat: add animation for floating toolbar (#7623)
This commit is contained in:
parent
584f762e11
commit
4686e13390
@ -443,9 +443,11 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage>
|
||||
color: Theme.of(context).cardColor,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
|
||||
),
|
||||
toolbarBuilder: (context, child, onDismiss) => DesktopFloatingToolbar(
|
||||
toolbarBuilder: (context, child, onDismiss, isMetricsChanged) =>
|
||||
DesktopFloatingToolbar(
|
||||
editorState: editorState,
|
||||
onDismiss: onDismiss,
|
||||
enableAnimation: !isMetricsChanged,
|
||||
child: child,
|
||||
),
|
||||
placeHolderBuilder: (_) => customPlaceholderItem,
|
||||
|
@ -2,6 +2,7 @@ import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import 'toolbar_animation.dart';
|
||||
import 'toolbar_cubit.dart';
|
||||
|
||||
class DesktopFloatingToolbar extends StatefulWidget {
|
||||
@ -10,11 +11,13 @@ class DesktopFloatingToolbar extends StatefulWidget {
|
||||
required this.editorState,
|
||||
required this.child,
|
||||
required this.onDismiss,
|
||||
this.enableAnimation = true,
|
||||
});
|
||||
|
||||
final EditorState editorState;
|
||||
final Widget child;
|
||||
final VoidCallback onDismiss;
|
||||
final bool enableAnimation;
|
||||
|
||||
@override
|
||||
State<DesktopFloatingToolbar> createState() => _DesktopFloatingToolbarState();
|
||||
@ -46,7 +49,9 @@ class _DesktopFloatingToolbarState extends State<DesktopFloatingToolbar> {
|
||||
left: position!.left,
|
||||
top: position!.top,
|
||||
right: position!.right,
|
||||
child: widget.child,
|
||||
child: widget.enableAnimation
|
||||
? ToolbarAnimationWidget(child: widget.child)
|
||||
: widget.child,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -90,8 +90,8 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: f46e991
|
||||
resolved-ref: f46e991d0a9c5a95bd14be4cc96e68171c9ed9bc
|
||||
ref: "8f314fd"
|
||||
resolved-ref: "8f314fda5981e650a52ba522ba7915e13940d837"
|
||||
url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
|
||||
source: git
|
||||
version: "5.1.0"
|
||||
|
@ -180,7 +180,7 @@ dependency_overrides:
|
||||
appflowy_editor:
|
||||
git:
|
||||
url: https://github.com/AppFlowy-IO/appflowy-editor.git
|
||||
ref: "f46e991"
|
||||
ref: "8f314fd"
|
||||
|
||||
appflowy_editor_plugins:
|
||||
git:
|
||||
|
Loading…
x
Reference in New Issue
Block a user