fix connection status style
This commit is contained in:
parent
e0d759c3bb
commit
0679d01a63
@ -94,8 +94,8 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
).marginSymmetric(horizontal: 22),
|
).marginSymmetric(horizontal: 22),
|
||||||
),
|
),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
SizedBox(height: 50, child: Obx(() => buildStatus()))
|
SizedBox(child: Obx(() => buildStatus()))
|
||||||
.paddingSymmetric(horizontal: 12.0)
|
.paddingOnly(bottom: 12, top: 6),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -303,6 +303,8 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
var svcIsUsingPublicServer = true.obs;
|
var svcIsUsingPublicServer = true.obs;
|
||||||
|
|
||||||
Widget buildStatus() {
|
Widget buildStatus() {
|
||||||
|
final fontSize = 14.0;
|
||||||
|
final textStyle = TextStyle(fontSize: fontSize);
|
||||||
final light = Container(
|
final light = Container(
|
||||||
height: 8,
|
height: 8,
|
||||||
width: 8,
|
width: 8,
|
||||||
@ -310,13 +312,13 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
color: svcStopped.value ? Colors.redAccent : Colors.green,
|
color: svcStopped.value ? Colors.redAccent : Colors.green,
|
||||||
),
|
),
|
||||||
).paddingSymmetric(horizontal: 10.0);
|
).paddingSymmetric(horizontal: 12.0);
|
||||||
if (svcStopped.value) {
|
if (svcStopped.value) {
|
||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
light,
|
light,
|
||||||
Text(translate("Service is not running")),
|
Text(translate("Service is not running"), style: textStyle),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
bool checked = await bind.mainCheckSuperUserPermission();
|
bool checked = await bind.mainCheckSuperUserPermission();
|
||||||
@ -324,19 +326,25 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
bind.mainSetOption(key: "stop-service", value: "");
|
bind.mainSetOption(key: "stop-service", value: "");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(translate("Start Service")))
|
child: Text(translate("Start Service"), style: textStyle))
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if (svcStatusCode.value == 0) {
|
if (svcStatusCode.value == 0) {
|
||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [light, Text(translate("connecting_status"))],
|
children: [
|
||||||
|
light,
|
||||||
|
Text(translate("connecting_status"), style: textStyle)
|
||||||
|
],
|
||||||
);
|
);
|
||||||
} else if (svcStatusCode.value == -1) {
|
} else if (svcStatusCode.value == -1) {
|
||||||
return Row(
|
return Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [light, Text(translate("not_ready_status"))],
|
children: [
|
||||||
|
light,
|
||||||
|
Text(translate("not_ready_status"), style: textStyle)
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -344,13 +352,15 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
light,
|
light,
|
||||||
Text(translate('Ready')),
|
Text(translate('Ready'), style: textStyle),
|
||||||
|
Text(', ', style: textStyle),
|
||||||
svcIsUsingPublicServer.value
|
svcIsUsingPublicServer.value
|
||||||
? InkWell(
|
? InkWell(
|
||||||
onTap: onUsePublicServerGuide,
|
onTap: onUsePublicServerGuide,
|
||||||
child: Text(
|
child: Text(
|
||||||
', ${translate('setup_server_tip')}',
|
translate('setup_server_tip'),
|
||||||
style: TextStyle(decoration: TextDecoration.underline),
|
style: TextStyle(
|
||||||
|
decoration: TextDecoration.underline, fontSize: fontSize),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: Offstage()
|
: Offstage()
|
||||||
@ -424,7 +434,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(translate("${model.abError}")),
|
Text(translate(model.abError)),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user