fix(flutter): 支持全屏胶囊双态切换
This commit is contained in:
1 parent
c4ad5d72d7
commit
6dbeb3e505
2 files changed
+18
-3
No files matched your search
@@ -56,8 +56,8 @@ class PlayerPlaybackOverlay extends StatelessWidget {
|
||||
_top(context),
|
||||
_bottom(context),
|
||||
_rail(context),
|
||||
_fullScreenPill(),
|
||||
],
|
||||
_fullScreenPill(),
|
||||
if (!controlsVisible)
|
||||
Positioned(
|
||||
top: AppDimens.spaceSm,
|
||||
@@ -321,7 +321,7 @@ class PlayerPlaybackOverlay extends StatelessWidget {
|
||||
child: InkWell(
|
||||
key: const Key('player-fullscreen-toggle'),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
onTap: actions.onClear,
|
||||
onTap: controlsVisible ? actions.onClear : actions.onExitClear,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 7),
|
||||
child: Row(
|
||||
@@ -334,7 +334,9 @@ class PlayerPlaybackOverlay extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
data.l10n.fullScreenWatch,
|
||||
controlsVisible
|
||||
? data.l10n.fullScreenWatch
|
||||
: data.l10n.exitClearScreen,
|
||||
style: const TextStyle(
|
||||
color: AppColors.onPrimary,
|
||||
fontSize: 12,
|
||||
|
||||
@@ -383,6 +383,19 @@ void main() {
|
||||
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', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
Reference in new issue
Block a user