粘贴删除按钮不参与过渡
This commit is contained in:
3
devtools_options.yaml
Normal file
3
devtools_options.yaml
Normal 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:
|
||||||
@@ -26,7 +26,7 @@ class RecordHeaderWidget extends StatelessWidget {
|
|||||||
|
|
||||||
bool get _showEventTitle => hasValidClipboardInfo;
|
bool get _showEventTitle => hasValidClipboardInfo;
|
||||||
|
|
||||||
Widget _buildHeaderContent() {
|
Widget _buildAnimatedHeaderContent() {
|
||||||
if (_showEventTitle) {
|
if (_showEventTitle) {
|
||||||
return _HeaderEventTitleRow(
|
return _HeaderEventTitleRow(
|
||||||
key: ValueKey('title-${eventTitle ?? ''}'),
|
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'));
|
return const SizedBox.shrink(key: ValueKey('header-empty'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,13 +64,26 @@ class RecordHeaderWidget extends StatelessWidget {
|
|||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: AnimatedSwitcher(
|
child: Stack(
|
||||||
duration: RecordContentTransition.duration,
|
alignment: Alignment.center,
|
||||||
switchInCurve: Curves.easeOutCubic,
|
children: [
|
||||||
switchOutCurve: Curves.easeInCubic,
|
AnimatedSwitcher(
|
||||||
layoutBuilder: RecordContentTransition.stackLayoutBuilder,
|
duration: RecordContentTransition.duration,
|
||||||
transitionBuilder: RecordContentTransition.builder,
|
switchInCurve: Curves.easeOutCubic,
|
||||||
child: _buildHeaderContent(),
|
switchOutCurve: Curves.easeInCubic,
|
||||||
|
layoutBuilder: RecordContentTransition.stackLayoutBuilder,
|
||||||
|
transitionBuilder: RecordContentTransition.builder,
|
||||||
|
child: _buildAnimatedHeaderContent(),
|
||||||
|
),
|
||||||
|
if (_showPasteButtons)
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: _HeaderPasteActions(
|
||||||
|
onMockCopy: _mockCopyEventInfo,
|
||||||
|
onPasteEventInfo: onPasteEventInfo,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -130,28 +135,22 @@ class _HeaderEventTitleRow extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
AnimatedSwitcher(
|
!isRecording
|
||||||
duration: RecordContentTransition.duration,
|
? IconButton(
|
||||||
switchInCurve: Curves.easeOutCubic,
|
key: const ValueKey('clear-event-info'),
|
||||||
switchOutCurve: Curves.easeInCubic,
|
onPressed: onClearEventInfo,
|
||||||
transitionBuilder: RecordContentTransition.builder,
|
icon: Assets.images.imageDelete.image(
|
||||||
child: !isRecording
|
width: 15.r,
|
||||||
? IconButton(
|
height: 15.r,
|
||||||
key: const ValueKey('clear-event-info'),
|
fit: BoxFit.contain,
|
||||||
onPressed: onClearEventInfo,
|
excludeFromSemantics: true,
|
||||||
icon: Assets.images.imageDelete.image(
|
),
|
||||||
width: 15.r,
|
padding: EdgeInsets.zero,
|
||||||
height: 15.r,
|
constraints: BoxConstraints(minWidth: 40.r, minHeight: 40.r),
|
||||||
fit: BoxFit.contain,
|
alignment: Alignment.centerRight,
|
||||||
excludeFromSemantics: true,
|
tooltip: '删除',
|
||||||
),
|
)
|
||||||
padding: EdgeInsets.zero,
|
: const SizedBox.shrink(key: ValueKey('clear-event-info-hidden')),
|
||||||
constraints: BoxConstraints(minWidth: 40.r, minHeight: 40.r),
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
tooltip: '删除',
|
|
||||||
)
|
|
||||||
: const SizedBox.shrink(key: ValueKey('clear-event-info-hidden')),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -159,7 +158,6 @@ class _HeaderEventTitleRow extends StatelessWidget {
|
|||||||
|
|
||||||
class _HeaderPasteActions extends StatelessWidget {
|
class _HeaderPasteActions extends StatelessWidget {
|
||||||
const _HeaderPasteActions({
|
const _HeaderPasteActions({
|
||||||
super.key,
|
|
||||||
required this.onMockCopy,
|
required this.onMockCopy,
|
||||||
required this.onPasteEventInfo,
|
required this.onPasteEventInfo,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user