🐛 Fix call room meaningless safe area
This commit is contained in:
parent
87029e3538
commit
9f9c90abc4
@ -14,6 +14,7 @@ import 'package:surface/widgets/navigation/app_scaffold.dart';
|
|||||||
class CallRoomScreen extends StatefulWidget {
|
class CallRoomScreen extends StatefulWidget {
|
||||||
final String scope;
|
final String scope;
|
||||||
final String alias;
|
final String alias;
|
||||||
|
|
||||||
const CallRoomScreen({super.key, required this.scope, required this.alias});
|
const CallRoomScreen({super.key, required this.scope, required this.alias});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -36,8 +37,7 @@ class _CallRoomScreenState extends State<CallRoomScreen> {
|
|||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
color:
|
color: Theme.of(context).colorScheme.surfaceContainer.withOpacity(0.75),
|
||||||
Theme.of(context).colorScheme.surfaceContainer.withOpacity(0.75),
|
|
||||||
child: call.focusTrack != null
|
child: call.focusTrack != null
|
||||||
? InteractiveParticipantWidget(
|
? InteractiveParticipantWidget(
|
||||||
isFixedAvatar: false,
|
isFixedAvatar: false,
|
||||||
@ -72,8 +72,7 @@ class _CallRoomScreenState extends State<CallRoomScreen> {
|
|||||||
color: Theme.of(context).cardColor,
|
color: Theme.of(context).cardColor,
|
||||||
participant: track,
|
participant: track,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (track.participant.sid !=
|
if (track.participant.sid != call.focusTrack?.participant.sid) {
|
||||||
call.focusTrack?.participant.sid) {
|
|
||||||
call.setFocusTrack(track);
|
call.setFocusTrack(track);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -115,14 +114,10 @@ class _CallRoomScreenState extends State<CallRoomScreen> {
|
|||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
child: InteractiveParticipantWidget(
|
child: InteractiveParticipantWidget(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).colorScheme.surfaceContainerHigh.withOpacity(0.75),
|
||||||
.colorScheme
|
|
||||||
.surfaceContainerHigh
|
|
||||||
.withOpacity(0.75),
|
|
||||||
participant: track,
|
participant: track,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (track.participant.sid !=
|
if (track.participant.sid != call.focusTrack?.participant.sid) {
|
||||||
call.focusTrack?.participant.sid) {
|
|
||||||
call.setFocusTrack(track);
|
call.setFocusTrack(track);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -160,24 +155,17 @@ class _CallRoomScreenState extends State<CallRoomScreen> {
|
|||||||
text: TextSpan(children: [
|
text: TextSpan(children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: 'call'.tr(),
|
text: 'call'.tr(),
|
||||||
style: Theme.of(context)
|
style: Theme.of(context).textTheme.titleLarge!.copyWith(color: Colors.white),
|
||||||
.textTheme
|
|
||||||
.titleLarge!
|
|
||||||
.copyWith(color: Colors.white),
|
|
||||||
),
|
),
|
||||||
const TextSpan(text: '\n'),
|
const TextSpan(text: '\n'),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: call.lastDuration.toString(),
|
text: call.lastDuration.toString(),
|
||||||
style: Theme.of(context)
|
style: Theme.of(context).textTheme.bodySmall!.copyWith(color: Colors.white),
|
||||||
.textTheme
|
|
||||||
.bodySmall!
|
|
||||||
.copyWith(color: Colors.white),
|
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: GestureDetector(
|
||||||
child: GestureDetector(
|
|
||||||
behavior: HitTestBehavior.translucent,
|
behavior: HitTestBehavior.translucent,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@ -191,8 +179,7 @@ class _CallRoomScreenState extends State<CallRoomScreen> {
|
|||||||
Builder(builder: (context) {
|
Builder(builder: (context) {
|
||||||
final call = context.read<ChatCallProvider>();
|
final call = context.read<ChatCallProvider>();
|
||||||
final connectionQuality =
|
final connectionQuality =
|
||||||
call.room.localParticipant?.connectionQuality ??
|
call.room.localParticipant?.connectionQuality ?? livekit.ConnectionQuality.unknown;
|
||||||
livekit.ConnectionQuality.unknown;
|
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@ -214,35 +201,24 @@ class _CallRoomScreenState extends State<CallRoomScreen> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
{
|
{
|
||||||
livekit.ConnectionState.disconnected:
|
livekit.ConnectionState.disconnected: 'callStatusDisconnected'.tr(),
|
||||||
'callStatusDisconnected'.tr(),
|
livekit.ConnectionState.connected: 'callStatusConnected'.tr(),
|
||||||
livekit.ConnectionState.connected:
|
livekit.ConnectionState.connecting: 'callStatusConnecting'.tr(),
|
||||||
'callStatusConnected'.tr(),
|
livekit.ConnectionState.reconnecting: 'callStatusReconnecting'.tr(),
|
||||||
livekit.ConnectionState.connecting:
|
|
||||||
'callStatusConnecting'.tr(),
|
|
||||||
livekit.ConnectionState.reconnecting:
|
|
||||||
'callStatusReconnecting'.tr(),
|
|
||||||
}[call.room.connectionState]!,
|
}[call.room.connectionState]!,
|
||||||
),
|
),
|
||||||
const Gap(6),
|
const Gap(6),
|
||||||
if (connectionQuality !=
|
if (connectionQuality != livekit.ConnectionQuality.unknown)
|
||||||
livekit.ConnectionQuality.unknown)
|
|
||||||
Icon(
|
Icon(
|
||||||
{
|
{
|
||||||
livekit.ConnectionQuality.excellent:
|
livekit.ConnectionQuality.excellent: Icons.signal_cellular_alt,
|
||||||
Icons.signal_cellular_alt,
|
livekit.ConnectionQuality.good: Icons.signal_cellular_alt_2_bar,
|
||||||
livekit.ConnectionQuality.good:
|
livekit.ConnectionQuality.poor: Icons.signal_cellular_alt_1_bar,
|
||||||
Icons.signal_cellular_alt_2_bar,
|
|
||||||
livekit.ConnectionQuality.poor:
|
|
||||||
Icons.signal_cellular_alt_1_bar,
|
|
||||||
}[connectionQuality],
|
}[connectionQuality],
|
||||||
color: {
|
color: {
|
||||||
livekit.ConnectionQuality.excellent:
|
livekit.ConnectionQuality.excellent: Colors.green,
|
||||||
Colors.green,
|
livekit.ConnectionQuality.good: Colors.orange,
|
||||||
livekit.ConnectionQuality.good:
|
livekit.ConnectionQuality.poor: Colors.red,
|
||||||
Colors.orange,
|
|
||||||
livekit.ConnectionQuality.poor:
|
|
||||||
Colors.red,
|
|
||||||
}[connectionQuality],
|
}[connectionQuality],
|
||||||
size: 16,
|
size: 16,
|
||||||
)
|
)
|
||||||
@ -264,9 +240,7 @@ class _CallRoomScreenState extends State<CallRoomScreen> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: _layoutMode == 0
|
icon: _layoutMode == 0 ? const Icon(Icons.view_list) : const Icon(Icons.grid_view),
|
||||||
? const Icon(Icons.view_list)
|
|
||||||
: const Icon(Icons.grid_view),
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_switchLayout();
|
_switchLayout();
|
||||||
},
|
},
|
||||||
@ -278,8 +252,7 @@ class _CallRoomScreenState extends State<CallRoomScreen> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Material(
|
child: Material(
|
||||||
color:
|
color: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
Theme.of(context).colorScheme.surfaceContainerLow,
|
|
||||||
child: Builder(
|
child: Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
switch (_layoutMode) {
|
switch (_layoutMode) {
|
||||||
@ -304,7 +277,6 @@ class _CallRoomScreenState extends State<CallRoomScreen> {
|
|||||||
),
|
),
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user