mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-18 15:53:00 +08:00
commit
dca3d3ebc2
@ -45,18 +45,11 @@ class _MyGroupState extends State<MyGroup> {
|
||||
if (gFFI.groupModel.userLoadError.isNotEmpty) {
|
||||
return _buildShowError(gFFI.groupModel.userLoadError.value);
|
||||
}
|
||||
return Row(
|
||||
children: [
|
||||
_buildLeftDesktop(),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: MyGroupPeerView(
|
||||
menuPadding: widget.menuPadding,
|
||||
initPeers: gFFI.groupModel.peersShow.value)),
|
||||
)
|
||||
],
|
||||
);
|
||||
if (isDesktop) {
|
||||
return _buildDesktop();
|
||||
} else {
|
||||
return _buildMobile();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -75,15 +68,16 @@ class _MyGroupState extends State<MyGroup> {
|
||||
));
|
||||
}
|
||||
|
||||
Widget _buildLeftDesktop() {
|
||||
return Row(
|
||||
Widget _buildDesktop() {
|
||||
return Obx(
|
||||
() => Row(
|
||||
children: [
|
||||
Card(
|
||||
margin: EdgeInsets.symmetric(horizontal: 4.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side:
|
||||
BorderSide(color: Theme.of(context).scaffoldBackgroundColor)),
|
||||
side: BorderSide(
|
||||
color: Theme.of(context).scaffoldBackgroundColor)),
|
||||
child: Container(
|
||||
width: 200,
|
||||
height: double.infinity,
|
||||
@ -105,7 +99,55 @@ class _MyGroupState extends State<MyGroup> {
|
||||
),
|
||||
),
|
||||
).marginOnly(right: 8.0),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: MyGroupPeerView(
|
||||
menuPadding: widget.menuPadding,
|
||||
initPeers: gFFI.groupModel.peersShow.value)),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMobile() {
|
||||
return Obx(
|
||||
() => Column(
|
||||
children: [
|
||||
Card(
|
||||
margin: EdgeInsets.symmetric(horizontal: 4.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: BorderSide(
|
||||
color: Theme.of(context).scaffoldBackgroundColor)),
|
||||
child: Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_buildLeftHeader(),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration:
|
||||
BoxDecoration(borderRadius: BorderRadius.circular(4)),
|
||||
child: _buildUserContacts(),
|
||||
).marginSymmetric(vertical: 8.0)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: MyGroupPeerView(
|
||||
menuPadding: widget.menuPadding,
|
||||
initPeers: gFFI.groupModel.peersShow.value)),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ class GroupModel {
|
||||
if (json.containsKey('error')) {
|
||||
throw json['error'];
|
||||
} else {
|
||||
total = json['total'];
|
||||
if (total == 0) total = json['total'];
|
||||
if (json.containsKey('data')) {
|
||||
final data = json['data'];
|
||||
if (data is List) {
|
||||
@ -76,7 +76,7 @@ class GroupModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (current < total);
|
||||
} while (current < total + 1);
|
||||
} catch (err) {
|
||||
debugPrint('$err');
|
||||
userLoadError.value = err.toString();
|
||||
@ -115,7 +115,7 @@ class GroupModel {
|
||||
if (json.containsKey('error')) {
|
||||
throw json['error'];
|
||||
} else {
|
||||
total = json['total'];
|
||||
if (total == 0) total = json['total'];
|
||||
if (json.containsKey('data')) {
|
||||
final data = json['data'];
|
||||
if (data is List) {
|
||||
@ -128,7 +128,7 @@ class GroupModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (current < total);
|
||||
} while (current < total + 1);
|
||||
} catch (err) {
|
||||
debugPrint('$err');
|
||||
peerLoadError.value = err.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user