粘贴删除按钮不参与过渡

This commit is contained in:
2026-06-08 15:51:05 +08:00
parent 7ab03dd912
commit 41fcd730f0
2 changed files with 40 additions and 39 deletions

3
devtools_options.yaml Normal file
View File

@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:

View File

@@ -26,7 +26,7 @@ class RecordHeaderWidget extends StatelessWidget {
bool get _showEventTitle => hasValidClipboardInfo;
Widget _buildHeaderContent() {
Widget _buildAnimatedHeaderContent() {
if (_showEventTitle) {
return _HeaderEventTitleRow(
key: ValueKey('title-${eventTitle ?? ''}'),
@@ -36,14 +36,6 @@ class RecordHeaderWidget extends StatelessWidget {
);
}
if (_showPasteButtons) {
return _HeaderPasteActions(
key: const ValueKey('paste-actions'),
onMockCopy: _mockCopyEventInfo,
onPasteEventInfo: onPasteEventInfo,
);
}
return const SizedBox.shrink(key: ValueKey('header-empty'));
}
@@ -72,13 +64,26 @@ class RecordHeaderWidget extends StatelessWidget {
fit: BoxFit.contain,
),
Expanded(
child: AnimatedSwitcher(
child: Stack(
alignment: Alignment.center,
children: [
AnimatedSwitcher(
duration: RecordContentTransition.duration,
switchInCurve: Curves.easeOutCubic,
switchOutCurve: Curves.easeInCubic,
layoutBuilder: RecordContentTransition.stackLayoutBuilder,
transitionBuilder: RecordContentTransition.builder,
child: _buildHeaderContent(),
child: _buildAnimatedHeaderContent(),
),
if (_showPasteButtons)
Align(
alignment: Alignment.centerRight,
child: _HeaderPasteActions(
onMockCopy: _mockCopyEventInfo,
onPasteEventInfo: onPasteEventInfo,
),
),
],
),
),
],
@@ -130,12 +135,7 @@ class _HeaderEventTitleRow extends StatelessWidget {
),
),
),
AnimatedSwitcher(
duration: RecordContentTransition.duration,
switchInCurve: Curves.easeOutCubic,
switchOutCurve: Curves.easeInCubic,
transitionBuilder: RecordContentTransition.builder,
child: !isRecording
!isRecording
? IconButton(
key: const ValueKey('clear-event-info'),
onPressed: onClearEventInfo,
@@ -151,7 +151,6 @@ class _HeaderEventTitleRow extends StatelessWidget {
tooltip: '删除',
)
: const SizedBox.shrink(key: ValueKey('clear-event-info-hidden')),
),
],
);
}
@@ -159,7 +158,6 @@ class _HeaderEventTitleRow extends StatelessWidget {
class _HeaderPasteActions extends StatelessWidget {
const _HeaderPasteActions({
super.key,
required this.onMockCopy,
required this.onPasteEventInfo,
});