fix list view for group tab

Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
This commit is contained in:
Sahil Yeole 2023-10-25 01:26:41 +05:30
parent 3f3489b292
commit a52caaec75

View File

@ -9,6 +9,7 @@ import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:visibility_detector/visibility_detector.dart';
import 'package:window_manager/window_manager.dart';
import 'package:flutter_hbb/models/peer_tab_model.dart';
import '../../common.dart';
import '../../models/peer_model.dart';
@ -188,12 +189,16 @@ class _PeersViewState extends State<_PeersView> with WindowListener {
onVisibilityChanged: onVisibilityChanged,
child: widget.peerCardBuilder(peer),
);
final windowWidth = MediaQuery.of(context).size.width;
final model = Provider.of<PeerTabModel>(context);
return isDesktop
? Obx(
() => SizedBox(
width: peerCardUiType.value != PeerUiType.list
? 220
: MediaQuery.of(context).size.width - 227,
: model.currentTab == PeerTabIndex.group.index?
windowWidth - 390 :
windowWidth - 227,
height:
peerCardUiType.value == PeerUiType.grid ? 140 : peerCardUiType.value != PeerUiType.list ? 42 : 45,
child: visibilityChild,