Fix. Custom client, connection status (#7586)
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
1cfc9b6139
commit
74af7ef8b2
@ -64,30 +64,7 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final isIncomingOnly = bind.isIncomingOnly();
|
final isIncomingOnly = bind.isIncomingOnly();
|
||||||
return Container(
|
startServiceWidget() => Offstage(
|
||||||
height: height,
|
|
||||||
child: Obx(() => Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
height: 8,
|
|
||||||
width: 8,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
color: _svcStopped.value ||
|
|
||||||
stateGlobal.svcStatus.value == SvcStatus.connecting
|
|
||||||
? kColorWarn
|
|
||||||
: (stateGlobal.svcStatus.value == SvcStatus.ready
|
|
||||||
? Color.fromARGB(255, 50, 190, 166)
|
|
||||||
: Color.fromARGB(255, 224, 79, 95)),
|
|
||||||
),
|
|
||||||
).marginSymmetric(horizontal: em),
|
|
||||||
Container(
|
|
||||||
width: isIncomingOnly ? 226 : null,
|
|
||||||
child: _buildConnStatusMsg(),
|
|
||||||
),
|
|
||||||
// stop
|
|
||||||
Offstage(
|
|
||||||
offstage: !_svcStopped.value,
|
offstage: !_svcStopped.value,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
@ -95,14 +72,11 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
|
|||||||
},
|
},
|
||||||
child: Text(translate("Start service"),
|
child: Text(translate("Start service"),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
decoration: TextDecoration.underline,
|
decoration: TextDecoration.underline, fontSize: em)))
|
||||||
fontSize: em)))
|
|
||||||
.marginOnly(left: em),
|
.marginOnly(left: em),
|
||||||
),
|
);
|
||||||
// ready && public
|
|
||||||
// No need to show the guide if is custom client.
|
setupServerWidget() => Flexible(
|
||||||
if (!isIncomingOnly)
|
|
||||||
Flexible(
|
|
||||||
child: Offstage(
|
child: Offstage(
|
||||||
offstage: !(!_svcStopped.value &&
|
offstage: !(!_svcStopped.value &&
|
||||||
stateGlobal.svcStatus.value == SvcStatus.ready &&
|
stateGlobal.svcStatus.value == SvcStatus.ready &&
|
||||||
@ -131,9 +105,49 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
);
|
||||||
|
|
||||||
|
basicWidget() => Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 8,
|
||||||
|
width: 8,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
color: _svcStopped.value ||
|
||||||
|
stateGlobal.svcStatus.value == SvcStatus.connecting
|
||||||
|
? kColorWarn
|
||||||
|
: (stateGlobal.svcStatus.value == SvcStatus.ready
|
||||||
|
? Color.fromARGB(255, 50, 190, 166)
|
||||||
|
: Color.fromARGB(255, 224, 79, 95)),
|
||||||
|
),
|
||||||
|
).marginSymmetric(horizontal: em),
|
||||||
|
Container(
|
||||||
|
width: isIncomingOnly ? 226 : null,
|
||||||
|
child: _buildConnStatusMsg(),
|
||||||
|
),
|
||||||
|
// stop
|
||||||
|
if (!isIncomingOnly) startServiceWidget(),
|
||||||
|
// ready && public
|
||||||
|
// No need to show the guide if is custom client.
|
||||||
|
if (!isIncomingOnly) setupServerWidget(),
|
||||||
],
|
],
|
||||||
)),
|
);
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
height: height,
|
||||||
|
child: Obx(() => isIncomingOnly
|
||||||
|
? Column(
|
||||||
|
children: [
|
||||||
|
basicWidget(),
|
||||||
|
Align(
|
||||||
|
child: startServiceWidget(),
|
||||||
|
alignment: Alignment.centerLeft)
|
||||||
|
.marginOnly(top: 2.0, left: 22.0),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: basicWidget()),
|
||||||
).paddingOnly(right: isIncomingOnly ? 8 : 0);
|
).paddingOnly(right: isIncomingOnly ? 8 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user