refactor: improve text overlay transition in VideoChat for better user experience

This commit is contained in:
Tommy Chow 2025-09-06 17:45:00 -07:00
parent 9b7c666cf5
commit fd16ff5ec3

View file

@ -536,29 +536,34 @@ class _VideoChatState extends State<VideoChat>
),
),
),
// Simple text overlay that follows the video
if (_isPipDragging &&
!_videoStore.isInPipMode)
// Simple text overlay that follows the video with smooth transition
if (!_videoStore.isInPipMode)
Positioned.fill(
child: Container(
color: Colors.black.withValues(
alpha: 0.4,
child: AnimatedOpacity(
opacity: _isPipDragging ? 1.0 : 0.0,
duration: const Duration(
milliseconds: 150,
),
child: Center(
child: AnimatedOpacity(
opacity: _pipDragDistance > 20
? 1.0
: 0.0,
duration: const Duration(
milliseconds: 200,
),
child: const Text(
'Swipe down to enter picture-in-picture',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w500,
child: Container(
color: Colors.black.withValues(
alpha: 0.4,
),
child: Center(
child: AnimatedOpacity(
opacity: _pipDragDistance > 20
? 1.0
: 0.0,
duration: const Duration(
milliseconds: 200,
),
child: const Text(
'Swipe down to enter picture-in-picture',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),