mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
io utils; single favorite folder exporting and importing
This commit is contained in:
@@ -126,7 +126,10 @@
|
|||||||
"Network Favorite Pages": "网络收藏页面",
|
"Network Favorite Pages": "网络收藏页面",
|
||||||
"Block": "屏蔽",
|
"Block": "屏蔽",
|
||||||
"Add new favorite to": "添加新收藏到",
|
"Add new favorite to": "添加新收藏到",
|
||||||
"Move favorite after reading": "阅读后移动收藏"
|
"Move favorite after reading": "阅读后移动收藏",
|
||||||
|
"Are you sure you want to delete this folder?" : "确定要删除这个收藏夹吗?",
|
||||||
|
"Import from file": "从文件导入",
|
||||||
|
"Failed to import": "导入失败"
|
||||||
},
|
},
|
||||||
"zh_TW": {
|
"zh_TW": {
|
||||||
"Home": "首頁",
|
"Home": "首頁",
|
||||||
@@ -255,6 +258,9 @@
|
|||||||
"Network Favorite Pages": "網路收藏頁面",
|
"Network Favorite Pages": "網路收藏頁面",
|
||||||
"Block": "屏蔽",
|
"Block": "屏蔽",
|
||||||
"Add new favorite to": "添加新收藏到",
|
"Add new favorite to": "添加新收藏到",
|
||||||
"Move favorite after reading": "閱讀後移動收藏"
|
"Move favorite after reading": "閱讀後移動收藏",
|
||||||
|
"Are you sure you want to delete this folder?" : "確定要刪除這個收藏夾嗎?",
|
||||||
|
"Import from file": "從文件匯入",
|
||||||
|
"Failed to import": "匯入失敗"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -567,6 +567,19 @@ class SliverGridComics extends StatefulWidget {
|
|||||||
class _SliverGridComicsState extends State<SliverGridComics> {
|
class _SliverGridComicsState extends State<SliverGridComics> {
|
||||||
List<Comic> comics = [];
|
List<Comic> comics = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didUpdateWidget(covariant SliverGridComics oldWidget) {
|
||||||
|
if (oldWidget.comics != widget.comics) {
|
||||||
|
comics.clear();
|
||||||
|
for (var comic in widget.comics) {
|
||||||
|
if (isBlocked(comic) == null) {
|
||||||
|
comics.add(comic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.didUpdateWidget(oldWidget);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
for (var comic in widget.comics) {
|
for (var comic in widget.comics) {
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:sqlite3/sqlite3.dart';
|
import 'package:sqlite3/sqlite3.dart';
|
||||||
import 'package:venera/foundation/appdata.dart';
|
import 'package:venera/foundation/appdata.dart';
|
||||||
|
import 'package:venera/foundation/log.dart';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'app.dart';
|
import 'app.dart';
|
||||||
@@ -92,7 +95,39 @@ class FavoriteItem implements Comic {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
throw UnimplementedError();
|
return {
|
||||||
|
"name": name,
|
||||||
|
"author": author,
|
||||||
|
"type": type.value,
|
||||||
|
"tags": tags,
|
||||||
|
"id": id,
|
||||||
|
"coverPath": coverPath,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static FavoriteItem fromJson(Map<String, dynamic> json) {
|
||||||
|
var type = json["type"] as int;
|
||||||
|
if(type == 0 && json['coverPath'].toString().startsWith('http')) {
|
||||||
|
type = 'picacg'.hashCode;
|
||||||
|
} else if(type == 1) {
|
||||||
|
type = 'ehentai'.hashCode;
|
||||||
|
} else if(type == 2) {
|
||||||
|
type = 'jm'.hashCode;
|
||||||
|
} else if(type == 3) {
|
||||||
|
type = 'hitomi'.hashCode;
|
||||||
|
} else if(type == 4) {
|
||||||
|
type = 'wnacg'.hashCode;
|
||||||
|
} else if(type == 6) {
|
||||||
|
type = 'nhentai'.hashCode;
|
||||||
|
}
|
||||||
|
return FavoriteItem(
|
||||||
|
id: json["id"] ?? json['target'],
|
||||||
|
name: json["name"],
|
||||||
|
author: json["author"],
|
||||||
|
coverPath: json["coverPath"],
|
||||||
|
type: ComicType(type),
|
||||||
|
tags: List<String>.from(json["tags"] ?? []),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,4 +560,39 @@ class LocalFavoritesManager {
|
|||||||
comic.type.value
|
comic.type.value
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String folderToJson(String folder) {
|
||||||
|
var res = _db.select("""
|
||||||
|
select * from "$folder";
|
||||||
|
""");
|
||||||
|
return jsonEncode({
|
||||||
|
"info": "Generated by Venera",
|
||||||
|
"name": folder,
|
||||||
|
"comics": res.map((e) => FavoriteItem.fromRow(e).toJson()).toList(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void fromJson(String json) {
|
||||||
|
var data = jsonDecode(json);
|
||||||
|
var folder = data["name"];
|
||||||
|
if(folder == null || folder is! String) {
|
||||||
|
throw "Invalid data";
|
||||||
|
}
|
||||||
|
if (folderNames.contains(folder)) {
|
||||||
|
int i = 0;
|
||||||
|
while (folderNames.contains("$folder($i)")) {
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
folder = "$folder($i)";
|
||||||
|
}
|
||||||
|
createFolder(folder);
|
||||||
|
for (var comic in data["comics"]) {
|
||||||
|
try {
|
||||||
|
addComic(folder, FavoriteItem.fromJson(comic));
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
Log.error("Import Data", e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,7 @@ class ImageDownloader {
|
|||||||
var configs = <String, dynamic>{};
|
var configs = <String, dynamic>{};
|
||||||
if (sourceKey != null) {
|
if (sourceKey != null) {
|
||||||
var comicSource = ComicSource.find(sourceKey);
|
var comicSource = ComicSource.find(sourceKey);
|
||||||
configs = comicSource!.getThumbnailLoadingConfig?.call(url) ?? {};
|
configs = comicSource?.getThumbnailLoadingConfig?.call(url) ?? {};
|
||||||
}
|
}
|
||||||
configs['headers'] ??= {};
|
configs['headers'] ??= {};
|
||||||
if(configs['headers']['user-agent'] == null
|
if(configs['headers']['user-agent'] == null
|
||||||
|
@@ -1145,7 +1145,7 @@ class _FavoritePanelState extends State<_FavoritePanel> {
|
|||||||
title: Text("Favorite".tl),
|
title: Text("Favorite".tl),
|
||||||
),
|
),
|
||||||
body: DefaultTabController(
|
body: DefaultTabController(
|
||||||
length: comicSource.favoriteData == null ? 1 : 2,
|
length: hasNetwork ? 2 : 1,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
TabBar(tabs: [
|
TabBar(tabs: [
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
import 'package:venera/components/components.dart';
|
import 'package:venera/components/components.dart';
|
||||||
@@ -11,6 +8,7 @@ import 'package:venera/foundation/comic_source/comic_source.dart';
|
|||||||
import 'package:venera/foundation/log.dart';
|
import 'package:venera/foundation/log.dart';
|
||||||
import 'package:venera/network/app_dio.dart';
|
import 'package:venera/network/app_dio.dart';
|
||||||
import 'package:venera/utils/ext.dart';
|
import 'package:venera/utils/ext.dart';
|
||||||
|
import 'package:venera/utils/io.dart';
|
||||||
import 'package:venera/utils/translations.dart';
|
import 'package:venera/utils/translations.dart';
|
||||||
|
|
||||||
class ComicSourcePage extends StatefulWidget {
|
class ComicSourcePage extends StatefulWidget {
|
||||||
@@ -328,7 +326,7 @@ class _BodyState extends State<_Body> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: selectFile, child: Text("Select file".tl))
|
onPressed: _selectFile, child: Text("Select file".tl))
|
||||||
.paddingLeft(8),
|
.paddingLeft(8),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
TextButton(
|
TextButton(
|
||||||
@@ -350,16 +348,12 @@ class _BodyState extends State<_Body> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void selectFile() async {
|
void _selectFile() async {
|
||||||
final result = await FilePicker.platform.pickFiles(
|
final file = await selectFile(ext: ["js"]);
|
||||||
type: FileType.custom,
|
|
||||||
allowedExtensions: ['js'],
|
|
||||||
);
|
|
||||||
final file = result?.files.first;
|
|
||||||
if (file == null) return;
|
if (file == null) return;
|
||||||
try {
|
try {
|
||||||
var fileName = file.name;
|
var fileName = file.name;
|
||||||
var bytes = await File(file.path!).readAsBytes();
|
var bytes = await file.readAsBytes();
|
||||||
var content = utf8.decode(bytes);
|
var content = utf8.decode(bytes);
|
||||||
await addSource(content, fileName);
|
await addSource(content, fileName);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
|
@@ -27,10 +27,26 @@ Future<void> newFolder() async {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
).paddingHorizontal(16),
|
).paddingHorizontal(16),
|
||||||
actions: [
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
child: Text("Import from file".tl),
|
||||||
|
onPressed: () async {
|
||||||
|
var file = await selectFile(ext: ['json']);
|
||||||
|
if(file == null) return;
|
||||||
|
var data = await file.readAsBytes();
|
||||||
|
try {
|
||||||
|
LocalFavoritesManager().fromJson(utf8.decode(data));
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
context.showMessage(message: "Failed to import".tl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
context.pop();
|
||||||
|
},
|
||||||
|
).paddingRight(4),
|
||||||
FilledButton(
|
FilledButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
var e = validateFolderName(controller.text);
|
var e = validateFolderName(controller.text);
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:convert';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -9,6 +10,7 @@ import 'package:venera/foundation/comic_source/comic_source.dart';
|
|||||||
import 'package:venera/foundation/comic_type.dart';
|
import 'package:venera/foundation/comic_type.dart';
|
||||||
import 'package:venera/foundation/favorites.dart';
|
import 'package:venera/foundation/favorites.dart';
|
||||||
import 'package:venera/foundation/res.dart';
|
import 'package:venera/foundation/res.dart';
|
||||||
|
import 'package:venera/utils/io.dart';
|
||||||
import 'package:venera/utils/translations.dart';
|
import 'package:venera/utils/translations.dart';
|
||||||
|
|
||||||
part 'favorite_actions.dart';
|
part 'favorite_actions.dart';
|
||||||
@@ -134,7 +136,12 @@ class _FavoritesPageState extends State<FavoritesPage> {
|
|||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
title: Text("Unselected".tl),
|
title: GestureDetector(
|
||||||
|
onTap: context.width < _kTwoPanelChangeWidth
|
||||||
|
? showFolderSelector
|
||||||
|
: null,
|
||||||
|
child: Text("Unselected".tl),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
@@ -15,8 +15,10 @@ class _LocalFavoritesPageState extends State<_LocalFavoritesPage> {
|
|||||||
late List<FavoriteItem> comics;
|
late List<FavoriteItem> comics;
|
||||||
|
|
||||||
void updateComics() {
|
void updateComics() {
|
||||||
|
print(comics.length);
|
||||||
setState(() {
|
setState(() {
|
||||||
comics = LocalFavoritesManager().getAllComics(widget.folder);
|
comics = LocalFavoritesManager().getAllComics(widget.folder);
|
||||||
|
print(comics.length);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +66,6 @@ class _LocalFavoritesPageState extends State<_LocalFavoritesPage> {
|
|||||||
favPage.setFolder(false, null);
|
favPage.setFolder(false, null);
|
||||||
LocalFavoritesManager().deleteFolder(widget.folder);
|
LocalFavoritesManager().deleteFolder(widget.folder);
|
||||||
favPage.folderList?.updateFolders();
|
favPage.folderList?.updateFolders();
|
||||||
context.pop();
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
@@ -110,6 +111,18 @@ class _LocalFavoritesPageState extends State<_LocalFavoritesPage> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
MenuEntry(
|
||||||
|
icon: Icons.upload_file,
|
||||||
|
text: "Export".tl,
|
||||||
|
onClick: () {
|
||||||
|
var json = LocalFavoritesManager().folderToJson(
|
||||||
|
widget.folder,
|
||||||
|
);
|
||||||
|
saveFile(
|
||||||
|
data: utf8.encode(json),
|
||||||
|
filename: "${widget.folder}.json",
|
||||||
|
);
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@@ -211,11 +211,13 @@ class _LeftBarState extends State<_LeftBar> implements FolderList {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void update() {
|
void update() {
|
||||||
|
if(!mounted) return;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void updateFolders() {
|
void updateFolders() {
|
||||||
|
if(!mounted) return;
|
||||||
setState(() {
|
setState(() {
|
||||||
folders = LocalFavoritesManager().folderNames;
|
folders = LocalFavoritesManager().folderNames;
|
||||||
networkFolders = ComicSource.all()
|
networkFolders = ComicSource.all()
|
||||||
|
@@ -25,8 +25,11 @@ class _AppSettingsState extends State<AppSettings> {
|
|||||||
title: "Set New Storage Path".tl,
|
title: "Set New Storage Path".tl,
|
||||||
actionTitle: "Set".tl,
|
actionTitle: "Set".tl,
|
||||||
callback: () async {
|
callback: () async {
|
||||||
var picker = FilePicker.platform;
|
if(App.isIOS) {
|
||||||
var result = await picker.getDirectoryPath();
|
context.showMessage(message: "Not supported on iOS".tl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var result = await selectDirectory();
|
||||||
if (result == null) return;
|
if (result == null) return;
|
||||||
var loadingDialog = showLoadingDialog(
|
var loadingDialog = showLoadingDialog(
|
||||||
App.rootContext,
|
App.rootContext,
|
||||||
|
@@ -1,6 +1,4 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@@ -1,12 +1,13 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_file_dialog/flutter_file_dialog.dart';
|
||||||
import 'package:venera/foundation/app.dart';
|
import 'package:venera/foundation/app.dart';
|
||||||
import 'package:venera/utils/ext.dart';
|
import 'package:venera/utils/ext.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:share_plus/share_plus.dart' as s;
|
import 'package:share_plus/share_plus.dart' as s;
|
||||||
|
import 'package:file_selector/file_selector.dart' as file_selector;
|
||||||
|
|
||||||
export 'dart:io';
|
export 'dart:io';
|
||||||
export 'dart:typed_data';
|
export 'dart:typed_data';
|
||||||
@@ -128,7 +129,7 @@ class DirectoryPicker {
|
|||||||
|
|
||||||
Future<Directory?> pickDirectory() async {
|
Future<Directory?> pickDirectory() async {
|
||||||
if (App.isWindows || App.isLinux) {
|
if (App.isWindows || App.isLinux) {
|
||||||
var d = await FilePicker.platform.getDirectoryPath();
|
var d = await file_selector.getDirectoryPath();
|
||||||
_directory = d;
|
_directory = d;
|
||||||
return d == null ? null : Directory(d);
|
return d == null ? null : Directory(d);
|
||||||
} else if (App.isAndroid) {
|
} else if (App.isAndroid) {
|
||||||
@@ -156,15 +157,46 @@ class DirectoryPicker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> saveFile(
|
Future<file_selector.XFile?> selectFile({required List<String> ext}) async {
|
||||||
{required Uint8List data, required String filename}) async {
|
file_selector.XTypeGroup typeGroup = file_selector.XTypeGroup(
|
||||||
var res = await FilePicker.platform.saveFile(
|
label: 'files',
|
||||||
bytes: data,
|
extensions: ext,
|
||||||
fileName: filename,
|
|
||||||
lockParentWindow: true,
|
|
||||||
);
|
);
|
||||||
if (App.isDesktop && res != null) {
|
final file_selector.XFile? file = await file_selector.openFile(
|
||||||
await File(res).writeAsBytes(data);
|
acceptedTypeGroups: <file_selector.XTypeGroup>[typeGroup],
|
||||||
|
);
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String?> selectDirectory() async {
|
||||||
|
var path = await file_selector.getDirectoryPath();
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> saveFile(
|
||||||
|
{Uint8List? data, required String filename, File? file}) async {
|
||||||
|
if(data == null && file == null) {
|
||||||
|
throw Exception("data and file cannot be null at the same time");
|
||||||
|
}
|
||||||
|
if(data != null) {
|
||||||
|
var cache = FilePath.join(App.cachePath, filename);
|
||||||
|
if(File(cache).existsSync()) {
|
||||||
|
File(cache).deleteSync();
|
||||||
|
}
|
||||||
|
await File(cache).writeAsBytes(data);
|
||||||
|
file = File(cache);
|
||||||
|
}
|
||||||
|
if(App.isMobile) {
|
||||||
|
final params = SaveFileDialogParams(sourceFilePath: file!.path);
|
||||||
|
await FlutterFileDialog.saveFile(params: params);
|
||||||
|
} else {
|
||||||
|
final result = await file_selector.getSaveLocation(
|
||||||
|
suggestedName: filename,
|
||||||
|
);
|
||||||
|
if (result != null) {
|
||||||
|
var xFile = file_selector.XFile(file!.path);
|
||||||
|
await xFile.saveTo(result.path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
#include <desktop_webview_window/desktop_webview_window_plugin.h>
|
#include <desktop_webview_window/desktop_webview_window_plugin.h>
|
||||||
|
#include <file_selector_linux/file_selector_plugin.h>
|
||||||
#include <flutter_qjs/flutter_qjs_plugin.h>
|
#include <flutter_qjs/flutter_qjs_plugin.h>
|
||||||
#include <gtk/gtk_plugin.h>
|
#include <gtk/gtk_plugin.h>
|
||||||
#include <screen_retriever/screen_retriever_plugin.h>
|
#include <screen_retriever/screen_retriever_plugin.h>
|
||||||
@@ -18,6 +19,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
|||||||
g_autoptr(FlPluginRegistrar) desktop_webview_window_registrar =
|
g_autoptr(FlPluginRegistrar) desktop_webview_window_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWebviewWindowPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWebviewWindowPlugin");
|
||||||
desktop_webview_window_plugin_register_with_registrar(desktop_webview_window_registrar);
|
desktop_webview_window_plugin_register_with_registrar(desktop_webview_window_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
||||||
|
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) flutter_qjs_registrar =
|
g_autoptr(FlPluginRegistrar) flutter_qjs_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterQjsPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterQjsPlugin");
|
||||||
flutter_qjs_plugin_register_with_registrar(flutter_qjs_registrar);
|
flutter_qjs_plugin_register_with_registrar(flutter_qjs_registrar);
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
desktop_webview_window
|
desktop_webview_window
|
||||||
|
file_selector_linux
|
||||||
flutter_qjs
|
flutter_qjs
|
||||||
gtk
|
gtk
|
||||||
screen_retriever
|
screen_retriever
|
||||||
|
@@ -7,6 +7,7 @@ import Foundation
|
|||||||
|
|
||||||
import app_links
|
import app_links
|
||||||
import desktop_webview_window
|
import desktop_webview_window
|
||||||
|
import file_selector_macos
|
||||||
import flutter_inappwebview_macos
|
import flutter_inappwebview_macos
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
import screen_retriever
|
import screen_retriever
|
||||||
@@ -18,6 +19,7 @@ import window_manager
|
|||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
|
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
|
||||||
DesktopWebviewWindowPlugin.register(with: registry.registrar(forPlugin: "DesktopWebviewWindowPlugin"))
|
DesktopWebviewWindowPlugin.register(with: registry.registrar(forPlugin: "DesktopWebviewWindowPlugin"))
|
||||||
|
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||||
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
|
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
|
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
|
||||||
|
88
pubspec.lock
88
pubspec.lock
@@ -162,14 +162,70 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.0"
|
version: "7.0.0"
|
||||||
file_picker:
|
file_selector:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: file_picker
|
name: file_selector
|
||||||
sha256: "167bb619cdddaa10ef2907609feb8a79c16dfa479d3afaf960f8e223f754bf12"
|
sha256: "5019692b593455127794d5718304ff1ae15447dea286cdda9f0db2a796a1b828"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "8.1.2"
|
version: "1.0.3"
|
||||||
|
file_selector_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_android
|
||||||
|
sha256: ec439df07c4999faad319ce8ad9e971795c2f1d7132ad5a793b9370a863c6128
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.5.1+10"
|
||||||
|
file_selector_ios:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_ios
|
||||||
|
sha256: "94b98ad950b8d40d96fee8fa88640c2e4bd8afcdd4817993bd04e20310f45420"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.5.3+1"
|
||||||
|
file_selector_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_linux
|
||||||
|
sha256: "712ce7fab537ba532c8febdb1a8f167b32441e74acd68c3ccb2e36dcb52c4ab2"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.9.3"
|
||||||
|
file_selector_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_macos
|
||||||
|
sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.9.4+2"
|
||||||
|
file_selector_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_platform_interface
|
||||||
|
sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.6.2"
|
||||||
|
file_selector_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_web
|
||||||
|
sha256: c4c0ea4224d97a60a7067eca0c8fd419e708ff830e0c83b11a48faf566cec3e7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.9.4+2"
|
||||||
|
file_selector_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file_selector_windows
|
||||||
|
sha256: "8f5d2f6590d51ecd9179ba39c64f722edc15226cc93dcc8698466ad36a4a85a4"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.9.3+3"
|
||||||
fixnum:
|
fixnum:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -183,6 +239,14 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_file_dialog:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_file_dialog
|
||||||
|
sha256: "9344b8f07be6a1b6f9854b723fb0cf84a8094ba94761af1d213589d3cb087488"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.2"
|
||||||
flutter_inappwebview:
|
flutter_inappwebview:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -260,14 +324,6 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
flutter_plugin_android_lifecycle:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: flutter_plugin_android_lifecycle
|
|
||||||
sha256: "9ee02950848f61c4129af3d6ec84a1cfc0e47931abc746b03e7a3bc3e8ff6eda"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "2.0.22"
|
|
||||||
flutter_qjs:
|
flutter_qjs:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -328,6 +384,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.15.4"
|
version: "0.15.4"
|
||||||
|
http:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http
|
||||||
|
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.2"
|
||||||
http_parser:
|
http_parser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@@ -26,7 +26,6 @@ dependencies:
|
|||||||
dio: any
|
dio: any
|
||||||
html: any
|
html: any
|
||||||
pointycastle: any
|
pointycastle: any
|
||||||
file_picker: ^8.1.2
|
|
||||||
url_launcher: ^6.3.0
|
url_launcher: ^6.3.0
|
||||||
path: ^1.9.0
|
path: ^1.9.0
|
||||||
photo_view:
|
photo_view:
|
||||||
@@ -50,6 +49,8 @@ dependencies:
|
|||||||
flutter_inappwebview: ^6.1.5
|
flutter_inappwebview: ^6.1.5
|
||||||
app_links: ^6.3.2
|
app_links: ^6.3.2
|
||||||
sliver_tools: ^0.2.12
|
sliver_tools: ^0.2.12
|
||||||
|
flutter_file_dialog: ^3.0.2
|
||||||
|
file_selector: ^1.0.3
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <app_links/app_links_plugin_c_api.h>
|
#include <app_links/app_links_plugin_c_api.h>
|
||||||
#include <desktop_webview_window/desktop_webview_window_plugin.h>
|
#include <desktop_webview_window/desktop_webview_window_plugin.h>
|
||||||
|
#include <file_selector_windows/file_selector_windows.h>
|
||||||
#include <flutter_inappwebview_windows/flutter_inappwebview_windows_plugin_c_api.h>
|
#include <flutter_inappwebview_windows/flutter_inappwebview_windows_plugin_c_api.h>
|
||||||
#include <flutter_qjs/flutter_qjs_plugin.h>
|
#include <flutter_qjs/flutter_qjs_plugin.h>
|
||||||
#include <screen_retriever/screen_retriever_plugin.h>
|
#include <screen_retriever/screen_retriever_plugin.h>
|
||||||
@@ -21,6 +22,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
|||||||
registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
|
registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
|
||||||
DesktopWebviewWindowPluginRegisterWithRegistrar(
|
DesktopWebviewWindowPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("DesktopWebviewWindowPlugin"));
|
registry->GetRegistrarForPlugin("DesktopWebviewWindowPlugin"));
|
||||||
|
FileSelectorWindowsRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
||||||
FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar(
|
FlutterInappwebviewWindowsPluginCApiRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi"));
|
registry->GetRegistrarForPlugin("FlutterInappwebviewWindowsPluginCApi"));
|
||||||
FlutterQjsPluginRegisterWithRegistrar(
|
FlutterQjsPluginRegisterWithRegistrar(
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
app_links
|
app_links
|
||||||
desktop_webview_window
|
desktop_webview_window
|
||||||
|
file_selector_windows
|
||||||
flutter_inappwebview_windows
|
flutter_inappwebview_windows
|
||||||
flutter_qjs
|
flutter_qjs
|
||||||
screen_retriever
|
screen_retriever
|
||||||
|
Reference in New Issue
Block a user