mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 21:03:41 +00:00
feat: add WebView support for extension (#1359)
This commit is contained in:
92 files changed
+10248
-2676
No files matched your search
@@ -2,6 +2,20 @@ import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'start_config.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class WebViewRpcConfig {
|
||||
late String network;
|
||||
late String address;
|
||||
String? token;
|
||||
|
||||
WebViewRpcConfig();
|
||||
|
||||
factory WebViewRpcConfig.fromJson(Map<String, dynamic> json) =>
|
||||
_$WebViewRpcConfigFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$WebViewRpcConfigToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class StartConfig {
|
||||
late String network;
|
||||
@@ -10,6 +24,7 @@ class StartConfig {
|
||||
late String storageDir;
|
||||
late int refreshInterval;
|
||||
late String apiToken;
|
||||
WebViewRpcConfig? webViewRpcConfig;
|
||||
|
||||
StartConfig();
|
||||
|
||||
|
||||
@@ -6,13 +6,30 @@ part of 'start_config.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
WebViewRpcConfig _$WebViewRpcConfigFromJson(Map<String, dynamic> json) =>
|
||||
WebViewRpcConfig()
|
||||
..network = json['network'] as String
|
||||
..address = json['address'] as String
|
||||
..token = json['token'] as String?;
|
||||
|
||||
Map<String, dynamic> _$WebViewRpcConfigToJson(WebViewRpcConfig instance) =>
|
||||
<String, dynamic>{
|
||||
'network': instance.network,
|
||||
'address': instance.address,
|
||||
'token': instance.token,
|
||||
};
|
||||
|
||||
StartConfig _$StartConfigFromJson(Map<String, dynamic> json) => StartConfig()
|
||||
..network = json['network'] as String
|
||||
..address = json['address'] as String
|
||||
..storage = json['storage'] as String
|
||||
..storageDir = json['storageDir'] as String
|
||||
..refreshInterval = (json['refreshInterval'] as num).toInt()
|
||||
..apiToken = json['apiToken'] as String;
|
||||
..apiToken = json['apiToken'] as String
|
||||
..webViewRpcConfig = json['webViewRpcConfig'] == null
|
||||
? null
|
||||
: WebViewRpcConfig.fromJson(
|
||||
json['webViewRpcConfig'] as Map<String, dynamic>);
|
||||
|
||||
Map<String, dynamic> _$StartConfigToJson(StartConfig instance) =>
|
||||
<String, dynamic>{
|
||||
@@ -22,4 +39,5 @@ Map<String, dynamic> _$StartConfigToJson(StartConfig instance) =>
|
||||
'storageDir': instance.storageDir,
|
||||
'refreshInterval': instance.refreshInterval,
|
||||
'apiToken': instance.apiToken,
|
||||
'webViewRpcConfig': instance.webViewRpcConfig,
|
||||
};
|
||||
Reference in new issue
Block a user