Fix const constructor error and finalize UI changes

This commit is contained in:
Enoydu 2026-05-23 03:51:30 +00:00
commit 0341835777

View file

@ -34,7 +34,7 @@ class DesktopHomePage extends StatefulWidget {
}
const borderColor = Color(0xFF2F65BA);
//
//
const String _contactPhone = "+852 23889095";
const String _whatsappUrl = "https://wa.me/85269994200";
const String _whatsappNumber = "+852 69994200";
@ -69,9 +69,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildLeftPane(context),
// 线
// if (!isIncomingOnly) const VerticalDivider(width: 1),
// if (!isIncomingOnly) Expanded(child: buildRightPane(context)),
//
],
));
}
@ -166,7 +164,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
if (data.hasData) {
if (isIncomingOnly) {
if (isInHomePage()) {
Future.delayed(Duration(milliseconds: 300), () {
Future.delayed(const Duration(milliseconds: 300), () {
_updateWindowSize();
});
}
@ -180,13 +178,13 @@ class _DesktopHomePageState extends State<DesktopHomePage>
buildPluginEntry(),
];
//
//
children.addAll([
const Divider(),
OnlineStatusWidget(
onSvcStatusChanged: () {
if (isInHomePage()) {
Future.delayed(Duration(milliseconds: 300), () {
Future.delayed(const Duration(milliseconds: 300), () {
_updateWindowSize();
});
}
@ -194,7 +192,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
).marginOnly(bottom: 6, right: 6),
]);
//
//
children.add(_buildContactInfo(context));
final textColor = Theme.of(context).textTheme.titleLarge?.color;
@ -306,7 +304,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
child: TextFormField(
controller: model.serverId,
readOnly: true,
decoration: InputDecoration(
decoration: const InputDecoration(
border: InputBorder.none,
contentPadding: EdgeInsets.only(top: 10, bottom: 10),
),
@ -367,7 +365,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
final showOneTime = model.approveMode != 'click' &&
model.verificationMethod != kUsePermanentPassword;
return Container(
margin: EdgeInsets.only(left: 20.0, right: 16, top: 13, bottom: 13),
margin: const EdgeInsets.only(left: 20.0, right: 16, top: 13, bottom: 13),
child: Row(
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
@ -375,7 +373,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
Container(
width: 2,
height: 52,
decoration: BoxDecoration(color: MyTheme.accent),
decoration: const BoxDecoration(color: MyTheme.accent),
),
Expanded(
child: Padding(
@ -403,7 +401,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
child: TextFormField(
controller: model.serverPasswd,
readOnly: true,
decoration: InputDecoration(
decoration: const InputDecoration(
border: InputBorder.none,
contentPadding:
EdgeInsets.only(top: 14, bottom: 10),
@ -574,22 +572,12 @@ class _DesktopHomePageState extends State<DesktopHomePage>
bind.mainIsInstalledDaemon(prompt: true);
});
}
//// Disable microphone configuration for macOS. We will request the permission when needed.
// else if ((await osxCanRecordAudio() !=
// PermissionAuthorizeType.authorized)) {
// return buildInstallCard("Permissions", "config_microphone", "Configure",
// () async {
// osxRequestAudio();
// watchIsCanRecordAudio = true;
// });
// }
} else if (isLinux) {
if (bind.isOutgoingOnly()) {
return Container();
}
final LinuxCards = <Widget>[];
if (bind.isSelinuxEnforcing()) {
// Check is SELinux enforcing, but show user a tip of is SELinux enabled for simple.
final keyShowSelinuxHelpTip = "show-selinux-help-tip";
if (bind.mainGetLocalOption(key: keyShowSelinuxHelpTip) != 'N') {
LinuxCards.add(buildInstallCard(
@ -631,7 +619,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
child: OutlinedButton(
onPressed: () {
SystemNavigator.pop(); // Close the application
// https://github.com/flutter/flutter/issues/66631
if (isWindows) {
exit(0);
}
@ -794,10 +781,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
if (watchIsInputMonitoring) {
if (bind.mainIsCanInputMonitoring(prompt: false)) {
watchIsInputMonitoring = false;
// Do not notify for now.
// Monitoring may not take effect until the process is restarted.
// rustDeskWinManager.call(
// WindowType.RemoteDesktop, kWindowDisableGrabKeyboard, '');
setState(() {});
}
}
@ -839,7 +822,6 @@ class _DesktopHomePageState extends State<DesktopHomePage>
switch (methodName) {
case kWindowBumpMouse: return true;
}
return false;
}
@ -993,7 +975,6 @@ void setPasswordDialog({VoidCallback? notEmptyCallback}) async {
DigitValidationRule(),
UppercaseValidationRule(),
LowercaseValidationRule(),
// SpecialCharacterValidationRule(),
MinCharactersValidationRule(8),
];
final maxLength = bind.mainMaxEncryptLen();
@ -1213,4 +1194,4 @@ void setPasswordDialog({VoidCallback? notEmptyCallback}) async {
onCancel: close,
);
});
}
}