upgrade deps
This commit is contained in:
+1
-1
@@ -1678,7 +1678,7 @@ class _ExportExpansion extends ConsumerWidget {
|
||||
fileName,
|
||||
) async {
|
||||
await FilePicker.saveFile(
|
||||
fileName: fileName,
|
||||
fileName: fileName ?? 'page',
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['md'],
|
||||
bytes: utf8.encode(content),
|
||||
|
||||
+1
-1
@@ -599,7 +599,7 @@ class TabMenu extends HookConsumerWidget {
|
||||
icon: const Icon(MdiIcons.languageMarkdown),
|
||||
shareMarkdownAction: (content, fileName) async {
|
||||
await FilePicker.saveFile(
|
||||
fileName: fileName,
|
||||
fileName: fileName ?? 'page',
|
||||
type: FileType.custom,
|
||||
allowedExtensions: ['md'],
|
||||
bytes: utf8.encode(content),
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter_singbox_proxy/flutter_singbox_proxy.dart';
|
||||
@@ -160,15 +159,8 @@ class ProxyInputConsumer extends _$ProxyInputConsumer {
|
||||
}
|
||||
|
||||
Future<String> _readFileText(PlatformFile file) async {
|
||||
final bytes = file.bytes;
|
||||
if (bytes != null) {
|
||||
return utf8.decode(bytes, allowMalformed: true);
|
||||
}
|
||||
final path = file.path;
|
||||
if (path == null) {
|
||||
throw const FormatException('Unable to read file contents.');
|
||||
}
|
||||
return File(path).readAsString();
|
||||
final bytes = await file.readAsBytes();
|
||||
return utf8.decode(bytes, allowMalformed: true);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -301,8 +301,7 @@ Future<AddProxyAction?> _consumeFile(
|
||||
WidgetRef ref,
|
||||
ProxyFileImportKind kind,
|
||||
) async {
|
||||
final result = await FilePicker.pickFiles(withData: true);
|
||||
final picked = result?.files.singleOrNull;
|
||||
final picked = await FilePicker.pickFile();
|
||||
if (picked == null) return null;
|
||||
|
||||
final outcome = await ref
|
||||
|
||||
Reference in New Issue
Block a user