fix(flutter): 支持全屏胶囊双态切换

This commit is contained in:
Zhou Weidong committed 2026-10-20 11:03:53 +08:00
1 parent c4ad5d72d7
commit 6dbeb3e505
2 files changed
+18 -3

No files matched your search

+5 -3
View File
@@ -56,8 +56,8 @@ class PlayerPlaybackOverlay extends StatelessWidget {
_top(context), _top(context),
_bottom(context), _bottom(context),
_rail(context), _rail(context),
_fullScreenPill(),
], ],
_fullScreenPill(),
if (!controlsVisible) if (!controlsVisible)
Positioned( Positioned(
top: AppDimens.spaceSm, top: AppDimens.spaceSm,
@@ -321,7 +321,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
child: InkWell( child: InkWell(
key: const Key('player-fullscreen-toggle'), key: const Key('player-fullscreen-toggle'),
borderRadius: BorderRadius.circular(999), borderRadius: BorderRadius.circular(999),
onTap: actions.onClear, onTap: controlsVisible ? actions.onClear : actions.onExitClear,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 7), padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 7),
child: Row( child: Row(
@@ -334,7 +334,9 @@ class PlayerPlaybackOverlay extends StatelessWidget {
), ),
const SizedBox(width: 5), const SizedBox(width: 5),
Text( Text(
data.l10n.fullScreenWatch, controlsVisible
? data.l10n.fullScreenWatch
: data.l10n.exitClearScreen,
style: const TextStyle( style: const TextStyle(
color: AppColors.onPrimary, color: AppColors.onPrimary,
fontSize: 12, fontSize: 12,
+13
View File
@@ -383,6 +383,19 @@ void main() {
expect(find.byKey(const Key('player-exit-clear-screen')), findsOneWidget); expect(find.byKey(const Key('player-exit-clear-screen')), findsOneWidget);
}); });
testWidgets('should_toggle_fullscreen_from_the_same_pill', (tester) async {
await _pumpApp(tester);
await _openSeriesPlayer(tester);
await tester.tap(find.byKey(const Key('player-fullscreen-toggle')));
await tester.pumpAndSettle();
expect(find.byKey(const Key('player-controls-top')), findsNothing);
await tester.tap(find.byKey(const Key('player-fullscreen-toggle')));
await tester.pumpAndSettle();
expect(find.byKey(const Key('player-controls-top')), findsOneWidget);
expect(find.byKey(const Key('player-controls-bottom')), findsOneWidget);
});
testWidgets('should_open_unlock_panel_with_honest_method_states', ( testWidgets('should_open_unlock_panel_with_honest_method_states', (
tester, tester,
) async { ) async {