Skip to content

Commit 941f8bc

Browse files
committed
feat: add ActiveCall list auto-compact extension
1 parent c16c143 commit 941f8bc

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import '../bloc/call_bloc.dart';
2+
import '../models/models.dart';
3+
4+
extension ActiveCallListAutoCompact on List<ActiveCall> {
5+
/// Determines if auto-hide (Compact Mode) is active.
6+
bool get shouldAutoCompact {
7+
var hasAnyVideo = false;
8+
9+
for (final c in this) {
10+
if (c.wasHungUp) return false;
11+
if (c.processingStatus != CallProcessingStatus.connected) return false;
12+
13+
hasAnyVideo = hasAnyVideo || (c.cameraEnabled && c.remoteVideo);
14+
}
15+
16+
return hasAnyVideo;
17+
}
18+
}

lib/features/call/extensions/extensions.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export 'active_call_extension.dart';
12
export 'callkeep_signaling_status_converter.dart';
23
export 'connectivity.dart';
34
export 'processing_status.dart';

0 commit comments

Comments
 (0)