2022-07-27 14:29:47 +08:00
|
|
|
import 'dart:async';
|
2022-06-02 16:23:20 +08:00
|
|
|
import 'dart:io';
|
2022-10-09 19:27:30 +08:00
|
|
|
import 'dart:convert';
|
2022-06-02 16:23:20 +08:00
|
|
|
|
2022-11-21 14:06:32 +08:00
|
|
|
import 'package:auto_size_text/auto_size_text.dart';
|
2023-03-04 14:28:43 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2022-07-14 12:32:01 +08:00
|
|
|
import 'package:flutter/services.dart';
|
2022-05-25 00:28:59 +08:00
|
|
|
import 'package:flutter_hbb/common.dart';
|
2023-06-21 11:51:35 +08:00
|
|
|
import 'package:flutter_hbb/common/widgets/animated_rotation_widget.dart';
|
2023-01-16 19:47:58 +08:00
|
|
|
import 'package:flutter_hbb/common/widgets/custom_password.dart';
|
2022-10-26 14:39:13 +08:00
|
|
|
import 'package:flutter_hbb/consts.dart';
|
2022-05-29 04:39:12 +08:00
|
|
|
import 'package:flutter_hbb/desktop/pages/connection_page.dart';
|
2022-09-23 18:28:40 +08:00
|
|
|
import 'package:flutter_hbb/desktop/pages/desktop_setting_page.dart';
|
|
|
|
import 'package:flutter_hbb/desktop/pages/desktop_tab_page.dart';
|
2022-09-28 11:20:57 +08:00
|
|
|
import 'package:flutter_hbb/desktop/widgets/scroll_wrapper.dart';
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart';
|
2022-08-03 22:03:31 +08:00
|
|
|
import 'package:flutter_hbb/models/platform_model.dart';
|
2022-08-01 20:42:30 +08:00
|
|
|
import 'package:flutter_hbb/models/server_model.dart';
|
2023-05-08 13:10:39 +08:00
|
|
|
import 'package:flutter_hbb/plugin/ui_manager.dart';
|
2022-08-09 09:01:06 +08:00
|
|
|
import 'package:flutter_hbb/utils/multi_window_manager.dart';
|
2022-07-14 12:32:01 +08:00
|
|
|
import 'package:get/get.dart';
|
2022-05-25 00:28:59 +08:00
|
|
|
import 'package:provider/provider.dart';
|
2022-09-25 21:45:37 +08:00
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
import 'package:window_manager/window_manager.dart';
|
2022-10-09 19:27:30 +08:00
|
|
|
import 'package:window_size/window_size.dart' as window_size;
|
2022-05-23 16:44:23 +08:00
|
|
|
|
2022-09-23 20:18:11 +08:00
|
|
|
import '../widgets/button.dart';
|
|
|
|
|
2022-05-23 16:44:23 +08:00
|
|
|
class DesktopHomePage extends StatefulWidget {
|
2022-09-06 17:08:59 +08:00
|
|
|
const DesktopHomePage({Key? key}) : super(key: key);
|
2022-05-23 16:44:23 +08:00
|
|
|
|
|
|
|
@override
|
2022-09-07 12:20:53 +08:00
|
|
|
State<DesktopHomePage> createState() => _DesktopHomePageState();
|
2022-05-23 16:44:23 +08:00
|
|
|
}
|
|
|
|
|
2022-05-29 19:55:50 +08:00
|
|
|
const borderColor = Color(0xFF2F65BA);
|
|
|
|
|
2022-08-09 20:36:52 +08:00
|
|
|
class _DesktopHomePageState extends State<DesktopHomePage>
|
2022-12-01 11:19:51 +08:00
|
|
|
with AutomaticKeepAliveClientMixin {
|
2022-09-28 11:20:57 +08:00
|
|
|
final _leftPaneScrollController = ScrollController();
|
|
|
|
|
2022-08-13 12:43:35 +08:00
|
|
|
@override
|
|
|
|
bool get wantKeepAlive => true;
|
2022-09-23 17:28:22 +08:00
|
|
|
var updateUrl = '';
|
2022-11-29 22:00:27 +08:00
|
|
|
var systemError = '';
|
2022-10-18 10:29:33 +08:00
|
|
|
StreamSubscription? _uniLinksSubscription;
|
2022-11-29 22:00:27 +08:00
|
|
|
var svcStopped = false.obs;
|
|
|
|
var watchIsCanScreenRecording = false;
|
|
|
|
var watchIsProcessTrust = false;
|
2023-01-06 13:19:08 +08:00
|
|
|
var watchIsInputMonitoring = false;
|
2023-01-31 13:32:10 +08:00
|
|
|
var watchIsCanRecordAudio = false;
|
2022-11-29 22:00:27 +08:00
|
|
|
Timer? _updateTimer;
|
2023-09-14 23:11:25 +08:00
|
|
|
bool isCardClosed = false;
|
2022-08-13 12:43:35 +08:00
|
|
|
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
RxBool _editHover = false.obs;
|
|
|
|
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
final GlobalKey _childKey = GlobalKey();
|
|
|
|
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
bool _isInHomePage() {
|
|
|
|
final controller = Get.find<DesktopTabController>();
|
|
|
|
return controller.state.value.selected == 0;
|
|
|
|
}
|
|
|
|
|
2022-05-23 16:44:23 +08:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-08-20 19:57:16 +08:00
|
|
|
super.build(context);
|
2024-03-15 00:26:53 +08:00
|
|
|
final isIncomingOnly = bind.isIncomingOnly();
|
2022-08-11 16:03:04 +08:00
|
|
|
return Row(
|
2022-09-28 11:20:57 +08:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
children: [
|
|
|
|
buildLeftPane(context),
|
2024-03-15 00:26:53 +08:00
|
|
|
if (!isIncomingOnly) const VerticalDivider(width: 1),
|
|
|
|
if (!isIncomingOnly) Expanded(child: buildRightPane(context)),
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
],
|
2022-05-25 00:28:59 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-09-28 11:20:57 +08:00
|
|
|
Widget buildLeftPane(BuildContext context) {
|
2024-03-15 00:26:53 +08:00
|
|
|
final isIncomingOnly = bind.isIncomingOnly();
|
|
|
|
final isOutgoingOnly = bind.isOutgoingOnly();
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
final children = <Widget>[
|
2024-03-15 00:26:53 +08:00
|
|
|
if (bind.isCustomClient())
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: MouseRegion(
|
|
|
|
cursor: SystemMouseCursors.click,
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
launchUrl(Uri.parse('https://rustdesk.com'));
|
|
|
|
},
|
|
|
|
child: Opacity(
|
|
|
|
opacity: 0.5,
|
|
|
|
child: Text(
|
|
|
|
translate("powered_by_me"),
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
|
|
|
fontSize: 9, decoration: TextDecoration.underline),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
).marginOnly(top: 6),
|
|
|
|
),
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
buildTip(context),
|
2024-03-15 00:26:53 +08:00
|
|
|
if (!isOutgoingOnly) buildIDBoard(context),
|
|
|
|
if (!isOutgoingOnly) buildPasswordBoard(context),
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
FutureBuilder<Widget>(
|
|
|
|
future: buildHelpCards(),
|
|
|
|
builder: (_, data) {
|
|
|
|
if (data.hasData) {
|
2024-03-15 00:26:53 +08:00
|
|
|
if (isIncomingOnly) {
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
if (_isInHomePage()) {
|
|
|
|
Future.delayed(Duration(milliseconds: 300), () {
|
|
|
|
_updateWindowSize();
|
|
|
|
});
|
|
|
|
}
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
}
|
|
|
|
return data.data!;
|
|
|
|
} else {
|
|
|
|
return const Offstage();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
buildPluginEntry(),
|
|
|
|
];
|
2024-03-15 00:26:53 +08:00
|
|
|
if (isIncomingOnly) {
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
children.addAll([
|
|
|
|
Divider(),
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.fromLTRB(0, 0, 8, 6),
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
child: OnlineStatusWidget(
|
|
|
|
onSvcStatusChanged: () {
|
|
|
|
if (_isInHomePage()) {
|
|
|
|
Future.delayed(Duration(milliseconds: 300), () {
|
|
|
|
_updateWindowSize();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
),
|
|
|
|
]);
|
|
|
|
}
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
2022-05-25 00:28:59 +08:00
|
|
|
return ChangeNotifierProvider.value(
|
2022-06-13 21:07:26 +08:00
|
|
|
value: gFFI.serverModel,
|
2022-05-29 10:25:36 +08:00
|
|
|
child: Container(
|
2024-03-15 00:26:53 +08:00
|
|
|
width: isIncomingOnly ? 280.0 : 200.0,
|
2023-02-23 23:49:31 +08:00
|
|
|
color: Theme.of(context).colorScheme.background,
|
2022-09-28 11:20:57 +08:00
|
|
|
child: DesktopScrollWrapper(
|
|
|
|
scrollController: _leftPaneScrollController,
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
SingleChildScrollView(
|
|
|
|
controller: _leftPaneScrollController,
|
|
|
|
physics: DraggableNeverScrollableScrollPhysics(),
|
|
|
|
child: Column(
|
|
|
|
key: _childKey,
|
|
|
|
children: children,
|
|
|
|
),
|
|
|
|
),
|
2024-03-15 00:26:53 +08:00
|
|
|
if (isOutgoingOnly)
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
Positioned(
|
|
|
|
bottom: 6,
|
|
|
|
left: 12,
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: InkWell(
|
|
|
|
child: Obx(
|
|
|
|
() => Icon(
|
|
|
|
Icons.settings,
|
|
|
|
color: _editHover.value
|
|
|
|
? textColor
|
|
|
|
: Colors.grey.withOpacity(0.5),
|
|
|
|
size: 22,
|
|
|
|
),
|
|
|
|
),
|
2024-03-15 00:26:53 +08:00
|
|
|
onTap: () => DesktopSettingPage.switch2page(0),
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
onHover: (value) => _editHover.value = value,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
2022-09-28 11:20:57 +08:00
|
|
|
),
|
2022-05-29 10:25:36 +08:00
|
|
|
),
|
2022-05-25 00:28:59 +08:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-09-19 18:38:19 +08:00
|
|
|
buildRightPane(BuildContext context) {
|
2022-08-20 19:57:16 +08:00
|
|
|
return Container(
|
2022-09-23 16:31:50 +08:00
|
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
2022-09-07 12:20:53 +08:00
|
|
|
child: ConnectionPage(),
|
2022-05-25 00:28:59 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
buildIDBoard(BuildContext context) {
|
2022-06-13 21:07:26 +08:00
|
|
|
final model = gFFI.serverModel;
|
2022-05-29 10:25:36 +08:00
|
|
|
return Container(
|
2022-09-04 20:57:57 +08:00
|
|
|
margin: const EdgeInsets.only(left: 20, right: 11),
|
|
|
|
height: 57,
|
2022-05-29 10:25:36 +08:00
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.baseline,
|
|
|
|
textBaseline: TextBaseline.alphabetic,
|
|
|
|
children: [
|
|
|
|
Container(
|
2022-08-20 19:57:16 +08:00
|
|
|
width: 2,
|
2022-09-03 18:19:50 +08:00
|
|
|
decoration: const BoxDecoration(color: MyTheme.accent),
|
2022-09-04 20:57:57 +08:00
|
|
|
).marginOnly(top: 5),
|
2022-05-29 10:25:36 +08:00
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
2022-09-04 20:57:57 +08:00
|
|
|
padding: const EdgeInsets.only(left: 7),
|
2022-05-29 10:25:36 +08:00
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
2022-09-07 12:20:53 +08:00
|
|
|
Container(
|
2022-08-24 11:01:58 +08:00
|
|
|
height: 25,
|
2022-08-20 19:57:16 +08:00
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
2022-08-24 11:01:58 +08:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
2022-08-20 19:57:16 +08:00
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
translate("ID"),
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14,
|
2022-09-23 16:31:50 +08:00
|
|
|
color: Theme.of(context)
|
|
|
|
.textTheme
|
|
|
|
.titleLarge
|
|
|
|
?.color
|
|
|
|
?.withOpacity(0.5)),
|
2022-09-04 20:57:57 +08:00
|
|
|
).marginOnly(top: 5),
|
2022-08-20 19:57:16 +08:00
|
|
|
buildPopupMenu(context)
|
|
|
|
],
|
|
|
|
),
|
2022-05-29 10:25:36 +08:00
|
|
|
),
|
2022-08-20 19:57:16 +08:00
|
|
|
Flexible(
|
|
|
|
child: GestureDetector(
|
2022-08-03 09:08:10 +08:00
|
|
|
onDoubleTap: () {
|
|
|
|
Clipboard.setData(
|
|
|
|
ClipboardData(text: model.serverId.text));
|
2022-08-15 14:39:31 +08:00
|
|
|
showToast(translate("Copied"));
|
2022-08-03 09:08:10 +08:00
|
|
|
},
|
|
|
|
child: TextFormField(
|
|
|
|
controller: model.serverId,
|
|
|
|
readOnly: true,
|
2022-09-07 12:20:53 +08:00
|
|
|
decoration: InputDecoration(
|
2022-08-20 19:57:16 +08:00
|
|
|
border: InputBorder.none,
|
2023-03-03 16:50:45 +08:00
|
|
|
contentPadding: EdgeInsets.only(top: 10, bottom: 10),
|
2022-08-20 19:57:16 +08:00
|
|
|
),
|
2022-09-07 12:20:53 +08:00
|
|
|
style: TextStyle(
|
2022-08-20 19:57:16 +08:00
|
|
|
fontSize: 22,
|
|
|
|
),
|
2022-08-22 17:58:48 +08:00
|
|
|
),
|
2022-08-20 19:57:16 +08:00
|
|
|
),
|
|
|
|
)
|
2022-05-29 10:25:36 +08:00
|
|
|
],
|
|
|
|
),
|
2022-05-25 00:28:59 +08:00
|
|
|
),
|
2022-05-29 10:25:36 +08:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-08-09 20:36:52 +08:00
|
|
|
Widget buildPopupMenu(BuildContext context) {
|
2022-09-23 16:31:50 +08:00
|
|
|
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
2022-08-20 19:57:16 +08:00
|
|
|
RxBool hover = false.obs;
|
|
|
|
return InkWell(
|
2022-09-23 18:28:40 +08:00
|
|
|
onTap: DesktopTabPage.onAddSetting,
|
2022-08-20 19:57:16 +08:00
|
|
|
child: Obx(
|
2022-08-24 11:01:58 +08:00
|
|
|
() => CircleAvatar(
|
2022-09-04 20:57:57 +08:00
|
|
|
radius: 15,
|
2022-08-24 11:01:58 +08:00
|
|
|
backgroundColor: hover.value
|
2022-09-23 16:31:50 +08:00
|
|
|
? Theme.of(context).scaffoldBackgroundColor
|
2023-02-23 23:49:31 +08:00
|
|
|
: Theme.of(context).colorScheme.background,
|
2023-08-12 15:22:15 +08:00
|
|
|
child: Tooltip(
|
2023-10-08 21:44:54 +08:00
|
|
|
message: translate('Settings'),
|
|
|
|
child: Icon(
|
|
|
|
Icons.more_vert_outlined,
|
|
|
|
size: 20,
|
|
|
|
color: hover.value ? textColor : textColor?.withOpacity(0.5),
|
|
|
|
)),
|
2022-08-20 19:57:16 +08:00
|
|
|
),
|
|
|
|
),
|
|
|
|
onHover: (value) => hover.value = value,
|
|
|
|
);
|
2022-07-27 14:29:47 +08:00
|
|
|
}
|
|
|
|
|
2022-05-29 10:25:36 +08:00
|
|
|
buildPasswordBoard(BuildContext context) {
|
2022-06-13 21:07:26 +08:00
|
|
|
final model = gFFI.serverModel;
|
2022-08-20 19:57:16 +08:00
|
|
|
RxBool refreshHover = false.obs;
|
2022-09-19 18:38:19 +08:00
|
|
|
RxBool editHover = false.obs;
|
2022-09-23 16:31:50 +08:00
|
|
|
final textColor = Theme.of(context).textTheme.titleLarge?.color;
|
2022-05-29 10:25:36 +08:00
|
|
|
return Container(
|
2022-08-22 17:58:48 +08:00
|
|
|
margin: EdgeInsets.only(left: 20.0, right: 16, top: 13, bottom: 13),
|
2022-05-29 10:25:36 +08:00
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.baseline,
|
|
|
|
textBaseline: TextBaseline.alphabetic,
|
|
|
|
children: [
|
|
|
|
Container(
|
2022-08-20 19:57:16 +08:00
|
|
|
width: 2,
|
|
|
|
height: 52,
|
2022-05-29 10:25:36 +08:00
|
|
|
decoration: BoxDecoration(color: MyTheme.accent),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
2022-09-04 20:57:57 +08:00
|
|
|
padding: const EdgeInsets.only(left: 7),
|
2022-05-29 10:25:36 +08:00
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
2022-11-21 14:06:32 +08:00
|
|
|
AutoSizeText(
|
|
|
|
translate("One-time Password"),
|
2022-08-20 19:57:16 +08:00
|
|
|
style: TextStyle(
|
2022-09-23 16:31:50 +08:00
|
|
|
fontSize: 14, color: textColor?.withOpacity(0.5)),
|
2022-11-21 14:06:32 +08:00
|
|
|
maxLines: 1,
|
2022-05-29 10:25:36 +08:00
|
|
|
),
|
2022-08-01 20:42:30 +08:00
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
2022-08-03 09:08:10 +08:00
|
|
|
child: GestureDetector(
|
|
|
|
onDoubleTap: () {
|
2022-08-11 21:29:43 +08:00
|
|
|
if (model.verificationMethod !=
|
|
|
|
kUsePermanentPassword) {
|
|
|
|
Clipboard.setData(
|
|
|
|
ClipboardData(text: model.serverPasswd.text));
|
2022-08-15 14:39:31 +08:00
|
|
|
showToast(translate("Copied"));
|
2022-08-11 21:29:43 +08:00
|
|
|
}
|
2022-08-03 09:08:10 +08:00
|
|
|
},
|
|
|
|
child: TextFormField(
|
|
|
|
controller: model.serverPasswd,
|
|
|
|
readOnly: true,
|
2022-08-20 19:57:16 +08:00
|
|
|
decoration: InputDecoration(
|
|
|
|
border: InputBorder.none,
|
2023-03-03 16:50:45 +08:00
|
|
|
contentPadding:
|
|
|
|
EdgeInsets.only(top: 14, bottom: 10),
|
2022-08-20 19:57:16 +08:00
|
|
|
),
|
|
|
|
style: TextStyle(fontSize: 15),
|
2022-08-03 09:08:10 +08:00
|
|
|
),
|
2022-08-01 20:42:30 +08:00
|
|
|
),
|
|
|
|
),
|
2023-06-21 11:51:35 +08:00
|
|
|
AnimatedRotationWidget(
|
|
|
|
onPressed: () => bind.mainUpdateTemporaryPassword(),
|
|
|
|
child: Obx(() => RotatedBox(
|
|
|
|
quarterTurns: 2,
|
2023-08-12 15:22:15 +08:00
|
|
|
child: Tooltip(
|
2023-10-08 21:44:54 +08:00
|
|
|
message: translate('Refresh Password'),
|
|
|
|
child: Icon(
|
|
|
|
Icons.refresh,
|
|
|
|
color: refreshHover.value
|
|
|
|
? textColor
|
|
|
|
: Color(0xFFDDDDDD),
|
|
|
|
size: 22,
|
|
|
|
)))),
|
2022-08-20 19:57:16 +08:00
|
|
|
onHover: (value) => refreshHover.value = value,
|
2023-06-21 11:51:35 +08:00
|
|
|
).marginOnly(right: 8, top: 4),
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
if (!bind.isDisableSettings())
|
|
|
|
InkWell(
|
|
|
|
child: Obx(
|
|
|
|
() => Tooltip(
|
|
|
|
message: translate('Change Password'),
|
|
|
|
child: Icon(
|
|
|
|
Icons.edit,
|
|
|
|
color: editHover.value
|
|
|
|
? textColor
|
|
|
|
: Color(0xFFDDDDDD),
|
|
|
|
size: 22,
|
|
|
|
)).marginOnly(right: 8, top: 4),
|
|
|
|
),
|
2024-03-15 00:26:53 +08:00
|
|
|
onTap: () => DesktopSettingPage.switch2page(0),
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
onHover: (value) => editHover.value = value,
|
2022-09-19 18:38:19 +08:00
|
|
|
),
|
2022-08-01 20:42:30 +08:00
|
|
|
],
|
2022-08-22 17:58:48 +08:00
|
|
|
),
|
2022-05-29 10:25:36 +08:00
|
|
|
],
|
2022-05-25 00:28:59 +08:00
|
|
|
),
|
|
|
|
),
|
2022-05-29 10:25:36 +08:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTip(BuildContext context) {
|
2024-03-15 00:26:53 +08:00
|
|
|
final isOutgoingOnly = bind.isOutgoingOnly();
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
final logo = loadLogo();
|
2022-05-29 10:25:36 +08:00
|
|
|
return Padding(
|
2022-08-22 17:58:48 +08:00
|
|
|
padding:
|
2022-09-04 20:57:57 +08:00
|
|
|
const EdgeInsets.only(left: 20.0, right: 16, top: 16.0, bottom: 5),
|
2022-05-29 10:25:36 +08:00
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: logo == null ? Offstage() : logo.marginOnly(bottom: 0.0),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
children: [
|
2024-03-15 00:26:53 +08:00
|
|
|
if (!isOutgoingOnly)
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
Align(
|
2024-03-15 00:26:53 +08:00
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
translate("Your Desktop"),
|
|
|
|
style: Theme.of(context).textTheme.titleLarge,
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
2022-05-29 10:25:36 +08:00
|
|
|
),
|
|
|
|
SizedBox(
|
2022-08-22 17:58:48 +08:00
|
|
|
height: 10.0,
|
2022-05-29 10:25:36 +08:00
|
|
|
),
|
2024-03-15 00:26:53 +08:00
|
|
|
if (!isOutgoingOnly)
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
Text(
|
|
|
|
translate("desk_tip"),
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
|
|
),
|
2024-03-15 00:26:53 +08:00
|
|
|
if (isOutgoingOnly)
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
Text(
|
|
|
|
translate("outgoing_only_desk_tip"),
|
|
|
|
overflow: TextOverflow.clip,
|
|
|
|
style: Theme.of(context).textTheme.bodySmall,
|
|
|
|
),
|
2022-05-29 10:25:36 +08:00
|
|
|
],
|
2022-05-25 00:28:59 +08:00
|
|
|
),
|
|
|
|
);
|
2022-05-23 16:44:23 +08:00
|
|
|
}
|
2022-06-02 16:23:20 +08:00
|
|
|
|
2023-01-31 13:32:10 +08:00
|
|
|
Future<Widget> buildHelpCards() async {
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
if (!bind.isCustomClient() &&
|
|
|
|
updateUrl.isNotEmpty &&
|
2024-02-25 13:29:06 +08:00
|
|
|
!isCardClosed &&
|
|
|
|
bind.mainUriPrefixSync().contains('rustdesk')) {
|
2022-09-25 21:45:37 +08:00
|
|
|
return buildInstallCard(
|
|
|
|
"Status",
|
|
|
|
"There is a newer version of ${bind.mainGetAppNameSync()} ${bind.mainGetNewVersion()} available.",
|
|
|
|
"Click to download", () async {
|
2023-07-03 16:43:39 +08:00
|
|
|
final Uri url = Uri.parse('https://rustdesk.com/download');
|
2022-09-25 21:45:37 +08:00
|
|
|
await launchUrl(url);
|
2023-10-17 00:30:34 +08:00
|
|
|
}, closeButton: true);
|
2022-09-23 17:28:22 +08:00
|
|
|
}
|
2022-11-29 22:00:27 +08:00
|
|
|
if (systemError.isNotEmpty) {
|
|
|
|
return buildInstallCard("", systemError, "", () {});
|
|
|
|
}
|
2024-03-15 00:26:53 +08:00
|
|
|
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
if (Platform.isWindows && !bind.isDisableInstallation()) {
|
2022-12-04 18:39:59 +08:00
|
|
|
if (!bind.mainIsInstalled()) {
|
2024-03-15 00:26:53 +08:00
|
|
|
return buildInstallCard(
|
|
|
|
"", bind.isOutgoingOnly() ? "" : "install_tip", "Install",
|
|
|
|
() async {
|
2023-11-07 09:09:05 +08:00
|
|
|
await rustDeskWinManager.closeAllSubWindows();
|
|
|
|
bind.mainGotoInstall();
|
|
|
|
});
|
2022-12-04 18:39:59 +08:00
|
|
|
} else if (bind.mainIsInstalledLowerVersion()) {
|
2023-11-07 09:09:05 +08:00
|
|
|
return buildInstallCard(
|
|
|
|
"Status", "Your installation is lower version.", "Click to upgrade",
|
|
|
|
() async {
|
|
|
|
await rustDeskWinManager.closeAllSubWindows();
|
|
|
|
bind.mainUpdateMe();
|
|
|
|
});
|
2022-12-04 18:39:59 +08:00
|
|
|
}
|
|
|
|
} else if (Platform.isMacOS) {
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
if (!(bind.isOutgoingOnly() ||
|
|
|
|
bind.mainIsCanScreenRecording(prompt: false))) {
|
2022-11-29 22:00:27 +08:00
|
|
|
return buildInstallCard("Permissions", "config_screen", "Configure",
|
|
|
|
() async {
|
|
|
|
bind.mainIsCanScreenRecording(prompt: true);
|
|
|
|
watchIsCanScreenRecording = true;
|
|
|
|
}, help: 'Help', link: translate("doc_mac_permission"));
|
|
|
|
} else if (!bind.mainIsProcessTrusted(prompt: false)) {
|
|
|
|
return buildInstallCard("Permissions", "config_acc", "Configure",
|
|
|
|
() async {
|
|
|
|
bind.mainIsProcessTrusted(prompt: true);
|
|
|
|
watchIsProcessTrust = true;
|
|
|
|
}, help: 'Help', link: translate("doc_mac_permission"));
|
2023-01-06 13:19:08 +08:00
|
|
|
} else if (!bind.mainIsCanInputMonitoring(prompt: false)) {
|
|
|
|
return buildInstallCard("Permissions", "config_input", "Configure",
|
|
|
|
() async {
|
|
|
|
bind.mainIsCanInputMonitoring(prompt: true);
|
|
|
|
watchIsInputMonitoring = true;
|
|
|
|
}, help: 'Help', link: translate("doc_mac_permission"));
|
2022-11-29 22:00:27 +08:00
|
|
|
} else if (!svcStopped.value &&
|
|
|
|
bind.mainIsInstalled() &&
|
|
|
|
!bind.mainIsInstalledDaemon(prompt: false)) {
|
|
|
|
return buildInstallCard("", "install_daemon_tip", "Install", () async {
|
|
|
|
bind.mainIsInstalledDaemon(prompt: true);
|
|
|
|
});
|
|
|
|
}
|
2023-02-07 20:38:27 +08:00
|
|
|
//// 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;
|
|
|
|
// });
|
|
|
|
// }
|
2022-12-04 18:39:59 +08:00
|
|
|
} else if (Platform.isLinux) {
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
if (bind.isOutgoingOnly()) {
|
|
|
|
return Container();
|
|
|
|
}
|
2023-10-21 23:24:54 +08:00
|
|
|
final LinuxCards = <Widget>[];
|
2023-10-22 14:22:15 +08:00
|
|
|
if (bind.isSelinuxEnforcing()) {
|
|
|
|
// Check is SELinux enforcing, but show user a tip of is SELinux enabled for simple.
|
2023-10-21 23:24:54 +08:00
|
|
|
final keyShowSelinuxHelpTip = "show-selinux-help-tip";
|
|
|
|
if (bind.mainGetLocalOption(key: keyShowSelinuxHelpTip) != 'N') {
|
|
|
|
LinuxCards.add(buildInstallCard(
|
2023-11-07 09:09:05 +08:00
|
|
|
"Warning",
|
|
|
|
"selinux_tip",
|
|
|
|
"",
|
|
|
|
() async {},
|
|
|
|
marginTop: LinuxCards.isEmpty ? 20.0 : 5.0,
|
|
|
|
help: 'Help',
|
|
|
|
link:
|
|
|
|
'https://rustdesk.com/docs/en/client/linux/#permissions-issue',
|
|
|
|
closeButton: true,
|
|
|
|
closeOption: keyShowSelinuxHelpTip,
|
2023-10-21 23:24:54 +08:00
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
2023-10-22 10:56:41 +08:00
|
|
|
if (bind.mainCurrentIsWayland()) {
|
|
|
|
LinuxCards.add(buildInstallCard(
|
|
|
|
"Warning", "wayland_experiment_tip", "", () async {},
|
|
|
|
marginTop: LinuxCards.isEmpty ? 20.0 : 5.0,
|
|
|
|
help: 'Help',
|
2024-02-14 19:49:06 +08:00
|
|
|
link: 'https://rustdesk.com/docs/en/client/linux/#x11-required'));
|
2023-10-22 10:56:41 +08:00
|
|
|
} else if (bind.mainIsLoginWayland()) {
|
|
|
|
LinuxCards.add(buildInstallCard("Warning",
|
|
|
|
"Login screen using Wayland is not supported", "", () async {},
|
|
|
|
marginTop: LinuxCards.isEmpty ? 20.0 : 5.0,
|
|
|
|
help: 'Help',
|
2024-02-14 19:49:06 +08:00
|
|
|
link: 'https://rustdesk.com/docs/en/client/linux/#login-screen'));
|
2023-10-22 10:56:41 +08:00
|
|
|
}
|
2023-10-21 23:24:54 +08:00
|
|
|
if (LinuxCards.isNotEmpty) {
|
|
|
|
return Column(
|
|
|
|
children: LinuxCards,
|
|
|
|
);
|
2022-12-04 18:39:59 +08:00
|
|
|
}
|
2022-11-29 22:00:27 +08:00
|
|
|
}
|
2022-09-23 17:28:22 +08:00
|
|
|
return Container();
|
|
|
|
}
|
|
|
|
|
2022-09-25 21:45:37 +08:00
|
|
|
Widget buildInstallCard(String title, String content, String btnText,
|
2022-11-29 22:00:27 +08:00
|
|
|
GestureTapCallback onPressed,
|
2023-11-07 09:09:05 +08:00
|
|
|
{double marginTop = 20.0,
|
|
|
|
String? help,
|
|
|
|
String? link,
|
|
|
|
bool? closeButton,
|
|
|
|
String? closeOption}) {
|
2023-10-21 23:24:54 +08:00
|
|
|
void closeCard() async {
|
|
|
|
if (closeOption != null) {
|
|
|
|
await bind.mainSetLocalOption(key: closeOption, value: 'N');
|
|
|
|
if (bind.mainGetLocalOption(key: closeOption) == 'N') {
|
|
|
|
setState(() {
|
|
|
|
isCardClosed = true;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
isCardClosed = true;
|
|
|
|
});
|
|
|
|
}
|
2023-09-14 23:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return Stack(
|
|
|
|
children: [
|
|
|
|
Container(
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
0, marginTop, 0, bind.isIncomingOnly() ? marginTop : 0),
|
2023-09-14 23:11:25 +08:00
|
|
|
child: Container(
|
2023-11-07 09:09:05 +08:00
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
begin: Alignment.centerLeft,
|
|
|
|
end: Alignment.centerRight,
|
|
|
|
colors: [
|
|
|
|
Color.fromARGB(255, 226, 66, 188),
|
|
|
|
Color.fromARGB(255, 244, 114, 124),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
padding: EdgeInsets.all(20),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: (title.isNotEmpty
|
|
|
|
? <Widget>[
|
|
|
|
Center(
|
2022-11-29 22:00:27 +08:00
|
|
|
child: Text(
|
2023-11-07 09:09:05 +08:00
|
|
|
translate(title),
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: 15),
|
|
|
|
).marginOnly(bottom: 6)),
|
|
|
|
]
|
|
|
|
: <Widget>[]) +
|
|
|
|
<Widget>[
|
2024-03-15 00:26:53 +08:00
|
|
|
if (content.isNotEmpty)
|
|
|
|
Text(
|
|
|
|
translate(content),
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.5,
|
|
|
|
color: Colors.white,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontSize: 13),
|
|
|
|
).marginOnly(bottom: 20)
|
2023-11-07 09:09:05 +08:00
|
|
|
] +
|
|
|
|
(btnText.isNotEmpty
|
|
|
|
? <Widget>[
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
FixedWidthButton(
|
|
|
|
width: 150,
|
|
|
|
padding: 8,
|
|
|
|
isOutline: true,
|
|
|
|
text: translate(btnText),
|
|
|
|
textColor: Colors.white,
|
|
|
|
borderColor: Colors.white,
|
|
|
|
textSize: 20,
|
|
|
|
radius: 10,
|
|
|
|
onTap: onPressed,
|
|
|
|
)
|
|
|
|
])
|
|
|
|
]
|
|
|
|
: <Widget>[]) +
|
|
|
|
(help != null
|
|
|
|
? <Widget>[
|
|
|
|
Center(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () async =>
|
|
|
|
await launchUrl(Uri.parse(link!)),
|
|
|
|
child: Text(
|
|
|
|
translate(help),
|
|
|
|
style: TextStyle(
|
|
|
|
decoration:
|
|
|
|
TextDecoration.underline,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 12),
|
|
|
|
)).marginOnly(top: 6)),
|
|
|
|
]
|
|
|
|
: <Widget>[]))),
|
2023-09-14 23:11:25 +08:00
|
|
|
),
|
|
|
|
if (closeButton != null && closeButton == true)
|
2023-11-07 09:09:05 +08:00
|
|
|
Positioned(
|
|
|
|
top: 18,
|
|
|
|
right: 0,
|
|
|
|
child: IconButton(
|
|
|
|
icon: Icon(
|
|
|
|
Icons.close,
|
|
|
|
color: Colors.white,
|
|
|
|
size: 20,
|
|
|
|
),
|
|
|
|
onPressed: closeCard,
|
2023-09-14 23:11:25 +08:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
2022-09-23 17:28:22 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2022-06-02 16:23:20 +08:00
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
2023-09-26 10:47:45 +08:00
|
|
|
Timer(const Duration(seconds: 1), () async {
|
|
|
|
updateUrl = await bind.mainGetSoftwareUpdateUrl();
|
|
|
|
if (updateUrl.isNotEmpty) setState(() {});
|
|
|
|
});
|
2022-11-29 22:36:35 +08:00
|
|
|
_updateTimer = periodic_immediate(const Duration(seconds: 1), () async {
|
|
|
|
await gFFI.serverModel.fetchID();
|
2022-11-29 22:00:27 +08:00
|
|
|
final error = await bind.mainGetError();
|
|
|
|
if (systemError != error) {
|
|
|
|
systemError = error;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
final v = await bind.mainGetOption(key: "stop-service") == "Y";
|
|
|
|
if (v != svcStopped.value) {
|
|
|
|
svcStopped.value = v;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
if (watchIsCanScreenRecording) {
|
|
|
|
if (bind.mainIsCanScreenRecording(prompt: false)) {
|
|
|
|
watchIsCanScreenRecording = false;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (watchIsProcessTrust) {
|
|
|
|
if (bind.mainIsProcessTrusted(prompt: false)) {
|
|
|
|
watchIsProcessTrust = false;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
2023-01-06 13:19:08 +08:00
|
|
|
if (watchIsInputMonitoring) {
|
|
|
|
if (bind.mainIsCanInputMonitoring(prompt: false)) {
|
|
|
|
watchIsInputMonitoring = false;
|
2023-02-21 18:43:43 +08:00
|
|
|
// Do not notify for now.
|
|
|
|
// Monitoring may not take effect until the process is restarted.
|
|
|
|
// rustDeskWinManager.call(
|
|
|
|
// WindowType.RemoteDesktop, kWindowDisableGrabKeyboard, '');
|
2023-01-06 13:19:08 +08:00
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
2023-01-31 13:32:10 +08:00
|
|
|
if (watchIsCanRecordAudio) {
|
|
|
|
if (Platform.isMacOS) {
|
|
|
|
Future.microtask(() async {
|
|
|
|
if ((await osxCanRecordAudio() ==
|
|
|
|
PermissionAuthorizeType.authorized)) {
|
|
|
|
watchIsCanRecordAudio = false;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
watchIsCanRecordAudio = false;
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
2022-09-23 17:28:22 +08:00
|
|
|
});
|
2022-11-29 22:00:27 +08:00
|
|
|
Get.put<RxBool>(svcStopped, tag: 'stop-service');
|
2022-11-05 23:41:22 +08:00
|
|
|
rustDeskWinManager.registerActiveWindowListener(onActiveWindowChanged);
|
2022-11-26 11:40:13 +08:00
|
|
|
|
2023-10-17 00:30:34 +08:00
|
|
|
screenToMap(window_size.Screen screen) => {
|
|
|
|
'frame': {
|
|
|
|
'l': screen.frame.left,
|
|
|
|
't': screen.frame.top,
|
|
|
|
'r': screen.frame.right,
|
|
|
|
'b': screen.frame.bottom,
|
|
|
|
},
|
|
|
|
'visibleFrame': {
|
|
|
|
'l': screen.visibleFrame.left,
|
|
|
|
't': screen.visibleFrame.top,
|
|
|
|
'r': screen.visibleFrame.right,
|
|
|
|
'b': screen.visibleFrame.bottom,
|
|
|
|
},
|
|
|
|
'scaleFactor': screen.scaleFactor,
|
|
|
|
};
|
|
|
|
|
2022-08-09 09:01:06 +08:00
|
|
|
rustDeskWinManager.setMethodHandler((call, fromWindowId) async {
|
2022-09-20 19:31:32 +08:00
|
|
|
debugPrint(
|
2022-11-05 23:41:22 +08:00
|
|
|
"[Main] call ${call.method} with args ${call.arguments} from window $fromWindowId");
|
2022-12-01 13:52:12 +08:00
|
|
|
if (call.method == kWindowMainWindowOnTop) {
|
2023-08-02 20:38:09 +08:00
|
|
|
windowOnTop(null);
|
2022-12-01 13:52:12 +08:00
|
|
|
} else if (call.method == kWindowGetWindowInfo) {
|
2022-10-09 19:27:30 +08:00
|
|
|
final screen = (await window_size.getWindowInfo()).screen;
|
|
|
|
if (screen == null) {
|
2023-10-17 00:30:34 +08:00
|
|
|
return '';
|
2022-10-09 19:27:30 +08:00
|
|
|
} else {
|
2023-10-17 00:30:34 +08:00
|
|
|
return jsonEncode(screenToMap(screen));
|
2022-10-09 19:27:30 +08:00
|
|
|
}
|
2023-10-17 00:30:34 +08:00
|
|
|
} else if (call.method == kWindowGetScreenList) {
|
|
|
|
return jsonEncode(
|
|
|
|
(await window_size.getScreenList()).map(screenToMap).toList());
|
2022-10-26 14:39:13 +08:00
|
|
|
} else if (call.method == kWindowActionRebuild) {
|
|
|
|
reloadCurrentWindow();
|
2022-11-05 23:41:22 +08:00
|
|
|
} else if (call.method == kWindowEventShow) {
|
2023-01-07 12:40:29 +08:00
|
|
|
await rustDeskWinManager.registerActiveWindow(call.arguments["id"]);
|
2022-11-05 23:41:22 +08:00
|
|
|
} else if (call.method == kWindowEventHide) {
|
2023-08-08 12:12:35 +08:00
|
|
|
await rustDeskWinManager.unregisterActiveWindow(call.arguments['id']);
|
2022-12-01 13:52:12 +08:00
|
|
|
} else if (call.method == kWindowConnect) {
|
|
|
|
await connectMainDesktop(
|
|
|
|
call.arguments['id'],
|
|
|
|
isFileTransfer: call.arguments['isFileTransfer'],
|
|
|
|
isTcpTunneling: call.arguments['isTcpTunneling'],
|
|
|
|
isRDP: call.arguments['isRDP'],
|
2023-02-13 16:40:24 +08:00
|
|
|
forceRelay: call.arguments['forceRelay'],
|
2022-12-01 13:52:12 +08:00
|
|
|
);
|
2023-08-06 11:21:07 +08:00
|
|
|
} else if (call.method == kWindowEventMoveTabToNewWindow) {
|
2023-08-06 10:19:30 +08:00
|
|
|
final args = call.arguments.split(',');
|
|
|
|
int? windowId;
|
|
|
|
try {
|
|
|
|
windowId = int.parse(args[0]);
|
|
|
|
} catch (e) {
|
|
|
|
debugPrint("Failed to parse window id '${call.arguments}': $e");
|
|
|
|
}
|
|
|
|
if (windowId != null) {
|
2023-10-08 21:44:54 +08:00
|
|
|
await rustDeskWinManager.moveTabToNewWindow(
|
|
|
|
windowId, args[1], args[2]);
|
2023-08-06 10:19:30 +08:00
|
|
|
}
|
2023-10-08 21:44:54 +08:00
|
|
|
} else if (call.method == kWindowEventOpenMonitorSession) {
|
|
|
|
final args = jsonDecode(call.arguments);
|
|
|
|
final windowId = args['window_id'] as int;
|
|
|
|
final peerId = args['peer_id'] as String;
|
|
|
|
final display = args['display'] as int;
|
|
|
|
final displayCount = args['display_count'] as int;
|
2023-10-17 09:36:08 +08:00
|
|
|
final screenRect = parseParamScreenRect(args);
|
2023-10-08 21:44:54 +08:00
|
|
|
await rustDeskWinManager.openMonitorSession(
|
2023-10-17 00:30:34 +08:00
|
|
|
windowId, peerId, display, displayCount, screenRect);
|
2022-08-09 09:01:06 +08:00
|
|
|
}
|
|
|
|
});
|
2022-10-18 10:29:33 +08:00
|
|
|
_uniLinksSubscription = listenUniLinks();
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
|
2024-03-12 21:47:29 +08:00
|
|
|
if (bind.isIncomingOnly()) {
|
Feat. Quick support, ui (#7267)
* Feat. QS ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Remove 'Quick support'
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* add help card
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* use addPostFrameCallback to get child size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Fix. qs, set home window size
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, set setResizable for settings page
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, help cards margin bottom
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, online status, use margin instead of padding
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Qs, fix, start cm window
Signed-off-by: fufesou <shuanglongchen@yeah.net>
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
2024-02-27 17:02:10 +08:00
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
_updateWindowSize();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_updateWindowSize() {
|
Fix/custom client styles (#7373)
* Fix. qs styles
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* custom client, options
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Move logo.svg to icon.svg
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Refact. Custom client, connection status ui.
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client ui. Disable settings, hide "Change password"
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, logo align center
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, refact, outgoing ui
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, outgoing, settings icon
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, powered by RustDesk
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Custom client, remove unused SizeBox
Signed-off-by: fufesou <shuanglongchen@yeah.net>
* Update config.rs
* Update flutter_ffi.rs
---------
Signed-off-by: fufesou <shuanglongchen@yeah.net>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
2024-03-14 11:36:14 +08:00
|
|
|
RenderObject? renderObject = _childKey.currentContext?.findRenderObject();
|
|
|
|
if (renderObject == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (renderObject is RenderBox) {
|
|
|
|
final size = renderObject.size;
|
|
|
|
if (size != imcomingOnlyHomeSize) {
|
|
|
|
imcomingOnlyHomeSize = size;
|
|
|
|
windowManager.setSize(getIncomingOnlyHomeSize());
|
|
|
|
}
|
|
|
|
}
|
2022-06-02 16:23:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
2022-10-18 10:29:33 +08:00
|
|
|
_uniLinksSubscription?.cancel();
|
2022-11-29 22:00:27 +08:00
|
|
|
Get.delete<RxBool>(tag: 'stop-service');
|
|
|
|
_updateTimer?.cancel();
|
2022-06-02 16:23:20 +08:00
|
|
|
super.dispose();
|
|
|
|
}
|
2023-06-21 11:51:35 +08:00
|
|
|
|
2023-05-08 13:10:39 +08:00
|
|
|
Widget buildPluginEntry() {
|
|
|
|
final entries = PluginUiManager.instance.entries.entries;
|
|
|
|
return Offstage(
|
|
|
|
offstage: entries.isEmpty,
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
2023-06-21 11:51:35 +08:00
|
|
|
...entries.map((entry) {
|
2023-05-08 13:10:39 +08:00
|
|
|
return entry.value;
|
|
|
|
})
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2022-05-23 16:44:23 +08:00
|
|
|
}
|
2022-07-27 14:29:47 +08:00
|
|
|
|
2022-08-08 22:27:27 +08:00
|
|
|
void setPasswordDialog() async {
|
|
|
|
final pw = await bind.mainGetPermanentPassword();
|
2022-08-01 20:42:30 +08:00
|
|
|
final p0 = TextEditingController(text: pw);
|
|
|
|
final p1 = TextEditingController(text: pw);
|
|
|
|
var errMsg0 = "";
|
|
|
|
var errMsg1 = "";
|
2023-01-18 13:54:56 +08:00
|
|
|
final RxString rxPass = pw.trim().obs;
|
2023-01-16 19:47:58 +08:00
|
|
|
final rules = [
|
|
|
|
DigitValidationRule(),
|
|
|
|
UppercaseValidationRule(),
|
|
|
|
LowercaseValidationRule(),
|
|
|
|
// SpecialCharacterValidationRule(),
|
|
|
|
MinCharactersValidationRule(8),
|
|
|
|
];
|
2022-08-01 20:42:30 +08:00
|
|
|
|
2023-05-08 12:34:19 +08:00
|
|
|
gFFI.dialogManager.show((setState, close, context) {
|
2022-09-03 18:19:50 +08:00
|
|
|
submit() {
|
|
|
|
setState(() {
|
|
|
|
errMsg0 = "";
|
|
|
|
errMsg1 = "";
|
|
|
|
});
|
|
|
|
final pass = p0.text.trim();
|
2023-01-16 19:47:58 +08:00
|
|
|
if (pass.isNotEmpty) {
|
2023-02-17 02:20:26 +08:00
|
|
|
final Iterable violations = rules.where((r) => !r.validate(pass));
|
|
|
|
if (violations.isNotEmpty) {
|
|
|
|
setState(() {
|
|
|
|
errMsg0 =
|
|
|
|
'${translate('Prompt')}: ${violations.map((r) => r.name).join(', ')}';
|
|
|
|
});
|
|
|
|
return;
|
2023-01-16 19:47:58 +08:00
|
|
|
}
|
2022-09-03 18:19:50 +08:00
|
|
|
}
|
|
|
|
if (p1.text.trim() != pass) {
|
|
|
|
setState(() {
|
2023-01-16 19:47:58 +08:00
|
|
|
errMsg1 =
|
|
|
|
'${translate('Prompt')}: ${translate("The confirmation is not identical.")}';
|
2022-09-03 18:19:50 +08:00
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
bind.mainSetPermanentPassword(password: pass);
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
2022-08-01 20:42:30 +08:00
|
|
|
return CustomAlertDialog(
|
|
|
|
title: Text(translate("Set Password")),
|
|
|
|
content: ConstrainedBox(
|
2022-09-03 18:19:50 +08:00
|
|
|
constraints: const BoxConstraints(minWidth: 500),
|
2022-08-01 20:42:30 +08:00
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
2022-09-03 18:19:50 +08:00
|
|
|
const SizedBox(
|
2022-08-01 20:42:30 +08:00
|
|
|
height: 8.0,
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
obscureText: true,
|
|
|
|
decoration: InputDecoration(
|
2023-01-16 19:47:58 +08:00
|
|
|
labelText: translate('Password'),
|
2022-08-01 20:42:30 +08:00
|
|
|
errorText: errMsg0.isNotEmpty ? errMsg0 : null),
|
|
|
|
controller: p0,
|
2023-02-12 09:03:13 +08:00
|
|
|
autofocus: true,
|
2023-01-16 19:47:58 +08:00
|
|
|
onChanged: (value) {
|
2023-01-18 13:54:56 +08:00
|
|
|
rxPass.value = value.trim();
|
2023-02-17 02:20:26 +08:00
|
|
|
setState(() {
|
|
|
|
errMsg0 = '';
|
|
|
|
});
|
2023-01-16 19:47:58 +08:00
|
|
|
},
|
2022-08-01 20:42:30 +08:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2023-01-16 19:47:58 +08:00
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(child: PasswordStrengthIndicator(password: rxPass)),
|
|
|
|
],
|
|
|
|
).marginSymmetric(vertical: 8),
|
2022-09-03 18:19:50 +08:00
|
|
|
const SizedBox(
|
2022-08-01 20:42:30 +08:00
|
|
|
height: 8.0,
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
obscureText: true,
|
|
|
|
decoration: InputDecoration(
|
2023-01-16 19:47:58 +08:00
|
|
|
labelText: translate('Confirmation'),
|
2022-08-01 20:42:30 +08:00
|
|
|
errorText: errMsg1.isNotEmpty ? errMsg1 : null),
|
|
|
|
controller: p1,
|
2023-02-17 02:20:26 +08:00
|
|
|
onChanged: (value) {
|
|
|
|
setState(() {
|
|
|
|
errMsg1 = '';
|
|
|
|
});
|
|
|
|
},
|
2022-08-01 20:42:30 +08:00
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2023-01-16 19:47:58 +08:00
|
|
|
const SizedBox(
|
|
|
|
height: 8.0,
|
|
|
|
),
|
|
|
|
Obx(() => Wrap(
|
|
|
|
runSpacing: 8,
|
|
|
|
spacing: 4,
|
|
|
|
children: rules.map((e) {
|
|
|
|
var checked = e.validate(rxPass.value.trim());
|
|
|
|
return Chip(
|
|
|
|
label: Text(
|
|
|
|
e.name,
|
|
|
|
style: TextStyle(
|
|
|
|
color: checked
|
|
|
|
? const Color(0xFF0A9471)
|
|
|
|
: Color.fromARGB(255, 198, 86, 157)),
|
|
|
|
),
|
|
|
|
backgroundColor: checked
|
|
|
|
? const Color(0xFFD0F7ED)
|
|
|
|
: Color.fromARGB(255, 247, 205, 232));
|
|
|
|
}).toList(),
|
|
|
|
))
|
2022-08-01 20:42:30 +08:00
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
actions: [
|
2023-01-15 19:46:16 +08:00
|
|
|
dialogButton("Cancel", onPressed: close, isOutline: true),
|
|
|
|
dialogButton("OK", onPressed: submit),
|
2022-08-01 20:42:30 +08:00
|
|
|
],
|
2022-09-03 18:19:50 +08:00
|
|
|
onSubmit: submit,
|
|
|
|
onCancel: close,
|
2022-08-01 20:42:30 +08:00
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|