mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-02-23 00:24:20 +01:00
fix & opt.
- fix: `sftpGoPath` - opt.: `PersistentStore.toJson` - rm: `first` store - opt.: log print
This commit is contained in:
@@ -44,13 +44,13 @@ class BackupPage extends StatelessWidget {
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(17),
|
||||
children: [
|
||||
if (isMacOS || isIOS) _buildIcloudSync(context),
|
||||
_buildManual(context),
|
||||
if (isMacOS || isIOS) _buildIcloud(context),
|
||||
_buildFile(context),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildManual(BuildContext context) {
|
||||
Widget _buildFile(BuildContext context) {
|
||||
return CardX(
|
||||
ExpandTile(
|
||||
title: Text(l10n.files),
|
||||
@@ -75,7 +75,7 @@ class BackupPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildIcloudSync(BuildContext context) {
|
||||
Widget _buildIcloud(BuildContext context) {
|
||||
return CardX(
|
||||
ExpandTile(
|
||||
title: const Text('iCloud'),
|
||||
@@ -109,8 +109,8 @@ class BackupPage extends StatelessWidget {
|
||||
if (icloudLoading.value) {
|
||||
return UIs.centerSizedLoadingSmall;
|
||||
}
|
||||
return SizedBox(
|
||||
width: 120,
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 137),
|
||||
child: Row(
|
||||
children: [
|
||||
TextButton(
|
||||
@@ -153,7 +153,6 @@ class BackupPage extends StatelessWidget {
|
||||
/// Issue #188
|
||||
if (isWindows) {
|
||||
await Shares.text(await File(path).readAsString());
|
||||
|
||||
} else {
|
||||
await Shares.files([path]);
|
||||
}
|
||||
@@ -195,10 +194,10 @@ class BackupPage extends StatelessWidget {
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
backup.restore();
|
||||
await backup.restore();
|
||||
Pros.reload();
|
||||
context.pop();
|
||||
RebuildNodes.app.rebuild();
|
||||
Pros.reload();
|
||||
},
|
||||
child: Text(l10n.ok),
|
||||
),
|
||||
|
||||
@@ -247,12 +247,12 @@ class _ServerPageState extends State<ServerPage>
|
||||
IconButton(
|
||||
onPressed: () => _askFor(
|
||||
func: () async {
|
||||
if (Stores.first.showSuspendTip.fetch()) {
|
||||
if (Stores.setting.showSuspendTip.fetch()) {
|
||||
await context.showRoundDialog(
|
||||
title: Text(l10n.attention),
|
||||
child: Text(l10n.suspendTip),
|
||||
);
|
||||
Stores.first.showSuspendTip.put(false);
|
||||
Stores.setting.showSuspendTip.put(false);
|
||||
}
|
||||
srv.client?.execWithPwd(
|
||||
ShellFunc.suspend.exec,
|
||||
|
||||
@@ -208,8 +208,10 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
|
||||
if (!Stores.setting.recordHistory.fetch()) {
|
||||
return [];
|
||||
}
|
||||
return Stores.history.sftpGoPath.all.where(
|
||||
(element) => element.contains(val.text),
|
||||
return List<String>.from(
|
||||
Stores.history.sftpGoPath.all.where(
|
||||
(element) => element.contains(val.text),
|
||||
),
|
||||
);
|
||||
},
|
||||
fieldViewBuilder: (_, controller, node, __) {
|
||||
|
||||
Reference in New Issue
Block a user