From 6c0b6dc62b3f1d5a4303149b312d284e4a0349e4 Mon Sep 17 00:00:00 2001 From: wanghongenpin Date: Tue, 15 Oct 2024 02:31:47 +0800 Subject: [PATCH] v1.1.4-Beta --- lib/ui/component/multi_window.dart | 1 - lib/ui/component/qr_code_page.dart | 14 +++++++++----- lib/ui/component/qrcode/qr_scan_view.dart | 1 + linux/build.sh | 1 - 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/ui/component/multi_window.dart b/lib/ui/component/multi_window.dart index fb196ed..aab8086 100644 --- a/lib/ui/component/multi_window.dart +++ b/lib/ui/component/multi_window.dart @@ -203,7 +203,6 @@ void registerMethodHandler() { if (call.method == 'saveFile') { String? path = (await FilePicker.platform.saveFile(fileName: call.arguments)); - if (Platform.isWindows) windowManager.blur(); return path; } diff --git a/lib/ui/component/qr_code_page.dart b/lib/ui/component/qr_code_page.dart index db9329b..31c6705 100644 --- a/lib/ui/component/qr_code_page.dart +++ b/lib/ui/component/qr_code_page.dart @@ -18,6 +18,7 @@ import 'dart:async'; import 'dart:io'; import 'package:desktop_multi_window/desktop_multi_window.dart'; +import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; @@ -151,9 +152,11 @@ class _QrDecodeState extends State<_QrDecode> with AutomaticKeepAliveClientMixin }, icon: const Icon(Icons.photo, size: 18), style: ButtonStyle( + padding: WidgetStateProperty.all(EdgeInsets.symmetric(horizontal: 15, vertical: 8)), shape: WidgetStateProperty.all( RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)))), label: Text(localizations.selectImage)), + const SizedBox(width: 10), if (Platforms.isMobile()) FilledButton.icon( onPressed: () async { @@ -167,11 +170,12 @@ class _QrDecodeState extends State<_QrDecode> with AutomaticKeepAliveClientMixin decodeData.text = scanRes; }, style: ButtonStyle( + padding: WidgetStateProperty.all(EdgeInsets.symmetric(horizontal: 15, vertical: 8)), shape: WidgetStateProperty.all( RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)))), icon: const Icon(Icons.qr_code_scanner_outlined, size: 18), label: Text(localizations.scanQrCode, style: TextStyle(fontSize: 14))), - const SizedBox(width: 20), + const SizedBox(width: 10), ], ), const SizedBox(height: 20), @@ -275,7 +279,7 @@ class _QrEncodeState extends State<_QrEncode> with AutomaticKeepAliveClientMixin }); }), ]), - const SizedBox(width: 20), + const SizedBox(width: 15), FilledButton.icon( onPressed: () { setState(() { @@ -283,11 +287,12 @@ class _QrEncodeState extends State<_QrEncode> with AutomaticKeepAliveClientMixin }); }, style: ButtonStyle( + padding: WidgetStateProperty.all(EdgeInsets.symmetric(horizontal: 15, vertical: 8)), shape: WidgetStateProperty.all( RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)))), icon: const Icon(Icons.qr_code, size: 18), label: Text(localizations.generateQrCode, style: TextStyle(fontSize: 14))), - const SizedBox(width: 20), + const SizedBox(width: 10), ], ), const SizedBox(height: 10), @@ -327,8 +332,7 @@ class _QrEncodeState extends State<_QrEncode> with AutomaticKeepAliveClientMixin } if (Platforms.isDesktop()) { - String? path = await DesktopMultiWindow.invokeMethod(0, 'saveFile', "qrcode.png"); - if (widget.windowId != null) WindowController.fromWindowId(widget.windowId!).show(); + String? path = (await FilePicker.platform.saveFile(fileName: "qrcode.png")); if (path == null) return; var imageBytes = await toImageBytes(); diff --git a/lib/ui/component/qrcode/qr_scan_view.dart b/lib/ui/component/qrcode/qr_scan_view.dart index a38c04a..5a10a07 100644 --- a/lib/ui/component/qrcode/qr_scan_view.dart +++ b/lib/ui/component/qrcode/qr_scan_view.dart @@ -163,6 +163,7 @@ class _QrReaderViewState extends State with TickerProviderStateM child: QrReaderView( width: constraints.maxWidth, height: constraints.maxHeight, + autoFocusIntervalInMs: 1000, callback: _onCreateController, )), Positioned( diff --git a/linux/build.sh b/linux/build.sh index 72ca7dd..be3b13c 100644 --- a/linux/build.sh +++ b/linux/build.sh @@ -1,6 +1,5 @@ #!/bin/bash - pwd cd ../build/linux/x64/release rm -rf package