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