Mobile. Share Screen. Remove "connection" headline for connection state
This commit is contained in:
parent
b86f27f8bd
commit
2a5d379c60
@ -202,28 +202,38 @@ class ServerInfo extends StatelessWidget {
|
|||||||
final isPermanent = model.verificationMethod == kUsePermanentPassword;
|
final isPermanent = model.verificationMethod == kUsePermanentPassword;
|
||||||
final serverModel = Provider.of<ServerModel>(context);
|
final serverModel = Provider.of<ServerModel>(context);
|
||||||
|
|
||||||
// @todo Theming
|
const Color colorPositive = Colors.green;
|
||||||
Widget ConnectionStateNotification() {
|
const Color colorNegative = Colors.red;
|
||||||
const Color colorPositive = Colors.greenAccent;
|
const double iconMarginRight = 15;
|
||||||
const Color colorNegative = Colors.redAccent;
|
const double iconSize = 24;
|
||||||
const double paddingRight = 12;
|
const TextStyle textStyleHeading = TextStyle(
|
||||||
|
fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.grey);
|
||||||
|
const TextStyle textStyleValue =
|
||||||
|
TextStyle(fontSize: 25.0, fontWeight: FontWeight.bold);
|
||||||
|
|
||||||
|
void copyToClipboard(String value) {
|
||||||
|
Clipboard.setData(ClipboardData(text: value));
|
||||||
|
showToast(translate('Copied'));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget ConnectionStateNotification() {
|
||||||
if (serverModel.connectStatus == -1) {
|
if (serverModel.connectStatus == -1) {
|
||||||
return Row(children: [
|
return Row(children: [
|
||||||
const Icon(Icons.warning_amber_sharp, color: colorNegative, size: 24)
|
const Icon(Icons.warning_amber_sharp,
|
||||||
.marginOnly(right: paddingRight),
|
color: colorNegative, size: iconSize)
|
||||||
|
.marginOnly(right: iconMarginRight),
|
||||||
Expanded(child: Text(translate('not_ready_status')))
|
Expanded(child: Text(translate('not_ready_status')))
|
||||||
]);
|
]);
|
||||||
} else if (serverModel.connectStatus == 0) {
|
} else if (serverModel.connectStatus == 0) {
|
||||||
return Row(children: [
|
return Row(children: [
|
||||||
SizedBox(width: 20, height: 20, child: CircularProgressIndicator())
|
SizedBox(width: 20, height: 20, child: CircularProgressIndicator())
|
||||||
.marginOnly(left: 4, right: paddingRight),
|
.marginOnly(left: 4, right: iconMarginRight),
|
||||||
Expanded(child: Text(translate('connecting_status')))
|
Expanded(child: Text(translate('connecting_status')))
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
return Row(children: [
|
return Row(children: [
|
||||||
const Icon(Icons.check, color: colorPositive, size: 24)
|
const Icon(Icons.check, color: colorPositive, size: iconSize)
|
||||||
.marginOnly(right: paddingRight),
|
.marginOnly(right: iconMarginRight),
|
||||||
Expanded(child: Text(translate('Ready')))
|
Expanded(child: Text(translate('Ready')))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -233,53 +243,42 @@ class ServerInfo extends StatelessWidget {
|
|||||||
title: translate('Your Device'),
|
title: translate('Your Device'),
|
||||||
child: Column(
|
child: Column(
|
||||||
// mainAxisSize: MainAxisSize.min,
|
// mainAxisSize: MainAxisSize.min,
|
||||||
|
|
||||||
// ID
|
// ID
|
||||||
children: [
|
children: [
|
||||||
Row(children: [
|
Row(children: [
|
||||||
const Icon(Icons.perm_identity, color: Colors.grey, size: 24)
|
const Icon(Icons.perm_identity,
|
||||||
.marginOnly(right: 12),
|
color: Colors.grey, size: iconSize)
|
||||||
|
.marginOnly(right: iconMarginRight),
|
||||||
Text(
|
Text(
|
||||||
translate('ID'),
|
translate('ID'),
|
||||||
style: const TextStyle(
|
style: textStyleHeading,
|
||||||
fontSize: 16.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.grey),
|
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||||
Text(
|
Text(
|
||||||
model.serverId.value.text,
|
model.serverId.value.text,
|
||||||
style: const TextStyle(
|
style: textStyleValue,
|
||||||
fontSize: 25.0, fontWeight: FontWeight.bold),
|
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
icon: Icon(Icons.copy_outlined),
|
icon: Icon(Icons.copy_outlined),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Clipboard.setData(
|
copyToClipboard(model.serverId.value.text.trim());
|
||||||
ClipboardData(text: model.serverId.value.text.trim()));
|
|
||||||
showToast(translate('ID copied'));
|
|
||||||
})
|
})
|
||||||
]).marginOnly(left: 35, bottom: 10),
|
]).marginOnly(left: 39, bottom: 10),
|
||||||
|
|
||||||
// Password
|
// Password
|
||||||
Row(children: [
|
Row(children: [
|
||||||
const Icon(Icons.lock_outline, color: Colors.grey, size: 24)
|
const Icon(Icons.lock_outline, color: Colors.grey, size: iconSize)
|
||||||
.marginOnly(right: 12),
|
.marginOnly(right: iconMarginRight),
|
||||||
Text(
|
Text(
|
||||||
translate('One-time Password'),
|
translate('One-time Password'),
|
||||||
style: const TextStyle(
|
style: textStyleHeading,
|
||||||
fontSize: 16.0,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.grey),
|
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||||
Text(
|
Text(
|
||||||
isPermanent ? '-' : model.serverPasswd.value.text,
|
isPermanent ? '-' : model.serverPasswd.value.text,
|
||||||
style: const TextStyle(
|
style: textStyleValue,
|
||||||
fontSize: 25.0, fontWeight: FontWeight.bold),
|
|
||||||
),
|
),
|
||||||
isPermanent
|
isPermanent
|
||||||
? SizedBox.shrink()
|
? SizedBox.shrink()
|
||||||
@ -292,13 +291,11 @@ class ServerInfo extends StatelessWidget {
|
|||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
icon: Icon(Icons.copy_outlined),
|
icon: Icon(Icons.copy_outlined),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Clipboard.setData(ClipboardData(
|
copyToClipboard(
|
||||||
text: model.serverPasswd.value.text.trim()));
|
model.serverPasswd.value.text.trim());
|
||||||
showToast(translate('Password copied'));
|
|
||||||
})
|
})
|
||||||
])
|
])
|
||||||
]).marginOnly(left: 35, bottom: 10),
|
]).marginOnly(left: 40, bottom: 15),
|
||||||
|
|
||||||
ConnectionStateNotification()
|
ConnectionStateNotification()
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user