Call on large screen able to full screen

This commit is contained in:
LittleSheep 2024-08-21 15:57:45 +08:00
parent fdc71475fc
commit 6ad0a34645
2 changed files with 29 additions and 30 deletions

View File

@ -13,8 +13,13 @@ import 'package:livekit_client/livekit_client.dart' as livekit;
class CallScreen extends StatefulWidget { class CallScreen extends StatefulWidget {
final bool hideAppBar; final bool hideAppBar;
final bool isExpandable;
const CallScreen({super.key, this.hideAppBar = false}); const CallScreen({
super.key,
this.hideAppBar = false,
this.isExpandable = false,
});
@override @override
State<CallScreen> createState() => _CallScreenState(); State<CallScreen> createState() => _CallScreenState();
@ -308,13 +313,24 @@ class _CallScreenState extends State<CallScreen> with TickerProviderStateMixin {
), ),
); );
}), }),
IconButton( Row(
icon: _layoutMode == 0 children: [
? const Icon(Icons.view_list) if (widget.isExpandable)
: const Icon(Icons.grid_view), IconButton(
onPressed: () { icon: const Icon(Icons.fullscreen),
_switchLayout(); onPressed: () {
}, ctrl.gotoScreen(context);
},
),
IconButton(
icon: _layoutMode == 0
? const Icon(Icons.view_list)
: const Icon(Icons.grid_view),
onPressed: () {
_switchLayout();
},
),
],
), ),
], ],
).paddingOnly(left: 20, right: 16), ).paddingOnly(left: 20, right: 16),

View File

@ -141,7 +141,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
switch (state) { switch (state) {
case AppLifecycleState.resumed: case AppLifecycleState.resumed:
if (_isOutOfSyncSince == null) break; if (_isOutOfSyncSince == null) break;
if (DateTime.now().difference(_isOutOfSyncSince!).inSeconds < 60) break; if (DateTime.now().difference(_isOutOfSyncSince!).inSeconds < 30) break;
_keepUpdateWithServer(); _keepUpdateWithServer();
break; break;
case AppLifecycleState.paused: case AppLifecycleState.paused:
@ -269,26 +269,6 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
}, },
), ),
), ),
if (_isOutOfSyncSince != null)
ListTile(
contentPadding: const EdgeInsets.only(left: 16, right: 8),
tileColor:
Theme.of(context).colorScheme.surfaceContainerLow,
leading: const Icon(Icons.history_toggle_off),
title: Text('messageOutOfSync'.tr),
subtitle: Text('messageOutOfSyncCaption'.tr),
trailing: IconButton(
icon: const Icon(Icons.close),
onPressed: () {
setState(() => _isOutOfSyncSince = null);
},
),
onTap: _isBusy
? null
: () {
_keepUpdateWithServer();
},
),
Obx(() { Obx(() {
if (_chatController.isLoading.isTrue) { if (_chatController.isLoading.isTrue) {
return const LinearProgressIndicator().animate().slideY(); return const LinearProgressIndicator().animate().slideY();
@ -331,7 +311,10 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
child: Row(children: [ child: Row(children: [
VerticalDivider(width: 0.3, thickness: 0.3), VerticalDivider(width: 0.3, thickness: 0.3),
Expanded( Expanded(
child: CallScreen(hideAppBar: true), child: CallScreen(
hideAppBar: true,
isExpandable: true,
),
), ),
]), ]),
); );