refactor: improve text overlay transition in VideoChat for better user experience
This commit is contained in:
parent
9b7c666cf5
commit
fd16ff5ec3
1 changed files with 26 additions and 21 deletions
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue