Support override script

Support proxies search

Add some scenes auto close connections

Update core

Optimize more details
This commit is contained in:
chen08209
2025-05-02 02:24:12 +08:00
parent 76c9f08d4a
commit a98f4c345b
161 changed files with 7935 additions and 5017 deletions

View File

@@ -14,6 +14,7 @@ typedef DelayMap = Map<String, Map<String, int?>>;
class AppState with _$AppState {
const factory AppState({
@Default(false) bool isInit,
@Default(false) bool backBlock,
@Default(PageLabel.dashboard) PageLabel pageLabel,
@Default([]) List<Package> packages,
@Default(0) int sortNum,
@@ -30,7 +31,7 @@ class AppState with _$AppState {
required FixedList<Log> logs,
required FixedList<Traffic> traffics,
required Traffic totalTraffic,
@Default(false) bool needApply,
@Default("") String proxiesQuery,
}) = _AppState;
}

View File

@@ -1,12 +1,10 @@
// ignore_for_file: invalid_annotation_target
import 'package:fl_clash/common/common.dart';
import 'package:fl_clash/enum/enum.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import '../enum/enum.dart';
part 'generated/clash_config.freezed.dart';
part 'generated/clash_config.g.dart';
typedef HostsMap = Map<String, String>;
@@ -142,6 +140,41 @@ class RuleProvider with _$RuleProvider {
_$RuleProviderFromJson(json);
}
@freezed
class Sniffer with _$Sniffer {
const factory Sniffer({
@Default(false) bool enable,
@Default(true) @JsonKey(name: "override-destination") bool overrideDest,
@Default([]) List<String> sniffing,
@Default([]) @JsonKey(name: "force-domain") List<String> forceDomain,
@Default([]) @JsonKey(name: "skip-src-address") List<String> skipSrcAddress,
@Default([]) @JsonKey(name: "skip-dst-address") List<String> skipDstAddress,
@Default([]) @JsonKey(name: "skip-domain") List<String> skipDomain,
@Default([]) @JsonKey(name: "port-whitelist") List<String> port,
@Default(true) @JsonKey(name: "force-dns-mapping") bool forceDnsMapping,
@Default(true) @JsonKey(name: "parse-pure-ip") bool parsePureIp,
@Default({}) Map<String, SnifferConfig> sniff,
}) = _Sniffer;
factory Sniffer.fromJson(Map<String, Object?> json) =>
_$SnifferFromJson(json);
}
List<String> _formJsonPorts(List? ports) {
return ports?.map((item) => item.toString()).toList() ?? [];
}
@freezed
class SnifferConfig with _$SnifferConfig {
const factory SnifferConfig({
@Default([]) @JsonKey(fromJson: _formJsonPorts) List<String> ports,
@JsonKey(name: "override-destination") bool? overrideDest,
}) = _SnifferConfig;
factory SnifferConfig.fromJson(Map<String, Object?> json) =>
_$SnifferConfigFromJson(json);
}
@freezed
class Tun with _$Tun {
const factory Tun({
@@ -408,7 +441,7 @@ List<SubRule> _genSubRules(Map<String, dynamic> json) {
class ClashConfigSnippet with _$ClashConfigSnippet {
const factory ClashConfigSnippet({
@Default([]) @JsonKey(name: "proxy-groups") List<ProxyGroup> proxyGroups,
@JsonKey(fromJson: _genRule) @Default([]) List<Rule> rule,
@JsonKey(fromJson: _genRule, name: "rules") @Default([]) List<Rule> rule,
@JsonKey(name: "rule-providers", fromJson: _genRuleProviders)
@Default([])
List<RuleProvider> ruleProvider,
@@ -425,6 +458,10 @@ class ClashConfigSnippet with _$ClashConfigSnippet {
class ClashConfig with _$ClashConfig {
const factory ClashConfig({
@Default(defaultMixedPort) @JsonKey(name: "mixed-port") int mixedPort,
@Default(0) @JsonKey(name: "socks-port") int socksPort,
@Default(0) @JsonKey(name: "port") int port,
@Default(0) @JsonKey(name: "redir-port") int redirPort,
@Default(0) @JsonKey(name: "tproxy-port") int tproxyPort,
@Default(Mode.rule) Mode mode,
@Default(false) @JsonKey(name: "allow-lan") bool allowLan,
@Default(LogLevel.error) @JsonKey(name: "log-level") LogLevel logLevel,

View File

@@ -8,7 +8,6 @@ import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'generated/common.freezed.dart';
part 'generated/common.g.dart';
@freezed
@@ -17,7 +16,7 @@ class NavigationItem with _$NavigationItem {
required Icon icon,
required PageLabel label,
final String? description,
required Widget fragment,
required Widget view,
@Default(true) bool keep,
String? path,
@Default([NavigationItemMode.mobile, NavigationItemMode.desktop])
@@ -129,10 +128,10 @@ extension LogsStateExt on LogsState {
final lowQuery = query.toLowerCase();
return logs.where(
(log) {
final payload = log.payload.toLowerCase();
final logLevelName = log.logLevel.name;
return {logLevelName}.containsAll(keywords) &&
((payload.contains(lowQuery)) || logLevelName.contains(lowQuery));
((log.payload.toLowerCase().contains(lowQuery)) ||
logLevelName.contains(lowQuery));
},
).toList();
}
@@ -504,15 +503,11 @@ class PopupMenuItemData {
this.icon,
required this.label,
required this.onPressed,
this.type,
this.iconSize,
});
final double? iconSize;
final String label;
final VoidCallback? onPressed;
final IconData? icon;
final PopupMenuItemType? type;
}
@freezed
@@ -528,3 +523,56 @@ class TextPainterParams with _$TextPainterParams {
factory TextPainterParams.fromJson(Map<String, Object?> json) =>
_$TextPainterParamsFromJson(json);
}
class CloseWindowIntent extends Intent {
const CloseWindowIntent();
}
@freezed
class Result<T> with _$Result<T> {
const factory Result({
required T? data,
required ResultType type,
required String message,
}) = _Result;
factory Result.success(T data) => Result(
data: data,
type: ResultType.success,
message: "",
);
factory Result.error(String message) => Result(
data: null,
type: ResultType.error,
message: message,
);
}
extension ResultExt on Result {
bool get isError => type == ResultType.error;
bool get isSuccess => type == ResultType.success;
}
@freezed
class Script with _$Script {
const factory Script({
required String id,
required String label,
required String content,
}) = _Script;
factory Script.create({
required String label,
required String content,
}) {
return Script(
id: utils.uuidV4,
label: label,
content: content,
);
}
factory Script.fromJson(Map<String, Object?> json) => _$ScriptFromJson(json);
}

View File

@@ -8,7 +8,6 @@ import 'package:freezed_annotation/freezed_annotation.dart';
import 'models.dart';
part 'generated/config.freezed.dart';
part 'generated/config.g.dart';
const defaultBypassDomain = [
@@ -212,6 +211,35 @@ class ThemeProps with _$ThemeProps {
}
}
@freezed
class ScriptProps with _$ScriptProps {
const factory ScriptProps({
String? currentId,
@Default([]) List<Script> scripts,
}) = _ScriptProps;
factory ScriptProps.fromJson(Map<String, Object?> json) =>
_$ScriptPropsFromJson(json);
}
extension ScriptPropsExt on ScriptProps {
String? get realId {
final index = scripts.indexWhere((script) => script.id == currentId);
if (index != -1) {
return currentId;
}
return null;
}
Script? get currentScript {
final index = scripts.indexWhere((script) => script.id == currentId);
if (index != -1) {
return scripts[index];
}
return null;
}
}
@freezed
class Config with _$Config {
const factory Config({
@@ -229,6 +257,7 @@ class Config with _$Config {
@Default(defaultProxiesStyle) ProxiesStyle proxiesStyle,
@Default(defaultWindowProps) WindowProps windowProps,
@Default(defaultClashConfig) ClashConfig patchClashConfig,
@Default(ScriptProps()) ScriptProps scriptProps,
}) = _Config;
factory Config.fromJson(Map<String, Object?> json) => _$ConfigFromJson(json);

View File

@@ -5,7 +5,6 @@ import 'package:fl_clash/models/models.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'generated/core.freezed.dart';
part 'generated/core.g.dart';
abstract mixin class AppMessageListener {
@@ -18,10 +17,52 @@ abstract mixin class AppMessageListener {
void onLoaded(String providerName) {}
}
abstract mixin class ServiceMessageListener {
onProtect(Fd fd) {}
// abstract mixin class ServiceMessageListener {
// onProtect(Fd fd) {}
//
// onProcess(ProcessData process) {}
// }
onProcess(ProcessData process) {}
@freezed
class SetupParams with _$SetupParams {
const factory SetupParams({
@JsonKey(name: "config") required Map<String, dynamic> config,
@JsonKey(name: "selected-map") required Map<String, String> selectedMap,
@JsonKey(name: "test-url") required String testUrl,
}) = _SetupParams;
factory SetupParams.fromJson(Map<String, dynamic> json) =>
_$SetupParamsFromJson(json);
}
// extension SetupParamsExt on SetupParams {
// Map<String, dynamic> get json {
// final json = Map<String, dynamic>.from(config);
// json["selected-map"] = selectedMap;
// json["test-url"] = testUrl;
// return json;
// }
// }
@freezed
class UpdateParams with _$UpdateParams {
const factory UpdateParams({
required Tun tun,
@JsonKey(name: 'mixed-port') required int mixedPort,
@JsonKey(name: 'allow-lan') required bool allowLan,
@JsonKey(name: 'find-process-mode')
required FindProcessMode findProcessMode,
required Mode mode,
@JsonKey(name: 'log-level') required LogLevel logLevel,
required bool ipv6,
@JsonKey(name: 'tcp-concurrent') required bool tcpConcurrent,
@JsonKey(name: 'external-controller')
required ExternalControllerStatus externalController,
@JsonKey(name: 'unified-delay') required bool unifiedDelay,
}) = _UpdateParams;
factory UpdateParams.fromJson(Map<String, dynamic> json) =>
_$UpdateParamsFromJson(json);
}
@freezed
@@ -56,32 +97,6 @@ class AndroidVpnOptions with _$AndroidVpnOptions {
_$AndroidVpnOptionsFromJson(json);
}
@freezed
class ConfigExtendedParams with _$ConfigExtendedParams {
const factory ConfigExtendedParams({
@JsonKey(name: "is-patch") required bool isPatch,
@JsonKey(name: "selected-map") required SelectedMap selectedMap,
@JsonKey(name: "override-dns") required bool overrideDns,
@JsonKey(name: "override-rule") required bool overrideRule,
@JsonKey(name: "test-url") required String testUrl,
}) = _ConfigExtendedParams;
factory ConfigExtendedParams.fromJson(Map<String, Object?> json) =>
_$ConfigExtendedParamsFromJson(json);
}
@freezed
class UpdateConfigParams with _$UpdateConfigParams {
const factory UpdateConfigParams({
@JsonKey(name: "profile-id") required String profileId,
required ClashConfig config,
required ConfigExtendedParams params,
}) = _UpdateConfigParams;
factory UpdateConfigParams.fromJson(Map<String, Object?> json) =>
_$UpdateConfigParamsFromJson(json);
}
@freezed
class InitParams with _$InitParams {
const factory InitParams({
@@ -158,37 +173,26 @@ class Now with _$Now {
factory Now.fromJson(Map<String, Object?> json) => _$NowFromJson(json);
}
@freezed
class ProcessData with _$ProcessData {
const factory ProcessData({
required String id,
required Metadata metadata,
}) = _ProcessData;
factory ProcessData.fromJson(Map<String, Object?> json) =>
_$ProcessDataFromJson(json);
}
@freezed
class Fd with _$Fd {
const factory Fd({
required String id,
required int value,
}) = _Fd;
factory Fd.fromJson(Map<String, Object?> json) => _$FdFromJson(json);
}
@freezed
class ProcessMapItem with _$ProcessMapItem {
const factory ProcessMapItem({
required String id,
required String value,
}) = _ProcessMapItem;
factory ProcessMapItem.fromJson(Map<String, Object?> json) =>
_$ProcessMapItemFromJson(json);
}
// @freezed
// class ProcessData with _$ProcessData {
// const factory ProcessData({
// required String id,
// required Metadata metadata,
// }) = _ProcessData;
//
// factory ProcessData.fromJson(Map<String, Object?> json) =>
// _$ProcessDataFromJson(json);
// }
//
// @freezed
// class Fd with _$Fd {
// const factory Fd({
// required String id,
// required int value,
// }) = _Fd;
//
// factory Fd.fromJson(Map<String, Object?> json) => _$FdFromJson(json);
// }
@freezed
class ProviderSubscriptionInfo with _$ProviderSubscriptionInfo {
@@ -231,28 +235,11 @@ class ExternalProvider with _$ExternalProvider {
_$ExternalProviderFromJson(json);
}
@freezed
class TunProps with _$TunProps {
const factory TunProps({
required int fd,
required String gateway,
required String gateway6,
required String portal,
required String portal6,
required String dns,
required String dns6,
}) = _TunProps;
factory TunProps.fromJson(Map<String, Object?> json) =>
_$TunPropsFromJson(json);
}
@freezed
class Action with _$Action {
const factory Action({
required ActionMethod method,
required dynamic data,
@JsonKey(name: "default-value") required dynamic defaultValue,
required String id,
}) = _Action;
@@ -265,8 +252,19 @@ class ActionResult with _$ActionResult {
required ActionMethod method,
required dynamic data,
String? id,
@Default(ResultType.success) ResultType code,
}) = _ActionResult;
factory ActionResult.fromJson(Map<String, Object?> json) =>
_$ActionResultFromJson(json);
}
extension ActionResultExt on ActionResult {
Result get toResult {
if (code == ResultType.success) {
return Result.success(data);
} else {
return Result.error(data);
}
}
}

View File

@@ -17,6 +17,7 @@ final _privateConstructorUsedError = UnsupportedError(
/// @nodoc
mixin _$AppState {
bool get isInit => throw _privateConstructorUsedError;
bool get backBlock => throw _privateConstructorUsedError;
PageLabel get pageLabel => throw _privateConstructorUsedError;
List<Package> get packages => throw _privateConstructorUsedError;
int get sortNum => throw _privateConstructorUsedError;
@@ -34,7 +35,7 @@ mixin _$AppState {
FixedList<Log> get logs => throw _privateConstructorUsedError;
FixedList<Traffic> get traffics => throw _privateConstructorUsedError;
Traffic get totalTraffic => throw _privateConstructorUsedError;
bool get needApply => throw _privateConstructorUsedError;
String get proxiesQuery => throw _privateConstructorUsedError;
/// Create a copy of AppState
/// with the given fields replaced by the non-null parameter values.
@@ -50,6 +51,7 @@ abstract class $AppStateCopyWith<$Res> {
@useResult
$Res call(
{bool isInit,
bool backBlock,
PageLabel pageLabel,
List<Package> packages,
int sortNum,
@@ -66,7 +68,7 @@ abstract class $AppStateCopyWith<$Res> {
FixedList<Log> logs,
FixedList<Traffic> traffics,
Traffic totalTraffic,
bool needApply});
String proxiesQuery});
}
/// @nodoc
@@ -85,6 +87,7 @@ class _$AppStateCopyWithImpl<$Res, $Val extends AppState>
@override
$Res call({
Object? isInit = null,
Object? backBlock = null,
Object? pageLabel = null,
Object? packages = null,
Object? sortNum = null,
@@ -101,13 +104,17 @@ class _$AppStateCopyWithImpl<$Res, $Val extends AppState>
Object? logs = null,
Object? traffics = null,
Object? totalTraffic = null,
Object? needApply = null,
Object? proxiesQuery = null,
}) {
return _then(_value.copyWith(
isInit: null == isInit
? _value.isInit
: isInit // ignore: cast_nullable_to_non_nullable
as bool,
backBlock: null == backBlock
? _value.backBlock
: backBlock // ignore: cast_nullable_to_non_nullable
as bool,
pageLabel: null == pageLabel
? _value.pageLabel
: pageLabel // ignore: cast_nullable_to_non_nullable
@@ -172,10 +179,10 @@ class _$AppStateCopyWithImpl<$Res, $Val extends AppState>
? _value.totalTraffic
: totalTraffic // ignore: cast_nullable_to_non_nullable
as Traffic,
needApply: null == needApply
? _value.needApply
: needApply // ignore: cast_nullable_to_non_nullable
as bool,
proxiesQuery: null == proxiesQuery
? _value.proxiesQuery
: proxiesQuery // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
@@ -190,6 +197,7 @@ abstract class _$$AppStateImplCopyWith<$Res>
@useResult
$Res call(
{bool isInit,
bool backBlock,
PageLabel pageLabel,
List<Package> packages,
int sortNum,
@@ -206,7 +214,7 @@ abstract class _$$AppStateImplCopyWith<$Res>
FixedList<Log> logs,
FixedList<Traffic> traffics,
Traffic totalTraffic,
bool needApply});
String proxiesQuery});
}
/// @nodoc
@@ -223,6 +231,7 @@ class __$$AppStateImplCopyWithImpl<$Res>
@override
$Res call({
Object? isInit = null,
Object? backBlock = null,
Object? pageLabel = null,
Object? packages = null,
Object? sortNum = null,
@@ -239,13 +248,17 @@ class __$$AppStateImplCopyWithImpl<$Res>
Object? logs = null,
Object? traffics = null,
Object? totalTraffic = null,
Object? needApply = null,
Object? proxiesQuery = null,
}) {
return _then(_$AppStateImpl(
isInit: null == isInit
? _value.isInit
: isInit // ignore: cast_nullable_to_non_nullable
as bool,
backBlock: null == backBlock
? _value.backBlock
: backBlock // ignore: cast_nullable_to_non_nullable
as bool,
pageLabel: null == pageLabel
? _value.pageLabel
: pageLabel // ignore: cast_nullable_to_non_nullable
@@ -310,10 +323,10 @@ class __$$AppStateImplCopyWithImpl<$Res>
? _value.totalTraffic
: totalTraffic // ignore: cast_nullable_to_non_nullable
as Traffic,
needApply: null == needApply
? _value.needApply
: needApply // ignore: cast_nullable_to_non_nullable
as bool,
proxiesQuery: null == proxiesQuery
? _value.proxiesQuery
: proxiesQuery // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -323,6 +336,7 @@ class __$$AppStateImplCopyWithImpl<$Res>
class _$AppStateImpl implements _AppState {
const _$AppStateImpl(
{this.isInit = false,
this.backBlock = false,
this.pageLabel = PageLabel.dashboard,
final List<Package> packages = const [],
this.sortNum = 0,
@@ -339,7 +353,7 @@ class _$AppStateImpl implements _AppState {
required this.logs,
required this.traffics,
required this.totalTraffic,
this.needApply = false})
this.proxiesQuery = ""})
: _packages = packages,
_delayMap = delayMap,
_groups = groups,
@@ -350,6 +364,9 @@ class _$AppStateImpl implements _AppState {
final bool isInit;
@override
@JsonKey()
final bool backBlock;
@override
@JsonKey()
final PageLabel pageLabel;
final List<Package> _packages;
@override
@@ -413,11 +430,11 @@ class _$AppStateImpl implements _AppState {
final Traffic totalTraffic;
@override
@JsonKey()
final bool needApply;
final String proxiesQuery;
@override
String toString() {
return 'AppState(isInit: $isInit, pageLabel: $pageLabel, packages: $packages, sortNum: $sortNum, viewSize: $viewSize, delayMap: $delayMap, groups: $groups, checkIpNum: $checkIpNum, brightness: $brightness, runTime: $runTime, providers: $providers, localIp: $localIp, requests: $requests, version: $version, logs: $logs, traffics: $traffics, totalTraffic: $totalTraffic, needApply: $needApply)';
return 'AppState(isInit: $isInit, backBlock: $backBlock, pageLabel: $pageLabel, packages: $packages, sortNum: $sortNum, viewSize: $viewSize, delayMap: $delayMap, groups: $groups, checkIpNum: $checkIpNum, brightness: $brightness, runTime: $runTime, providers: $providers, localIp: $localIp, requests: $requests, version: $version, logs: $logs, traffics: $traffics, totalTraffic: $totalTraffic, proxiesQuery: $proxiesQuery)';
}
@override
@@ -426,6 +443,8 @@ class _$AppStateImpl implements _AppState {
(other.runtimeType == runtimeType &&
other is _$AppStateImpl &&
(identical(other.isInit, isInit) || other.isInit == isInit) &&
(identical(other.backBlock, backBlock) ||
other.backBlock == backBlock) &&
(identical(other.pageLabel, pageLabel) ||
other.pageLabel == pageLabel) &&
const DeepCollectionEquality().equals(other._packages, _packages) &&
@@ -450,31 +469,33 @@ class _$AppStateImpl implements _AppState {
other.traffics == traffics) &&
(identical(other.totalTraffic, totalTraffic) ||
other.totalTraffic == totalTraffic) &&
(identical(other.needApply, needApply) ||
other.needApply == needApply));
(identical(other.proxiesQuery, proxiesQuery) ||
other.proxiesQuery == proxiesQuery));
}
@override
int get hashCode => Object.hash(
runtimeType,
isInit,
pageLabel,
const DeepCollectionEquality().hash(_packages),
sortNum,
viewSize,
const DeepCollectionEquality().hash(_delayMap),
const DeepCollectionEquality().hash(_groups),
checkIpNum,
brightness,
runTime,
const DeepCollectionEquality().hash(_providers),
localIp,
requests,
version,
logs,
traffics,
totalTraffic,
needApply);
int get hashCode => Object.hashAll([
runtimeType,
isInit,
backBlock,
pageLabel,
const DeepCollectionEquality().hash(_packages),
sortNum,
viewSize,
const DeepCollectionEquality().hash(_delayMap),
const DeepCollectionEquality().hash(_groups),
checkIpNum,
brightness,
runTime,
const DeepCollectionEquality().hash(_providers),
localIp,
requests,
version,
logs,
traffics,
totalTraffic,
proxiesQuery
]);
/// Create a copy of AppState
/// with the given fields replaced by the non-null parameter values.
@@ -488,6 +509,7 @@ class _$AppStateImpl implements _AppState {
abstract class _AppState implements AppState {
const factory _AppState(
{final bool isInit,
final bool backBlock,
final PageLabel pageLabel,
final List<Package> packages,
final int sortNum,
@@ -504,11 +526,13 @@ abstract class _AppState implements AppState {
required final FixedList<Log> logs,
required final FixedList<Traffic> traffics,
required final Traffic totalTraffic,
final bool needApply}) = _$AppStateImpl;
final String proxiesQuery}) = _$AppStateImpl;
@override
bool get isInit;
@override
bool get backBlock;
@override
PageLabel get pageLabel;
@override
List<Package> get packages;
@@ -541,7 +565,7 @@ abstract class _AppState implements AppState {
@override
Traffic get totalTraffic;
@override
bool get needApply;
String get proxiesQuery;
/// Create a copy of AppState
/// with the given fields replaced by the non-null parameter values.

View File

@@ -652,6 +652,640 @@ abstract class _RuleProvider implements RuleProvider {
throw _privateConstructorUsedError;
}
Sniffer _$SnifferFromJson(Map<String, dynamic> json) {
return _Sniffer.fromJson(json);
}
/// @nodoc
mixin _$Sniffer {
bool get enable => throw _privateConstructorUsedError;
@JsonKey(name: "override-destination")
bool get overrideDest => throw _privateConstructorUsedError;
List<String> get sniffing => throw _privateConstructorUsedError;
@JsonKey(name: "force-domain")
List<String> get forceDomain => throw _privateConstructorUsedError;
@JsonKey(name: "skip-src-address")
List<String> get skipSrcAddress => throw _privateConstructorUsedError;
@JsonKey(name: "skip-dst-address")
List<String> get skipDstAddress => throw _privateConstructorUsedError;
@JsonKey(name: "skip-domain")
List<String> get skipDomain => throw _privateConstructorUsedError;
@JsonKey(name: "port-whitelist")
List<String> get port => throw _privateConstructorUsedError;
@JsonKey(name: "force-dns-mapping")
bool get forceDnsMapping => throw _privateConstructorUsedError;
@JsonKey(name: "parse-pure-ip")
bool get parsePureIp => throw _privateConstructorUsedError;
Map<String, SnifferConfig> get sniff => throw _privateConstructorUsedError;
/// Serializes this Sniffer to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of Sniffer
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$SnifferCopyWith<Sniffer> get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $SnifferCopyWith<$Res> {
factory $SnifferCopyWith(Sniffer value, $Res Function(Sniffer) then) =
_$SnifferCopyWithImpl<$Res, Sniffer>;
@useResult
$Res call(
{bool enable,
@JsonKey(name: "override-destination") bool overrideDest,
List<String> sniffing,
@JsonKey(name: "force-domain") List<String> forceDomain,
@JsonKey(name: "skip-src-address") List<String> skipSrcAddress,
@JsonKey(name: "skip-dst-address") List<String> skipDstAddress,
@JsonKey(name: "skip-domain") List<String> skipDomain,
@JsonKey(name: "port-whitelist") List<String> port,
@JsonKey(name: "force-dns-mapping") bool forceDnsMapping,
@JsonKey(name: "parse-pure-ip") bool parsePureIp,
Map<String, SnifferConfig> sniff});
}
/// @nodoc
class _$SnifferCopyWithImpl<$Res, $Val extends Sniffer>
implements $SnifferCopyWith<$Res> {
_$SnifferCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Sniffer
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? enable = null,
Object? overrideDest = null,
Object? sniffing = null,
Object? forceDomain = null,
Object? skipSrcAddress = null,
Object? skipDstAddress = null,
Object? skipDomain = null,
Object? port = null,
Object? forceDnsMapping = null,
Object? parsePureIp = null,
Object? sniff = null,
}) {
return _then(_value.copyWith(
enable: null == enable
? _value.enable
: enable // ignore: cast_nullable_to_non_nullable
as bool,
overrideDest: null == overrideDest
? _value.overrideDest
: overrideDest // ignore: cast_nullable_to_non_nullable
as bool,
sniffing: null == sniffing
? _value.sniffing
: sniffing // ignore: cast_nullable_to_non_nullable
as List<String>,
forceDomain: null == forceDomain
? _value.forceDomain
: forceDomain // ignore: cast_nullable_to_non_nullable
as List<String>,
skipSrcAddress: null == skipSrcAddress
? _value.skipSrcAddress
: skipSrcAddress // ignore: cast_nullable_to_non_nullable
as List<String>,
skipDstAddress: null == skipDstAddress
? _value.skipDstAddress
: skipDstAddress // ignore: cast_nullable_to_non_nullable
as List<String>,
skipDomain: null == skipDomain
? _value.skipDomain
: skipDomain // ignore: cast_nullable_to_non_nullable
as List<String>,
port: null == port
? _value.port
: port // ignore: cast_nullable_to_non_nullable
as List<String>,
forceDnsMapping: null == forceDnsMapping
? _value.forceDnsMapping
: forceDnsMapping // ignore: cast_nullable_to_non_nullable
as bool,
parsePureIp: null == parsePureIp
? _value.parsePureIp
: parsePureIp // ignore: cast_nullable_to_non_nullable
as bool,
sniff: null == sniff
? _value.sniff
: sniff // ignore: cast_nullable_to_non_nullable
as Map<String, SnifferConfig>,
) as $Val);
}
}
/// @nodoc
abstract class _$$SnifferImplCopyWith<$Res> implements $SnifferCopyWith<$Res> {
factory _$$SnifferImplCopyWith(
_$SnifferImpl value, $Res Function(_$SnifferImpl) then) =
__$$SnifferImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{bool enable,
@JsonKey(name: "override-destination") bool overrideDest,
List<String> sniffing,
@JsonKey(name: "force-domain") List<String> forceDomain,
@JsonKey(name: "skip-src-address") List<String> skipSrcAddress,
@JsonKey(name: "skip-dst-address") List<String> skipDstAddress,
@JsonKey(name: "skip-domain") List<String> skipDomain,
@JsonKey(name: "port-whitelist") List<String> port,
@JsonKey(name: "force-dns-mapping") bool forceDnsMapping,
@JsonKey(name: "parse-pure-ip") bool parsePureIp,
Map<String, SnifferConfig> sniff});
}
/// @nodoc
class __$$SnifferImplCopyWithImpl<$Res>
extends _$SnifferCopyWithImpl<$Res, _$SnifferImpl>
implements _$$SnifferImplCopyWith<$Res> {
__$$SnifferImplCopyWithImpl(
_$SnifferImpl _value, $Res Function(_$SnifferImpl) _then)
: super(_value, _then);
/// Create a copy of Sniffer
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? enable = null,
Object? overrideDest = null,
Object? sniffing = null,
Object? forceDomain = null,
Object? skipSrcAddress = null,
Object? skipDstAddress = null,
Object? skipDomain = null,
Object? port = null,
Object? forceDnsMapping = null,
Object? parsePureIp = null,
Object? sniff = null,
}) {
return _then(_$SnifferImpl(
enable: null == enable
? _value.enable
: enable // ignore: cast_nullable_to_non_nullable
as bool,
overrideDest: null == overrideDest
? _value.overrideDest
: overrideDest // ignore: cast_nullable_to_non_nullable
as bool,
sniffing: null == sniffing
? _value._sniffing
: sniffing // ignore: cast_nullable_to_non_nullable
as List<String>,
forceDomain: null == forceDomain
? _value._forceDomain
: forceDomain // ignore: cast_nullable_to_non_nullable
as List<String>,
skipSrcAddress: null == skipSrcAddress
? _value._skipSrcAddress
: skipSrcAddress // ignore: cast_nullable_to_non_nullable
as List<String>,
skipDstAddress: null == skipDstAddress
? _value._skipDstAddress
: skipDstAddress // ignore: cast_nullable_to_non_nullable
as List<String>,
skipDomain: null == skipDomain
? _value._skipDomain
: skipDomain // ignore: cast_nullable_to_non_nullable
as List<String>,
port: null == port
? _value._port
: port // ignore: cast_nullable_to_non_nullable
as List<String>,
forceDnsMapping: null == forceDnsMapping
? _value.forceDnsMapping
: forceDnsMapping // ignore: cast_nullable_to_non_nullable
as bool,
parsePureIp: null == parsePureIp
? _value.parsePureIp
: parsePureIp // ignore: cast_nullable_to_non_nullable
as bool,
sniff: null == sniff
? _value._sniff
: sniff // ignore: cast_nullable_to_non_nullable
as Map<String, SnifferConfig>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$SnifferImpl implements _Sniffer {
const _$SnifferImpl(
{this.enable = false,
@JsonKey(name: "override-destination") this.overrideDest = true,
final List<String> sniffing = const [],
@JsonKey(name: "force-domain") final List<String> forceDomain = const [],
@JsonKey(name: "skip-src-address")
final List<String> skipSrcAddress = const [],
@JsonKey(name: "skip-dst-address")
final List<String> skipDstAddress = const [],
@JsonKey(name: "skip-domain") final List<String> skipDomain = const [],
@JsonKey(name: "port-whitelist") final List<String> port = const [],
@JsonKey(name: "force-dns-mapping") this.forceDnsMapping = true,
@JsonKey(name: "parse-pure-ip") this.parsePureIp = true,
final Map<String, SnifferConfig> sniff = const {}})
: _sniffing = sniffing,
_forceDomain = forceDomain,
_skipSrcAddress = skipSrcAddress,
_skipDstAddress = skipDstAddress,
_skipDomain = skipDomain,
_port = port,
_sniff = sniff;
factory _$SnifferImpl.fromJson(Map<String, dynamic> json) =>
_$$SnifferImplFromJson(json);
@override
@JsonKey()
final bool enable;
@override
@JsonKey(name: "override-destination")
final bool overrideDest;
final List<String> _sniffing;
@override
@JsonKey()
List<String> get sniffing {
if (_sniffing is EqualUnmodifiableListView) return _sniffing;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_sniffing);
}
final List<String> _forceDomain;
@override
@JsonKey(name: "force-domain")
List<String> get forceDomain {
if (_forceDomain is EqualUnmodifiableListView) return _forceDomain;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_forceDomain);
}
final List<String> _skipSrcAddress;
@override
@JsonKey(name: "skip-src-address")
List<String> get skipSrcAddress {
if (_skipSrcAddress is EqualUnmodifiableListView) return _skipSrcAddress;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_skipSrcAddress);
}
final List<String> _skipDstAddress;
@override
@JsonKey(name: "skip-dst-address")
List<String> get skipDstAddress {
if (_skipDstAddress is EqualUnmodifiableListView) return _skipDstAddress;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_skipDstAddress);
}
final List<String> _skipDomain;
@override
@JsonKey(name: "skip-domain")
List<String> get skipDomain {
if (_skipDomain is EqualUnmodifiableListView) return _skipDomain;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_skipDomain);
}
final List<String> _port;
@override
@JsonKey(name: "port-whitelist")
List<String> get port {
if (_port is EqualUnmodifiableListView) return _port;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_port);
}
@override
@JsonKey(name: "force-dns-mapping")
final bool forceDnsMapping;
@override
@JsonKey(name: "parse-pure-ip")
final bool parsePureIp;
final Map<String, SnifferConfig> _sniff;
@override
@JsonKey()
Map<String, SnifferConfig> get sniff {
if (_sniff is EqualUnmodifiableMapView) return _sniff;
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView(_sniff);
}
@override
String toString() {
return 'Sniffer(enable: $enable, overrideDest: $overrideDest, sniffing: $sniffing, forceDomain: $forceDomain, skipSrcAddress: $skipSrcAddress, skipDstAddress: $skipDstAddress, skipDomain: $skipDomain, port: $port, forceDnsMapping: $forceDnsMapping, parsePureIp: $parsePureIp, sniff: $sniff)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SnifferImpl &&
(identical(other.enable, enable) || other.enable == enable) &&
(identical(other.overrideDest, overrideDest) ||
other.overrideDest == overrideDest) &&
const DeepCollectionEquality().equals(other._sniffing, _sniffing) &&
const DeepCollectionEquality()
.equals(other._forceDomain, _forceDomain) &&
const DeepCollectionEquality()
.equals(other._skipSrcAddress, _skipSrcAddress) &&
const DeepCollectionEquality()
.equals(other._skipDstAddress, _skipDstAddress) &&
const DeepCollectionEquality()
.equals(other._skipDomain, _skipDomain) &&
const DeepCollectionEquality().equals(other._port, _port) &&
(identical(other.forceDnsMapping, forceDnsMapping) ||
other.forceDnsMapping == forceDnsMapping) &&
(identical(other.parsePureIp, parsePureIp) ||
other.parsePureIp == parsePureIp) &&
const DeepCollectionEquality().equals(other._sniff, _sniff));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
enable,
overrideDest,
const DeepCollectionEquality().hash(_sniffing),
const DeepCollectionEquality().hash(_forceDomain),
const DeepCollectionEquality().hash(_skipSrcAddress),
const DeepCollectionEquality().hash(_skipDstAddress),
const DeepCollectionEquality().hash(_skipDomain),
const DeepCollectionEquality().hash(_port),
forceDnsMapping,
parsePureIp,
const DeepCollectionEquality().hash(_sniff));
/// Create a copy of Sniffer
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SnifferImplCopyWith<_$SnifferImpl> get copyWith =>
__$$SnifferImplCopyWithImpl<_$SnifferImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$SnifferImplToJson(
this,
);
}
}
abstract class _Sniffer implements Sniffer {
const factory _Sniffer(
{final bool enable,
@JsonKey(name: "override-destination") final bool overrideDest,
final List<String> sniffing,
@JsonKey(name: "force-domain") final List<String> forceDomain,
@JsonKey(name: "skip-src-address") final List<String> skipSrcAddress,
@JsonKey(name: "skip-dst-address") final List<String> skipDstAddress,
@JsonKey(name: "skip-domain") final List<String> skipDomain,
@JsonKey(name: "port-whitelist") final List<String> port,
@JsonKey(name: "force-dns-mapping") final bool forceDnsMapping,
@JsonKey(name: "parse-pure-ip") final bool parsePureIp,
final Map<String, SnifferConfig> sniff}) = _$SnifferImpl;
factory _Sniffer.fromJson(Map<String, dynamic> json) = _$SnifferImpl.fromJson;
@override
bool get enable;
@override
@JsonKey(name: "override-destination")
bool get overrideDest;
@override
List<String> get sniffing;
@override
@JsonKey(name: "force-domain")
List<String> get forceDomain;
@override
@JsonKey(name: "skip-src-address")
List<String> get skipSrcAddress;
@override
@JsonKey(name: "skip-dst-address")
List<String> get skipDstAddress;
@override
@JsonKey(name: "skip-domain")
List<String> get skipDomain;
@override
@JsonKey(name: "port-whitelist")
List<String> get port;
@override
@JsonKey(name: "force-dns-mapping")
bool get forceDnsMapping;
@override
@JsonKey(name: "parse-pure-ip")
bool get parsePureIp;
@override
Map<String, SnifferConfig> get sniff;
/// Create a copy of Sniffer
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SnifferImplCopyWith<_$SnifferImpl> get copyWith =>
throw _privateConstructorUsedError;
}
SnifferConfig _$SnifferConfigFromJson(Map<String, dynamic> json) {
return _SnifferConfig.fromJson(json);
}
/// @nodoc
mixin _$SnifferConfig {
@JsonKey(fromJson: _formJsonPorts)
List<String> get ports => throw _privateConstructorUsedError;
@JsonKey(name: "override-destination")
bool? get overrideDest => throw _privateConstructorUsedError;
/// Serializes this SnifferConfig to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of SnifferConfig
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$SnifferConfigCopyWith<SnifferConfig> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $SnifferConfigCopyWith<$Res> {
factory $SnifferConfigCopyWith(
SnifferConfig value, $Res Function(SnifferConfig) then) =
_$SnifferConfigCopyWithImpl<$Res, SnifferConfig>;
@useResult
$Res call(
{@JsonKey(fromJson: _formJsonPorts) List<String> ports,
@JsonKey(name: "override-destination") bool? overrideDest});
}
/// @nodoc
class _$SnifferConfigCopyWithImpl<$Res, $Val extends SnifferConfig>
implements $SnifferConfigCopyWith<$Res> {
_$SnifferConfigCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of SnifferConfig
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? ports = null,
Object? overrideDest = freezed,
}) {
return _then(_value.copyWith(
ports: null == ports
? _value.ports
: ports // ignore: cast_nullable_to_non_nullable
as List<String>,
overrideDest: freezed == overrideDest
? _value.overrideDest
: overrideDest // ignore: cast_nullable_to_non_nullable
as bool?,
) as $Val);
}
}
/// @nodoc
abstract class _$$SnifferConfigImplCopyWith<$Res>
implements $SnifferConfigCopyWith<$Res> {
factory _$$SnifferConfigImplCopyWith(
_$SnifferConfigImpl value, $Res Function(_$SnifferConfigImpl) then) =
__$$SnifferConfigImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{@JsonKey(fromJson: _formJsonPorts) List<String> ports,
@JsonKey(name: "override-destination") bool? overrideDest});
}
/// @nodoc
class __$$SnifferConfigImplCopyWithImpl<$Res>
extends _$SnifferConfigCopyWithImpl<$Res, _$SnifferConfigImpl>
implements _$$SnifferConfigImplCopyWith<$Res> {
__$$SnifferConfigImplCopyWithImpl(
_$SnifferConfigImpl _value, $Res Function(_$SnifferConfigImpl) _then)
: super(_value, _then);
/// Create a copy of SnifferConfig
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? ports = null,
Object? overrideDest = freezed,
}) {
return _then(_$SnifferConfigImpl(
ports: null == ports
? _value._ports
: ports // ignore: cast_nullable_to_non_nullable
as List<String>,
overrideDest: freezed == overrideDest
? _value.overrideDest
: overrideDest // ignore: cast_nullable_to_non_nullable
as bool?,
));
}
}
/// @nodoc
@JsonSerializable()
class _$SnifferConfigImpl implements _SnifferConfig {
const _$SnifferConfigImpl(
{@JsonKey(fromJson: _formJsonPorts) final List<String> ports = const [],
@JsonKey(name: "override-destination") this.overrideDest})
: _ports = ports;
factory _$SnifferConfigImpl.fromJson(Map<String, dynamic> json) =>
_$$SnifferConfigImplFromJson(json);
final List<String> _ports;
@override
@JsonKey(fromJson: _formJsonPorts)
List<String> get ports {
if (_ports is EqualUnmodifiableListView) return _ports;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_ports);
}
@override
@JsonKey(name: "override-destination")
final bool? overrideDest;
@override
String toString() {
return 'SnifferConfig(ports: $ports, overrideDest: $overrideDest)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SnifferConfigImpl &&
const DeepCollectionEquality().equals(other._ports, _ports) &&
(identical(other.overrideDest, overrideDest) ||
other.overrideDest == overrideDest));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(_ports), overrideDest);
/// Create a copy of SnifferConfig
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SnifferConfigImplCopyWith<_$SnifferConfigImpl> get copyWith =>
__$$SnifferConfigImplCopyWithImpl<_$SnifferConfigImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$SnifferConfigImplToJson(
this,
);
}
}
abstract class _SnifferConfig implements SnifferConfig {
const factory _SnifferConfig(
{@JsonKey(fromJson: _formJsonPorts) final List<String> ports,
@JsonKey(name: "override-destination") final bool? overrideDest}) =
_$SnifferConfigImpl;
factory _SnifferConfig.fromJson(Map<String, dynamic> json) =
_$SnifferConfigImpl.fromJson;
@override
@JsonKey(fromJson: _formJsonPorts)
List<String> get ports;
@override
@JsonKey(name: "override-destination")
bool? get overrideDest;
/// Create a copy of SnifferConfig
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SnifferConfigImplCopyWith<_$SnifferConfigImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Tun _$TunFromJson(Map<String, dynamic> json) {
return _Tun.fromJson(json);
}
@@ -2582,7 +3216,7 @@ ClashConfigSnippet _$ClashConfigSnippetFromJson(Map<String, dynamic> json) {
mixin _$ClashConfigSnippet {
@JsonKey(name: "proxy-groups")
List<ProxyGroup> get proxyGroups => throw _privateConstructorUsedError;
@JsonKey(fromJson: _genRule)
@JsonKey(fromJson: _genRule, name: "rules")
List<Rule> get rule => throw _privateConstructorUsedError;
@JsonKey(name: "rule-providers", fromJson: _genRuleProviders)
List<RuleProvider> get ruleProvider => throw _privateConstructorUsedError;
@@ -2607,7 +3241,7 @@ abstract class $ClashConfigSnippetCopyWith<$Res> {
@useResult
$Res call(
{@JsonKey(name: "proxy-groups") List<ProxyGroup> proxyGroups,
@JsonKey(fromJson: _genRule) List<Rule> rule,
@JsonKey(fromJson: _genRule, name: "rules") List<Rule> rule,
@JsonKey(name: "rule-providers", fromJson: _genRuleProviders)
List<RuleProvider> ruleProvider,
@JsonKey(name: "sub-rules", fromJson: _genSubRules)
@@ -2665,7 +3299,7 @@ abstract class _$$ClashConfigSnippetImplCopyWith<$Res>
@useResult
$Res call(
{@JsonKey(name: "proxy-groups") List<ProxyGroup> proxyGroups,
@JsonKey(fromJson: _genRule) List<Rule> rule,
@JsonKey(fromJson: _genRule, name: "rules") List<Rule> rule,
@JsonKey(name: "rule-providers", fromJson: _genRuleProviders)
List<RuleProvider> ruleProvider,
@JsonKey(name: "sub-rules", fromJson: _genSubRules)
@@ -2717,7 +3351,8 @@ class _$ClashConfigSnippetImpl implements _ClashConfigSnippet {
const _$ClashConfigSnippetImpl(
{@JsonKey(name: "proxy-groups")
final List<ProxyGroup> proxyGroups = const [],
@JsonKey(fromJson: _genRule) final List<Rule> rule = const [],
@JsonKey(fromJson: _genRule, name: "rules")
final List<Rule> rule = const [],
@JsonKey(name: "rule-providers", fromJson: _genRuleProviders)
final List<RuleProvider> ruleProvider = const [],
@JsonKey(name: "sub-rules", fromJson: _genSubRules)
@@ -2741,7 +3376,7 @@ class _$ClashConfigSnippetImpl implements _ClashConfigSnippet {
final List<Rule> _rule;
@override
@JsonKey(fromJson: _genRule)
@JsonKey(fromJson: _genRule, name: "rules")
List<Rule> get rule {
if (_rule is EqualUnmodifiableListView) return _rule;
// ignore: implicit_dynamic_type
@@ -2813,7 +3448,7 @@ class _$ClashConfigSnippetImpl implements _ClashConfigSnippet {
abstract class _ClashConfigSnippet implements ClashConfigSnippet {
const factory _ClashConfigSnippet(
{@JsonKey(name: "proxy-groups") final List<ProxyGroup> proxyGroups,
@JsonKey(fromJson: _genRule) final List<Rule> rule,
@JsonKey(fromJson: _genRule, name: "rules") final List<Rule> rule,
@JsonKey(name: "rule-providers", fromJson: _genRuleProviders)
final List<RuleProvider> ruleProvider,
@JsonKey(name: "sub-rules", fromJson: _genSubRules)
@@ -2826,7 +3461,7 @@ abstract class _ClashConfigSnippet implements ClashConfigSnippet {
@JsonKey(name: "proxy-groups")
List<ProxyGroup> get proxyGroups;
@override
@JsonKey(fromJson: _genRule)
@JsonKey(fromJson: _genRule, name: "rules")
List<Rule> get rule;
@override
@JsonKey(name: "rule-providers", fromJson: _genRuleProviders)
@@ -2851,6 +3486,14 @@ ClashConfig _$ClashConfigFromJson(Map<String, dynamic> json) {
mixin _$ClashConfig {
@JsonKey(name: "mixed-port")
int get mixedPort => throw _privateConstructorUsedError;
@JsonKey(name: "socks-port")
int get socksPort => throw _privateConstructorUsedError;
@JsonKey(name: "port")
int get port => throw _privateConstructorUsedError;
@JsonKey(name: "redir-port")
int get redirPort => throw _privateConstructorUsedError;
@JsonKey(name: "tproxy-port")
int get tproxyPort => throw _privateConstructorUsedError;
Mode get mode => throw _privateConstructorUsedError;
@JsonKey(name: "allow-lan")
bool get allowLan => throw _privateConstructorUsedError;
@@ -2901,6 +3544,10 @@ abstract class $ClashConfigCopyWith<$Res> {
@useResult
$Res call(
{@JsonKey(name: "mixed-port") int mixedPort,
@JsonKey(name: "socks-port") int socksPort,
@JsonKey(name: "port") int port,
@JsonKey(name: "redir-port") int redirPort,
@JsonKey(name: "tproxy-port") int tproxyPort,
Mode mode,
@JsonKey(name: "allow-lan") bool allowLan,
@JsonKey(name: "log-level") LogLevel logLevel,
@@ -2944,6 +3591,10 @@ class _$ClashConfigCopyWithImpl<$Res, $Val extends ClashConfig>
@override
$Res call({
Object? mixedPort = null,
Object? socksPort = null,
Object? port = null,
Object? redirPort = null,
Object? tproxyPort = null,
Object? mode = null,
Object? allowLan = null,
Object? logLevel = null,
@@ -2967,6 +3618,22 @@ class _$ClashConfigCopyWithImpl<$Res, $Val extends ClashConfig>
? _value.mixedPort
: mixedPort // ignore: cast_nullable_to_non_nullable
as int,
socksPort: null == socksPort
? _value.socksPort
: socksPort // ignore: cast_nullable_to_non_nullable
as int,
port: null == port
? _value.port
: port // ignore: cast_nullable_to_non_nullable
as int,
redirPort: null == redirPort
? _value.redirPort
: redirPort // ignore: cast_nullable_to_non_nullable
as int,
tproxyPort: null == tproxyPort
? _value.tproxyPort
: tproxyPort // ignore: cast_nullable_to_non_nullable
as int,
mode: null == mode
? _value.mode
: mode // ignore: cast_nullable_to_non_nullable
@@ -3079,6 +3746,10 @@ abstract class _$$ClashConfigImplCopyWith<$Res>
@useResult
$Res call(
{@JsonKey(name: "mixed-port") int mixedPort,
@JsonKey(name: "socks-port") int socksPort,
@JsonKey(name: "port") int port,
@JsonKey(name: "redir-port") int redirPort,
@JsonKey(name: "tproxy-port") int tproxyPort,
Mode mode,
@JsonKey(name: "allow-lan") bool allowLan,
@JsonKey(name: "log-level") LogLevel logLevel,
@@ -3123,6 +3794,10 @@ class __$$ClashConfigImplCopyWithImpl<$Res>
@override
$Res call({
Object? mixedPort = null,
Object? socksPort = null,
Object? port = null,
Object? redirPort = null,
Object? tproxyPort = null,
Object? mode = null,
Object? allowLan = null,
Object? logLevel = null,
@@ -3146,6 +3821,22 @@ class __$$ClashConfigImplCopyWithImpl<$Res>
? _value.mixedPort
: mixedPort // ignore: cast_nullable_to_non_nullable
as int,
socksPort: null == socksPort
? _value.socksPort
: socksPort // ignore: cast_nullable_to_non_nullable
as int,
port: null == port
? _value.port
: port // ignore: cast_nullable_to_non_nullable
as int,
redirPort: null == redirPort
? _value.redirPort
: redirPort // ignore: cast_nullable_to_non_nullable
as int,
tproxyPort: null == tproxyPort
? _value.tproxyPort
: tproxyPort // ignore: cast_nullable_to_non_nullable
as int,
mode: null == mode
? _value.mode
: mode // ignore: cast_nullable_to_non_nullable
@@ -3223,6 +3914,10 @@ class __$$ClashConfigImplCopyWithImpl<$Res>
class _$ClashConfigImpl implements _ClashConfig {
const _$ClashConfigImpl(
{@JsonKey(name: "mixed-port") this.mixedPort = defaultMixedPort,
@JsonKey(name: "socks-port") this.socksPort = 0,
@JsonKey(name: "port") this.port = 0,
@JsonKey(name: "redir-port") this.redirPort = 0,
@JsonKey(name: "tproxy-port") this.tproxyPort = 0,
this.mode = Mode.rule,
@JsonKey(name: "allow-lan") this.allowLan = false,
@JsonKey(name: "log-level") this.logLevel = LogLevel.error,
@@ -3258,6 +3953,18 @@ class _$ClashConfigImpl implements _ClashConfig {
@JsonKey(name: "mixed-port")
final int mixedPort;
@override
@JsonKey(name: "socks-port")
final int socksPort;
@override
@JsonKey(name: "port")
final int port;
@override
@JsonKey(name: "redir-port")
final int redirPort;
@override
@JsonKey(name: "tproxy-port")
final int tproxyPort;
@override
@JsonKey()
final Mode mode;
@override
@@ -3328,7 +4035,7 @@ class _$ClashConfigImpl implements _ClashConfig {
@override
String toString() {
return 'ClashConfig(mixedPort: $mixedPort, mode: $mode, allowLan: $allowLan, logLevel: $logLevel, ipv6: $ipv6, findProcessMode: $findProcessMode, keepAliveInterval: $keepAliveInterval, unifiedDelay: $unifiedDelay, tcpConcurrent: $tcpConcurrent, tun: $tun, dns: $dns, geoXUrl: $geoXUrl, geodataLoader: $geodataLoader, proxyGroups: $proxyGroups, rule: $rule, globalUa: $globalUa, externalController: $externalController, hosts: $hosts)';
return 'ClashConfig(mixedPort: $mixedPort, socksPort: $socksPort, port: $port, redirPort: $redirPort, tproxyPort: $tproxyPort, mode: $mode, allowLan: $allowLan, logLevel: $logLevel, ipv6: $ipv6, findProcessMode: $findProcessMode, keepAliveInterval: $keepAliveInterval, unifiedDelay: $unifiedDelay, tcpConcurrent: $tcpConcurrent, tun: $tun, dns: $dns, geoXUrl: $geoXUrl, geodataLoader: $geodataLoader, proxyGroups: $proxyGroups, rule: $rule, globalUa: $globalUa, externalController: $externalController, hosts: $hosts)';
}
@override
@@ -3338,6 +4045,13 @@ class _$ClashConfigImpl implements _ClashConfig {
other is _$ClashConfigImpl &&
(identical(other.mixedPort, mixedPort) ||
other.mixedPort == mixedPort) &&
(identical(other.socksPort, socksPort) ||
other.socksPort == socksPort) &&
(identical(other.port, port) || other.port == port) &&
(identical(other.redirPort, redirPort) ||
other.redirPort == redirPort) &&
(identical(other.tproxyPort, tproxyPort) ||
other.tproxyPort == tproxyPort) &&
(identical(other.mode, mode) || other.mode == mode) &&
(identical(other.allowLan, allowLan) ||
other.allowLan == allowLan) &&
@@ -3369,26 +4083,31 @@ class _$ClashConfigImpl implements _ClashConfig {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
mixedPort,
mode,
allowLan,
logLevel,
ipv6,
findProcessMode,
keepAliveInterval,
unifiedDelay,
tcpConcurrent,
tun,
dns,
geoXUrl,
geodataLoader,
const DeepCollectionEquality().hash(_proxyGroups),
const DeepCollectionEquality().hash(_rule),
globalUa,
externalController,
const DeepCollectionEquality().hash(_hosts));
int get hashCode => Object.hashAll([
runtimeType,
mixedPort,
socksPort,
port,
redirPort,
tproxyPort,
mode,
allowLan,
logLevel,
ipv6,
findProcessMode,
keepAliveInterval,
unifiedDelay,
tcpConcurrent,
tun,
dns,
geoXUrl,
geodataLoader,
const DeepCollectionEquality().hash(_proxyGroups),
const DeepCollectionEquality().hash(_rule),
globalUa,
externalController,
const DeepCollectionEquality().hash(_hosts)
]);
/// Create a copy of ClashConfig
/// with the given fields replaced by the non-null parameter values.
@@ -3409,6 +4128,10 @@ class _$ClashConfigImpl implements _ClashConfig {
abstract class _ClashConfig implements ClashConfig {
const factory _ClashConfig(
{@JsonKey(name: "mixed-port") final int mixedPort,
@JsonKey(name: "socks-port") final int socksPort,
@JsonKey(name: "port") final int port,
@JsonKey(name: "redir-port") final int redirPort,
@JsonKey(name: "tproxy-port") final int tproxyPort,
final Mode mode,
@JsonKey(name: "allow-lan") final bool allowLan,
@JsonKey(name: "log-level") final LogLevel logLevel,
@@ -3438,6 +4161,18 @@ abstract class _ClashConfig implements ClashConfig {
@JsonKey(name: "mixed-port")
int get mixedPort;
@override
@JsonKey(name: "socks-port")
int get socksPort;
@override
@JsonKey(name: "port")
int get port;
@override
@JsonKey(name: "redir-port")
int get redirPort;
@override
@JsonKey(name: "tproxy-port")
int get tproxyPort;
@override
Mode get mode;
@override
@JsonKey(name: "allow-lan")

View File

@@ -63,6 +63,72 @@ Map<String, dynamic> _$$RuleProviderImplToJson(_$RuleProviderImpl instance) =>
'name': instance.name,
};
_$SnifferImpl _$$SnifferImplFromJson(Map<String, dynamic> json) =>
_$SnifferImpl(
enable: json['enable'] as bool? ?? false,
overrideDest: json['override-destination'] as bool? ?? true,
sniffing: (json['sniffing'] as List<dynamic>?)
?.map((e) => e as String)
.toList() ??
const [],
forceDomain: (json['force-domain'] as List<dynamic>?)
?.map((e) => e as String)
.toList() ??
const [],
skipSrcAddress: (json['skip-src-address'] as List<dynamic>?)
?.map((e) => e as String)
.toList() ??
const [],
skipDstAddress: (json['skip-dst-address'] as List<dynamic>?)
?.map((e) => e as String)
.toList() ??
const [],
skipDomain: (json['skip-domain'] as List<dynamic>?)
?.map((e) => e as String)
.toList() ??
const [],
port: (json['port-whitelist'] as List<dynamic>?)
?.map((e) => e as String)
.toList() ??
const [],
forceDnsMapping: json['force-dns-mapping'] as bool? ?? true,
parsePureIp: json['parse-pure-ip'] as bool? ?? true,
sniff: (json['sniff'] as Map<String, dynamic>?)?.map(
(k, e) =>
MapEntry(k, SnifferConfig.fromJson(e as Map<String, dynamic>)),
) ??
const {},
);
Map<String, dynamic> _$$SnifferImplToJson(_$SnifferImpl instance) =>
<String, dynamic>{
'enable': instance.enable,
'override-destination': instance.overrideDest,
'sniffing': instance.sniffing,
'force-domain': instance.forceDomain,
'skip-src-address': instance.skipSrcAddress,
'skip-dst-address': instance.skipDstAddress,
'skip-domain': instance.skipDomain,
'port-whitelist': instance.port,
'force-dns-mapping': instance.forceDnsMapping,
'parse-pure-ip': instance.parsePureIp,
'sniff': instance.sniff,
};
_$SnifferConfigImpl _$$SnifferConfigImplFromJson(Map<String, dynamic> json) =>
_$SnifferConfigImpl(
ports: json['ports'] == null
? const []
: _formJsonPorts(json['ports'] as List?),
overrideDest: json['override-destination'] as bool?,
);
Map<String, dynamic> _$$SnifferConfigImplToJson(_$SnifferConfigImpl instance) =>
<String, dynamic>{
'ports': instance.ports,
'override-destination': instance.overrideDest,
};
_$TunImpl _$$TunImplFromJson(Map<String, dynamic> json) => _$TunImpl(
enable: json['enable'] as bool? ?? false,
device: json['device'] as String? ?? appName,
@@ -246,7 +312,7 @@ _$ClashConfigSnippetImpl _$$ClashConfigSnippetImplFromJson(
?.map((e) => ProxyGroup.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
rule: json['rule'] == null ? const [] : _genRule(json['rule'] as List?),
rule: json['rules'] == null ? const [] : _genRule(json['rules'] as List?),
ruleProvider: json['rule-providers'] == null
? const []
: _genRuleProviders(json['rule-providers'] as Map<String, dynamic>),
@@ -259,7 +325,7 @@ Map<String, dynamic> _$$ClashConfigSnippetImplToJson(
_$ClashConfigSnippetImpl instance) =>
<String, dynamic>{
'proxy-groups': instance.proxyGroups,
'rule': instance.rule,
'rules': instance.rule,
'rule-providers': instance.ruleProvider,
'sub-rules': instance.subRules,
};
@@ -267,6 +333,10 @@ Map<String, dynamic> _$$ClashConfigSnippetImplToJson(
_$ClashConfigImpl _$$ClashConfigImplFromJson(Map<String, dynamic> json) =>
_$ClashConfigImpl(
mixedPort: (json['mixed-port'] as num?)?.toInt() ?? defaultMixedPort,
socksPort: (json['socks-port'] as num?)?.toInt() ?? 0,
port: (json['port'] as num?)?.toInt() ?? 0,
redirPort: (json['redir-port'] as num?)?.toInt() ?? 0,
tproxyPort: (json['tproxy-port'] as num?)?.toInt() ?? 0,
mode: $enumDecodeNullable(_$ModeEnumMap, json['mode']) ?? Mode.rule,
allowLan: json['allow-lan'] as bool? ?? false,
logLevel: $enumDecodeNullable(_$LogLevelEnumMap, json['log-level']) ??
@@ -312,6 +382,10 @@ _$ClashConfigImpl _$$ClashConfigImplFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> _$$ClashConfigImplToJson(_$ClashConfigImpl instance) =>
<String, dynamic>{
'mixed-port': instance.mixedPort,
'socks-port': instance.socksPort,
'port': instance.port,
'redir-port': instance.redirPort,
'tproxy-port': instance.tproxyPort,
'mode': _$ModeEnumMap[instance.mode]!,
'allow-lan': instance.allowLan,
'log-level': _$LogLevelEnumMap[instance.logLevel]!,

View File

@@ -19,7 +19,7 @@ mixin _$NavigationItem {
Icon get icon => throw _privateConstructorUsedError;
PageLabel get label => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;
Widget get fragment => throw _privateConstructorUsedError;
Widget get view => throw _privateConstructorUsedError;
bool get keep => throw _privateConstructorUsedError;
String? get path => throw _privateConstructorUsedError;
List<NavigationItemMode> get modes => throw _privateConstructorUsedError;
@@ -41,7 +41,7 @@ abstract class $NavigationItemCopyWith<$Res> {
{Icon icon,
PageLabel label,
String? description,
Widget fragment,
Widget view,
bool keep,
String? path,
List<NavigationItemMode> modes});
@@ -65,7 +65,7 @@ class _$NavigationItemCopyWithImpl<$Res, $Val extends NavigationItem>
Object? icon = null,
Object? label = null,
Object? description = freezed,
Object? fragment = null,
Object? view = null,
Object? keep = null,
Object? path = freezed,
Object? modes = null,
@@ -83,9 +83,9 @@ class _$NavigationItemCopyWithImpl<$Res, $Val extends NavigationItem>
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
fragment: null == fragment
? _value.fragment
: fragment // ignore: cast_nullable_to_non_nullable
view: null == view
? _value.view
: view // ignore: cast_nullable_to_non_nullable
as Widget,
keep: null == keep
? _value.keep
@@ -115,7 +115,7 @@ abstract class _$$NavigationItemImplCopyWith<$Res>
{Icon icon,
PageLabel label,
String? description,
Widget fragment,
Widget view,
bool keep,
String? path,
List<NavigationItemMode> modes});
@@ -137,7 +137,7 @@ class __$$NavigationItemImplCopyWithImpl<$Res>
Object? icon = null,
Object? label = null,
Object? description = freezed,
Object? fragment = null,
Object? view = null,
Object? keep = null,
Object? path = freezed,
Object? modes = null,
@@ -155,9 +155,9 @@ class __$$NavigationItemImplCopyWithImpl<$Res>
? _value.description
: description // ignore: cast_nullable_to_non_nullable
as String?,
fragment: null == fragment
? _value.fragment
: fragment // ignore: cast_nullable_to_non_nullable
view: null == view
? _value.view
: view // ignore: cast_nullable_to_non_nullable
as Widget,
keep: null == keep
? _value.keep
@@ -182,7 +182,7 @@ class _$NavigationItemImpl implements _NavigationItem {
{required this.icon,
required this.label,
this.description,
required this.fragment,
required this.view,
this.keep = true,
this.path,
final List<NavigationItemMode> modes = const [
@@ -198,7 +198,7 @@ class _$NavigationItemImpl implements _NavigationItem {
@override
final String? description;
@override
final Widget fragment;
final Widget view;
@override
@JsonKey()
final bool keep;
@@ -215,7 +215,7 @@ class _$NavigationItemImpl implements _NavigationItem {
@override
String toString() {
return 'NavigationItem(icon: $icon, label: $label, description: $description, fragment: $fragment, keep: $keep, path: $path, modes: $modes)';
return 'NavigationItem(icon: $icon, label: $label, description: $description, view: $view, keep: $keep, path: $path, modes: $modes)';
}
@override
@@ -227,16 +227,15 @@ class _$NavigationItemImpl implements _NavigationItem {
(identical(other.label, label) || other.label == label) &&
(identical(other.description, description) ||
other.description == description) &&
(identical(other.fragment, fragment) ||
other.fragment == fragment) &&
(identical(other.view, view) || other.view == view) &&
(identical(other.keep, keep) || other.keep == keep) &&
(identical(other.path, path) || other.path == path) &&
const DeepCollectionEquality().equals(other._modes, _modes));
}
@override
int get hashCode => Object.hash(runtimeType, icon, label, description,
fragment, keep, path, const DeepCollectionEquality().hash(_modes));
int get hashCode => Object.hash(runtimeType, icon, label, description, view,
keep, path, const DeepCollectionEquality().hash(_modes));
/// Create a copy of NavigationItem
/// with the given fields replaced by the non-null parameter values.
@@ -253,7 +252,7 @@ abstract class _NavigationItem implements NavigationItem {
{required final Icon icon,
required final PageLabel label,
final String? description,
required final Widget fragment,
required final Widget view,
final bool keep,
final String? path,
final List<NavigationItemMode> modes}) = _$NavigationItemImpl;
@@ -265,7 +264,7 @@ abstract class _NavigationItem implements NavigationItem {
@override
String? get description;
@override
Widget get fragment;
Widget get view;
@override
bool get keep;
@override
@@ -3466,3 +3465,348 @@ abstract class _TextPainterParams implements TextPainterParams {
_$$TextPainterParamsImplCopyWith<_$TextPainterParamsImpl> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
mixin _$Result<T> {
T? get data => throw _privateConstructorUsedError;
ResultType get type => throw _privateConstructorUsedError;
String get message => throw _privateConstructorUsedError;
/// Create a copy of Result
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ResultCopyWith<T, Result<T>> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ResultCopyWith<T, $Res> {
factory $ResultCopyWith(Result<T> value, $Res Function(Result<T>) then) =
_$ResultCopyWithImpl<T, $Res, Result<T>>;
@useResult
$Res call({T? data, ResultType type, String message});
}
/// @nodoc
class _$ResultCopyWithImpl<T, $Res, $Val extends Result<T>>
implements $ResultCopyWith<T, $Res> {
_$ResultCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Result
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? data = freezed,
Object? type = null,
Object? message = null,
}) {
return _then(_value.copyWith(
data: freezed == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as T?,
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as ResultType,
message: null == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$ResultImplCopyWith<T, $Res>
implements $ResultCopyWith<T, $Res> {
factory _$$ResultImplCopyWith(
_$ResultImpl<T> value, $Res Function(_$ResultImpl<T>) then) =
__$$ResultImplCopyWithImpl<T, $Res>;
@override
@useResult
$Res call({T? data, ResultType type, String message});
}
/// @nodoc
class __$$ResultImplCopyWithImpl<T, $Res>
extends _$ResultCopyWithImpl<T, $Res, _$ResultImpl<T>>
implements _$$ResultImplCopyWith<T, $Res> {
__$$ResultImplCopyWithImpl(
_$ResultImpl<T> _value, $Res Function(_$ResultImpl<T>) _then)
: super(_value, _then);
/// Create a copy of Result
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? data = freezed,
Object? type = null,
Object? message = null,
}) {
return _then(_$ResultImpl<T>(
data: freezed == data
? _value.data
: data // ignore: cast_nullable_to_non_nullable
as T?,
type: null == type
? _value.type
: type // ignore: cast_nullable_to_non_nullable
as ResultType,
message: null == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
class _$ResultImpl<T> implements _Result<T> {
const _$ResultImpl(
{required this.data, required this.type, required this.message});
@override
final T? data;
@override
final ResultType type;
@override
final String message;
@override
String toString() {
return 'Result<$T>(data: $data, type: $type, message: $message)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ResultImpl<T> &&
const DeepCollectionEquality().equals(other.data, data) &&
(identical(other.type, type) || other.type == type) &&
(identical(other.message, message) || other.message == message));
}
@override
int get hashCode => Object.hash(
runtimeType, const DeepCollectionEquality().hash(data), type, message);
/// Create a copy of Result
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ResultImplCopyWith<T, _$ResultImpl<T>> get copyWith =>
__$$ResultImplCopyWithImpl<T, _$ResultImpl<T>>(this, _$identity);
}
abstract class _Result<T> implements Result<T> {
const factory _Result(
{required final T? data,
required final ResultType type,
required final String message}) = _$ResultImpl<T>;
@override
T? get data;
@override
ResultType get type;
@override
String get message;
/// Create a copy of Result
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ResultImplCopyWith<T, _$ResultImpl<T>> get copyWith =>
throw _privateConstructorUsedError;
}
Script _$ScriptFromJson(Map<String, dynamic> json) {
return _Script.fromJson(json);
}
/// @nodoc
mixin _$Script {
String get id => throw _privateConstructorUsedError;
String get label => throw _privateConstructorUsedError;
String get content => throw _privateConstructorUsedError;
/// Serializes this Script to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of Script
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ScriptCopyWith<Script> get copyWith => throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ScriptCopyWith<$Res> {
factory $ScriptCopyWith(Script value, $Res Function(Script) then) =
_$ScriptCopyWithImpl<$Res, Script>;
@useResult
$Res call({String id, String label, String content});
}
/// @nodoc
class _$ScriptCopyWithImpl<$Res, $Val extends Script>
implements $ScriptCopyWith<$Res> {
_$ScriptCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Script
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? label = null,
Object? content = null,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
label: null == label
? _value.label
: label // ignore: cast_nullable_to_non_nullable
as String,
content: null == content
? _value.content
: content // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
/// @nodoc
abstract class _$$ScriptImplCopyWith<$Res> implements $ScriptCopyWith<$Res> {
factory _$$ScriptImplCopyWith(
_$ScriptImpl value, $Res Function(_$ScriptImpl) then) =
__$$ScriptImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String id, String label, String content});
}
/// @nodoc
class __$$ScriptImplCopyWithImpl<$Res>
extends _$ScriptCopyWithImpl<$Res, _$ScriptImpl>
implements _$$ScriptImplCopyWith<$Res> {
__$$ScriptImplCopyWithImpl(
_$ScriptImpl _value, $Res Function(_$ScriptImpl) _then)
: super(_value, _then);
/// Create a copy of Script
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? label = null,
Object? content = null,
}) {
return _then(_$ScriptImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
label: null == label
? _value.label
: label // ignore: cast_nullable_to_non_nullable
as String,
content: null == content
? _value.content
: content // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ScriptImpl implements _Script {
const _$ScriptImpl(
{required this.id, required this.label, required this.content});
factory _$ScriptImpl.fromJson(Map<String, dynamic> json) =>
_$$ScriptImplFromJson(json);
@override
final String id;
@override
final String label;
@override
final String content;
@override
String toString() {
return 'Script(id: $id, label: $label, content: $content)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ScriptImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.label, label) || other.label == label) &&
(identical(other.content, content) || other.content == content));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, id, label, content);
/// Create a copy of Script
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ScriptImplCopyWith<_$ScriptImpl> get copyWith =>
__$$ScriptImplCopyWithImpl<_$ScriptImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ScriptImplToJson(
this,
);
}
}
abstract class _Script implements Script {
const factory _Script(
{required final String id,
required final String label,
required final String content}) = _$ScriptImpl;
factory _Script.fromJson(Map<String, dynamic> json) = _$ScriptImpl.fromJson;
@override
String get id;
@override
String get label;
@override
String get content;
/// Create a copy of Script
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ScriptImplCopyWith<_$ScriptImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -218,3 +218,16 @@ Map<String, dynamic> _$$TextPainterParamsImplToJson(
'maxWidth': instance.maxWidth,
'maxLines': instance.maxLines,
};
_$ScriptImpl _$$ScriptImplFromJson(Map<String, dynamic> json) => _$ScriptImpl(
id: json['id'] as String,
label: json['label'] as String,
content: json['content'] as String,
);
Map<String, dynamic> _$$ScriptImplToJson(_$ScriptImpl instance) =>
<String, dynamic>{
'id': instance.id,
'label': instance.label,
'content': instance.content,
};

View File

@@ -2243,6 +2243,183 @@ abstract class _ThemeProps implements ThemeProps {
throw _privateConstructorUsedError;
}
ScriptProps _$ScriptPropsFromJson(Map<String, dynamic> json) {
return _ScriptProps.fromJson(json);
}
/// @nodoc
mixin _$ScriptProps {
String? get currentId => throw _privateConstructorUsedError;
List<Script> get scripts => throw _privateConstructorUsedError;
/// Serializes this ScriptProps to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of ScriptProps
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$ScriptPropsCopyWith<ScriptProps> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $ScriptPropsCopyWith<$Res> {
factory $ScriptPropsCopyWith(
ScriptProps value, $Res Function(ScriptProps) then) =
_$ScriptPropsCopyWithImpl<$Res, ScriptProps>;
@useResult
$Res call({String? currentId, List<Script> scripts});
}
/// @nodoc
class _$ScriptPropsCopyWithImpl<$Res, $Val extends ScriptProps>
implements $ScriptPropsCopyWith<$Res> {
_$ScriptPropsCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of ScriptProps
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? currentId = freezed,
Object? scripts = null,
}) {
return _then(_value.copyWith(
currentId: freezed == currentId
? _value.currentId
: currentId // ignore: cast_nullable_to_non_nullable
as String?,
scripts: null == scripts
? _value.scripts
: scripts // ignore: cast_nullable_to_non_nullable
as List<Script>,
) as $Val);
}
}
/// @nodoc
abstract class _$$ScriptPropsImplCopyWith<$Res>
implements $ScriptPropsCopyWith<$Res> {
factory _$$ScriptPropsImplCopyWith(
_$ScriptPropsImpl value, $Res Function(_$ScriptPropsImpl) then) =
__$$ScriptPropsImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String? currentId, List<Script> scripts});
}
/// @nodoc
class __$$ScriptPropsImplCopyWithImpl<$Res>
extends _$ScriptPropsCopyWithImpl<$Res, _$ScriptPropsImpl>
implements _$$ScriptPropsImplCopyWith<$Res> {
__$$ScriptPropsImplCopyWithImpl(
_$ScriptPropsImpl _value, $Res Function(_$ScriptPropsImpl) _then)
: super(_value, _then);
/// Create a copy of ScriptProps
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? currentId = freezed,
Object? scripts = null,
}) {
return _then(_$ScriptPropsImpl(
currentId: freezed == currentId
? _value.currentId
: currentId // ignore: cast_nullable_to_non_nullable
as String?,
scripts: null == scripts
? _value._scripts
: scripts // ignore: cast_nullable_to_non_nullable
as List<Script>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$ScriptPropsImpl implements _ScriptProps {
const _$ScriptPropsImpl(
{this.currentId, final List<Script> scripts = const []})
: _scripts = scripts;
factory _$ScriptPropsImpl.fromJson(Map<String, dynamic> json) =>
_$$ScriptPropsImplFromJson(json);
@override
final String? currentId;
final List<Script> _scripts;
@override
@JsonKey()
List<Script> get scripts {
if (_scripts is EqualUnmodifiableListView) return _scripts;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_scripts);
}
@override
String toString() {
return 'ScriptProps(currentId: $currentId, scripts: $scripts)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$ScriptPropsImpl &&
(identical(other.currentId, currentId) ||
other.currentId == currentId) &&
const DeepCollectionEquality().equals(other._scripts, _scripts));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType, currentId, const DeepCollectionEquality().hash(_scripts));
/// Create a copy of ScriptProps
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$ScriptPropsImplCopyWith<_$ScriptPropsImpl> get copyWith =>
__$$ScriptPropsImplCopyWithImpl<_$ScriptPropsImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$ScriptPropsImplToJson(
this,
);
}
}
abstract class _ScriptProps implements ScriptProps {
const factory _ScriptProps(
{final String? currentId,
final List<Script> scripts}) = _$ScriptPropsImpl;
factory _ScriptProps.fromJson(Map<String, dynamic> json) =
_$ScriptPropsImpl.fromJson;
@override
String? get currentId;
@override
List<Script> get scripts;
/// Create a copy of ScriptProps
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$ScriptPropsImplCopyWith<_$ScriptPropsImpl> get copyWith =>
throw _privateConstructorUsedError;
}
Config _$ConfigFromJson(Map<String, dynamic> json) {
return _Config.fromJson(json);
}
@@ -2263,6 +2440,7 @@ mixin _$Config {
ProxiesStyle get proxiesStyle => throw _privateConstructorUsedError;
WindowProps get windowProps => throw _privateConstructorUsedError;
ClashConfig get patchClashConfig => throw _privateConstructorUsedError;
ScriptProps get scriptProps => throw _privateConstructorUsedError;
/// Serializes this Config to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@@ -2291,7 +2469,8 @@ abstract class $ConfigCopyWith<$Res> {
@JsonKey(fromJson: ThemeProps.safeFromJson) ThemeProps themeProps,
ProxiesStyle proxiesStyle,
WindowProps windowProps,
ClashConfig patchClashConfig});
ClashConfig patchClashConfig,
ScriptProps scriptProps});
$AppSettingPropsCopyWith<$Res> get appSetting;
$DAVCopyWith<$Res>? get dav;
@@ -2301,6 +2480,7 @@ abstract class $ConfigCopyWith<$Res> {
$ProxiesStyleCopyWith<$Res> get proxiesStyle;
$WindowPropsCopyWith<$Res> get windowProps;
$ClashConfigCopyWith<$Res> get patchClashConfig;
$ScriptPropsCopyWith<$Res> get scriptProps;
}
/// @nodoc
@@ -2330,6 +2510,7 @@ class _$ConfigCopyWithImpl<$Res, $Val extends Config>
Object? proxiesStyle = null,
Object? windowProps = null,
Object? patchClashConfig = null,
Object? scriptProps = null,
}) {
return _then(_value.copyWith(
appSetting: null == appSetting
@@ -2380,6 +2561,10 @@ class _$ConfigCopyWithImpl<$Res, $Val extends Config>
? _value.patchClashConfig
: patchClashConfig // ignore: cast_nullable_to_non_nullable
as ClashConfig,
scriptProps: null == scriptProps
? _value.scriptProps
: scriptProps // ignore: cast_nullable_to_non_nullable
as ScriptProps,
) as $Val);
}
@@ -2466,6 +2651,16 @@ class _$ConfigCopyWithImpl<$Res, $Val extends Config>
return _then(_value.copyWith(patchClashConfig: value) as $Val);
});
}
/// Create a copy of Config
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$ScriptPropsCopyWith<$Res> get scriptProps {
return $ScriptPropsCopyWith<$Res>(_value.scriptProps, (value) {
return _then(_value.copyWith(scriptProps: value) as $Val);
});
}
}
/// @nodoc
@@ -2488,7 +2683,8 @@ abstract class _$$ConfigImplCopyWith<$Res> implements $ConfigCopyWith<$Res> {
@JsonKey(fromJson: ThemeProps.safeFromJson) ThemeProps themeProps,
ProxiesStyle proxiesStyle,
WindowProps windowProps,
ClashConfig patchClashConfig});
ClashConfig patchClashConfig,
ScriptProps scriptProps});
@override
$AppSettingPropsCopyWith<$Res> get appSetting;
@@ -2506,6 +2702,8 @@ abstract class _$$ConfigImplCopyWith<$Res> implements $ConfigCopyWith<$Res> {
$WindowPropsCopyWith<$Res> get windowProps;
@override
$ClashConfigCopyWith<$Res> get patchClashConfig;
@override
$ScriptPropsCopyWith<$Res> get scriptProps;
}
/// @nodoc
@@ -2533,6 +2731,7 @@ class __$$ConfigImplCopyWithImpl<$Res>
Object? proxiesStyle = null,
Object? windowProps = null,
Object? patchClashConfig = null,
Object? scriptProps = null,
}) {
return _then(_$ConfigImpl(
appSetting: null == appSetting
@@ -2583,6 +2782,10 @@ class __$$ConfigImplCopyWithImpl<$Res>
? _value.patchClashConfig
: patchClashConfig // ignore: cast_nullable_to_non_nullable
as ClashConfig,
scriptProps: null == scriptProps
? _value.scriptProps
: scriptProps // ignore: cast_nullable_to_non_nullable
as ScriptProps,
));
}
}
@@ -2603,7 +2806,8 @@ class _$ConfigImpl implements _Config {
@JsonKey(fromJson: ThemeProps.safeFromJson) required this.themeProps,
this.proxiesStyle = defaultProxiesStyle,
this.windowProps = defaultWindowProps,
this.patchClashConfig = defaultClashConfig})
this.patchClashConfig = defaultClashConfig,
this.scriptProps = const ScriptProps()})
: _profiles = profiles,
_hotKeyActions = hotKeyActions;
@@ -2656,10 +2860,13 @@ class _$ConfigImpl implements _Config {
@override
@JsonKey()
final ClashConfig patchClashConfig;
@override
@JsonKey()
final ScriptProps scriptProps;
@override
String toString() {
return 'Config(appSetting: $appSetting, profiles: $profiles, hotKeyActions: $hotKeyActions, currentProfileId: $currentProfileId, overrideDns: $overrideDns, dav: $dav, networkProps: $networkProps, vpnProps: $vpnProps, themeProps: $themeProps, proxiesStyle: $proxiesStyle, windowProps: $windowProps, patchClashConfig: $patchClashConfig)';
return 'Config(appSetting: $appSetting, profiles: $profiles, hotKeyActions: $hotKeyActions, currentProfileId: $currentProfileId, overrideDns: $overrideDns, dav: $dav, networkProps: $networkProps, vpnProps: $vpnProps, themeProps: $themeProps, proxiesStyle: $proxiesStyle, windowProps: $windowProps, patchClashConfig: $patchClashConfig, scriptProps: $scriptProps)';
}
@override
@@ -2688,7 +2895,9 @@ class _$ConfigImpl implements _Config {
(identical(other.windowProps, windowProps) ||
other.windowProps == windowProps) &&
(identical(other.patchClashConfig, patchClashConfig) ||
other.patchClashConfig == patchClashConfig));
other.patchClashConfig == patchClashConfig) &&
(identical(other.scriptProps, scriptProps) ||
other.scriptProps == scriptProps));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -2706,7 +2915,8 @@ class _$ConfigImpl implements _Config {
themeProps,
proxiesStyle,
windowProps,
patchClashConfig);
patchClashConfig,
scriptProps);
/// Create a copy of Config
/// with the given fields replaced by the non-null parameter values.
@@ -2739,7 +2949,8 @@ abstract class _Config implements Config {
required final ThemeProps themeProps,
final ProxiesStyle proxiesStyle,
final WindowProps windowProps,
final ClashConfig patchClashConfig}) = _$ConfigImpl;
final ClashConfig patchClashConfig,
final ScriptProps scriptProps}) = _$ConfigImpl;
factory _Config.fromJson(Map<String, dynamic> json) = _$ConfigImpl.fromJson;
@@ -2769,6 +2980,8 @@ abstract class _Config implements Config {
WindowProps get windowProps;
@override
ClashConfig get patchClashConfig;
@override
ScriptProps get scriptProps;
/// Create a copy of Config
/// with the given fields replaced by the non-null parameter values.

View File

@@ -292,6 +292,21 @@ const _$DynamicSchemeVariantEnumMap = {
DynamicSchemeVariant.fruitSalad: 'fruitSalad',
};
_$ScriptPropsImpl _$$ScriptPropsImplFromJson(Map<String, dynamic> json) =>
_$ScriptPropsImpl(
currentId: json['currentId'] as String?,
scripts: (json['scripts'] as List<dynamic>?)
?.map((e) => Script.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
);
Map<String, dynamic> _$$ScriptPropsImplToJson(_$ScriptPropsImpl instance) =>
<String, dynamic>{
'currentId': instance.currentId,
'scripts': instance.scripts,
};
_$ConfigImpl _$$ConfigImplFromJson(Map<String, dynamic> json) => _$ConfigImpl(
appSetting: json['appSetting'] == null
? defaultAppSettingProps
@@ -330,6 +345,9 @@ _$ConfigImpl _$$ConfigImplFromJson(Map<String, dynamic> json) => _$ConfigImpl(
? defaultClashConfig
: ClashConfig.fromJson(
json['patchClashConfig'] as Map<String, dynamic>),
scriptProps: json['scriptProps'] == null
? const ScriptProps()
: ScriptProps.fromJson(json['scriptProps'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$ConfigImplToJson(_$ConfigImpl instance) =>
@@ -346,4 +364,5 @@ Map<String, dynamic> _$$ConfigImplToJson(_$ConfigImpl instance) =>
'proxiesStyle': instance.proxiesStyle,
'windowProps': instance.windowProps,
'patchClashConfig': instance.patchClashConfig,
'scriptProps': instance.scriptProps,
};

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,76 @@ part of '../core.dart';
// JsonSerializableGenerator
// **************************************************************************
_$SetupParamsImpl _$$SetupParamsImplFromJson(Map<String, dynamic> json) =>
_$SetupParamsImpl(
config: json['config'] as Map<String, dynamic>,
selectedMap: Map<String, String>.from(json['selected-map'] as Map),
testUrl: json['test-url'] as String,
);
Map<String, dynamic> _$$SetupParamsImplToJson(_$SetupParamsImpl instance) =>
<String, dynamic>{
'config': instance.config,
'selected-map': instance.selectedMap,
'test-url': instance.testUrl,
};
_$UpdateParamsImpl _$$UpdateParamsImplFromJson(Map<String, dynamic> json) =>
_$UpdateParamsImpl(
tun: Tun.fromJson(json['tun'] as Map<String, dynamic>),
mixedPort: (json['mixed-port'] as num).toInt(),
allowLan: json['allow-lan'] as bool,
findProcessMode:
$enumDecode(_$FindProcessModeEnumMap, json['find-process-mode']),
mode: $enumDecode(_$ModeEnumMap, json['mode']),
logLevel: $enumDecode(_$LogLevelEnumMap, json['log-level']),
ipv6: json['ipv6'] as bool,
tcpConcurrent: json['tcp-concurrent'] as bool,
externalController: $enumDecode(
_$ExternalControllerStatusEnumMap, json['external-controller']),
unifiedDelay: json['unified-delay'] as bool,
);
Map<String, dynamic> _$$UpdateParamsImplToJson(_$UpdateParamsImpl instance) =>
<String, dynamic>{
'tun': instance.tun,
'mixed-port': instance.mixedPort,
'allow-lan': instance.allowLan,
'find-process-mode': _$FindProcessModeEnumMap[instance.findProcessMode]!,
'mode': _$ModeEnumMap[instance.mode]!,
'log-level': _$LogLevelEnumMap[instance.logLevel]!,
'ipv6': instance.ipv6,
'tcp-concurrent': instance.tcpConcurrent,
'external-controller':
_$ExternalControllerStatusEnumMap[instance.externalController]!,
'unified-delay': instance.unifiedDelay,
};
const _$FindProcessModeEnumMap = {
FindProcessMode.always: 'always',
FindProcessMode.off: 'off',
};
const _$ModeEnumMap = {
Mode.rule: 'rule',
Mode.global: 'global',
Mode.direct: 'direct',
};
const _$LogLevelEnumMap = {
LogLevel.debug: 'debug',
LogLevel.info: 'info',
LogLevel.warning: 'warning',
LogLevel.error: 'error',
LogLevel.silent: 'silent',
LogLevel.app: 'app',
};
const _$ExternalControllerStatusEnumMap = {
ExternalControllerStatus.close: '',
ExternalControllerStatus.open: '127.0.0.1:9090',
};
_$CoreStateImpl _$$CoreStateImplFromJson(Map<String, dynamic> json) =>
_$CoreStateImpl(
vpnProps: VpnProps.fromJson(json['vpn-props'] as Map<String, dynamic>?),
@@ -63,43 +133,6 @@ Map<String, dynamic> _$$AndroidVpnOptionsImplToJson(
'dnsServerAddress': instance.dnsServerAddress,
};
_$ConfigExtendedParamsImpl _$$ConfigExtendedParamsImplFromJson(
Map<String, dynamic> json) =>
_$ConfigExtendedParamsImpl(
isPatch: json['is-patch'] as bool,
selectedMap: Map<String, String>.from(json['selected-map'] as Map),
overrideDns: json['override-dns'] as bool,
overrideRule: json['override-rule'] as bool,
testUrl: json['test-url'] as String,
);
Map<String, dynamic> _$$ConfigExtendedParamsImplToJson(
_$ConfigExtendedParamsImpl instance) =>
<String, dynamic>{
'is-patch': instance.isPatch,
'selected-map': instance.selectedMap,
'override-dns': instance.overrideDns,
'override-rule': instance.overrideRule,
'test-url': instance.testUrl,
};
_$UpdateConfigParamsImpl _$$UpdateConfigParamsImplFromJson(
Map<String, dynamic> json) =>
_$UpdateConfigParamsImpl(
profileId: json['profile-id'] as String,
config: ClashConfig.fromJson(json['config'] as Map<String, dynamic>),
params:
ConfigExtendedParams.fromJson(json['params'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$UpdateConfigParamsImplToJson(
_$UpdateConfigParamsImpl instance) =>
<String, dynamic>{
'profile-id': instance.profileId,
'config': instance.config,
'params': instance.params,
};
_$InitParamsImpl _$$InitParamsImplFromJson(Map<String, dynamic> json) =>
_$InitParamsImpl(
homeDir: json['home-dir'] as String,
@@ -199,41 +232,6 @@ Map<String, dynamic> _$$NowImplToJson(_$NowImpl instance) => <String, dynamic>{
'value': instance.value,
};
_$ProcessDataImpl _$$ProcessDataImplFromJson(Map<String, dynamic> json) =>
_$ProcessDataImpl(
id: json['id'] as String,
metadata: Metadata.fromJson(json['metadata'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$ProcessDataImplToJson(_$ProcessDataImpl instance) =>
<String, dynamic>{
'id': instance.id,
'metadata': instance.metadata,
};
_$FdImpl _$$FdImplFromJson(Map<String, dynamic> json) => _$FdImpl(
id: json['id'] as String,
value: (json['value'] as num).toInt(),
);
Map<String, dynamic> _$$FdImplToJson(_$FdImpl instance) => <String, dynamic>{
'id': instance.id,
'value': instance.value,
};
_$ProcessMapItemImpl _$$ProcessMapItemImplFromJson(Map<String, dynamic> json) =>
_$ProcessMapItemImpl(
id: json['id'] as String,
value: json['value'] as String,
);
Map<String, dynamic> _$$ProcessMapItemImplToJson(
_$ProcessMapItemImpl instance) =>
<String, dynamic>{
'id': instance.id,
'value': instance.value,
};
_$ProviderSubscriptionInfoImpl _$$ProviderSubscriptionInfoImplFromJson(
Map<String, dynamic> json) =>
_$ProviderSubscriptionInfoImpl(
@@ -279,32 +277,9 @@ Map<String, dynamic> _$$ExternalProviderImplToJson(
'update-at': instance.updateAt.toIso8601String(),
};
_$TunPropsImpl _$$TunPropsImplFromJson(Map<String, dynamic> json) =>
_$TunPropsImpl(
fd: (json['fd'] as num).toInt(),
gateway: json['gateway'] as String,
gateway6: json['gateway6'] as String,
portal: json['portal'] as String,
portal6: json['portal6'] as String,
dns: json['dns'] as String,
dns6: json['dns6'] as String,
);
Map<String, dynamic> _$$TunPropsImplToJson(_$TunPropsImpl instance) =>
<String, dynamic>{
'fd': instance.fd,
'gateway': instance.gateway,
'gateway6': instance.gateway6,
'portal': instance.portal,
'portal6': instance.portal6,
'dns': instance.dns,
'dns6': instance.dns6,
};
_$ActionImpl _$$ActionImplFromJson(Map<String, dynamic> json) => _$ActionImpl(
method: $enumDecode(_$ActionMethodEnumMap, json['method']),
data: json['data'],
defaultValue: json['default-value'],
id: json['id'] as String,
);
@@ -312,7 +287,6 @@ Map<String, dynamic> _$$ActionImplToJson(_$ActionImpl instance) =>
<String, dynamic>{
'method': _$ActionMethodEnumMap[instance.method]!,
'data': instance.data,
'default-value': instance.defaultValue,
'id': instance.id,
};
@@ -324,6 +298,7 @@ const _$ActionMethodEnumMap = {
ActionMethod.shutdown: 'shutdown',
ActionMethod.validateConfig: 'validateConfig',
ActionMethod.updateConfig: 'updateConfig',
ActionMethod.getConfig: 'getConfig',
ActionMethod.getProxies: 'getProxies',
ActionMethod.changeProxy: 'changeProxy',
ActionMethod.getTraffic: 'getTraffic',
@@ -332,6 +307,7 @@ const _$ActionMethodEnumMap = {
ActionMethod.asyncTestDelay: 'asyncTestDelay',
ActionMethod.getConnections: 'getConnections',
ActionMethod.closeConnections: 'closeConnections',
ActionMethod.resetConnections: 'resetConnections',
ActionMethod.closeConnection: 'closeConnection',
ActionMethod.getExternalProviders: 'getExternalProviders',
ActionMethod.getExternalProvider: 'getExternalProvider',
@@ -344,10 +320,8 @@ const _$ActionMethodEnumMap = {
ActionMethod.stopListener: 'stopListener',
ActionMethod.getCountryCode: 'getCountryCode',
ActionMethod.getMemory: 'getMemory',
ActionMethod.getProfile: 'getProfile',
ActionMethod.crash: 'crash',
ActionMethod.setFdMap: 'setFdMap',
ActionMethod.setProcessMap: 'setProcessMap',
ActionMethod.setupConfig: 'setupConfig',
ActionMethod.setState: 'setState',
ActionMethod.startTun: 'startTun',
ActionMethod.stopTun: 'stopTun',
@@ -362,6 +336,8 @@ _$ActionResultImpl _$$ActionResultImplFromJson(Map<String, dynamic> json) =>
method: $enumDecode(_$ActionMethodEnumMap, json['method']),
data: json['data'],
id: json['id'] as String?,
code: $enumDecodeNullable(_$ResultTypeEnumMap, json['code']) ??
ResultType.success,
);
Map<String, dynamic> _$$ActionResultImplToJson(_$ActionResultImpl instance) =>
@@ -369,4 +345,10 @@ Map<String, dynamic> _$$ActionResultImplToJson(_$ActionResultImpl instance) =>
'method': _$ActionMethodEnumMap[instance.method]!,
'data': instance.data,
'id': instance.id,
'code': _$ResultTypeEnumMap[instance.code]!,
};
const _$ResultTypeEnumMap = {
ResultType.success: 0,
ResultType.error: -1,
};

View File

@@ -514,6 +514,215 @@ abstract class _VM4<A, B, C, D> implements VM4<A, B, C, D> {
throw _privateConstructorUsedError;
}
/// @nodoc
mixin _$VM5<A, B, C, D, E> {
A get a => throw _privateConstructorUsedError;
B get b => throw _privateConstructorUsedError;
C get c => throw _privateConstructorUsedError;
D get d => throw _privateConstructorUsedError;
E get e => throw _privateConstructorUsedError;
/// Create a copy of VM5
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$VM5CopyWith<A, B, C, D, E, VM5<A, B, C, D, E>> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $VM5CopyWith<A, B, C, D, E, $Res> {
factory $VM5CopyWith(
VM5<A, B, C, D, E> value, $Res Function(VM5<A, B, C, D, E>) then) =
_$VM5CopyWithImpl<A, B, C, D, E, $Res, VM5<A, B, C, D, E>>;
@useResult
$Res call({A a, B b, C c, D d, E e});
}
/// @nodoc
class _$VM5CopyWithImpl<A, B, C, D, E, $Res, $Val extends VM5<A, B, C, D, E>>
implements $VM5CopyWith<A, B, C, D, E, $Res> {
_$VM5CopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of VM5
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? a = freezed,
Object? b = freezed,
Object? c = freezed,
Object? d = freezed,
Object? e = freezed,
}) {
return _then(_value.copyWith(
a: freezed == a
? _value.a
: a // ignore: cast_nullable_to_non_nullable
as A,
b: freezed == b
? _value.b
: b // ignore: cast_nullable_to_non_nullable
as B,
c: freezed == c
? _value.c
: c // ignore: cast_nullable_to_non_nullable
as C,
d: freezed == d
? _value.d
: d // ignore: cast_nullable_to_non_nullable
as D,
e: freezed == e
? _value.e
: e // ignore: cast_nullable_to_non_nullable
as E,
) as $Val);
}
}
/// @nodoc
abstract class _$$VM5ImplCopyWith<A, B, C, D, E, $Res>
implements $VM5CopyWith<A, B, C, D, E, $Res> {
factory _$$VM5ImplCopyWith(_$VM5Impl<A, B, C, D, E> value,
$Res Function(_$VM5Impl<A, B, C, D, E>) then) =
__$$VM5ImplCopyWithImpl<A, B, C, D, E, $Res>;
@override
@useResult
$Res call({A a, B b, C c, D d, E e});
}
/// @nodoc
class __$$VM5ImplCopyWithImpl<A, B, C, D, E, $Res>
extends _$VM5CopyWithImpl<A, B, C, D, E, $Res, _$VM5Impl<A, B, C, D, E>>
implements _$$VM5ImplCopyWith<A, B, C, D, E, $Res> {
__$$VM5ImplCopyWithImpl(_$VM5Impl<A, B, C, D, E> _value,
$Res Function(_$VM5Impl<A, B, C, D, E>) _then)
: super(_value, _then);
/// Create a copy of VM5
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? a = freezed,
Object? b = freezed,
Object? c = freezed,
Object? d = freezed,
Object? e = freezed,
}) {
return _then(_$VM5Impl<A, B, C, D, E>(
a: freezed == a
? _value.a
: a // ignore: cast_nullable_to_non_nullable
as A,
b: freezed == b
? _value.b
: b // ignore: cast_nullable_to_non_nullable
as B,
c: freezed == c
? _value.c
: c // ignore: cast_nullable_to_non_nullable
as C,
d: freezed == d
? _value.d
: d // ignore: cast_nullable_to_non_nullable
as D,
e: freezed == e
? _value.e
: e // ignore: cast_nullable_to_non_nullable
as E,
));
}
}
/// @nodoc
class _$VM5Impl<A, B, C, D, E> implements _VM5<A, B, C, D, E> {
const _$VM5Impl(
{required this.a,
required this.b,
required this.c,
required this.d,
required this.e});
@override
final A a;
@override
final B b;
@override
final C c;
@override
final D d;
@override
final E e;
@override
String toString() {
return 'VM5<$A, $B, $C, $D, $E>(a: $a, b: $b, c: $c, d: $d, e: $e)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$VM5Impl<A, B, C, D, E> &&
const DeepCollectionEquality().equals(other.a, a) &&
const DeepCollectionEquality().equals(other.b, b) &&
const DeepCollectionEquality().equals(other.c, c) &&
const DeepCollectionEquality().equals(other.d, d) &&
const DeepCollectionEquality().equals(other.e, e));
}
@override
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(a),
const DeepCollectionEquality().hash(b),
const DeepCollectionEquality().hash(c),
const DeepCollectionEquality().hash(d),
const DeepCollectionEquality().hash(e));
/// Create a copy of VM5
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$VM5ImplCopyWith<A, B, C, D, E, _$VM5Impl<A, B, C, D, E>> get copyWith =>
__$$VM5ImplCopyWithImpl<A, B, C, D, E, _$VM5Impl<A, B, C, D, E>>(
this, _$identity);
}
abstract class _VM5<A, B, C, D, E> implements VM5<A, B, C, D, E> {
const factory _VM5(
{required final A a,
required final B b,
required final C c,
required final D d,
required final E e}) = _$VM5Impl<A, B, C, D, E>;
@override
A get a;
@override
B get b;
@override
C get c;
@override
D get d;
@override
E get e;
/// Create a copy of VM5
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$VM5ImplCopyWith<A, B, C, D, E, _$VM5Impl<A, B, C, D, E>> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
mixin _$StartButtonSelectorState {
bool get isInit => throw _privateConstructorUsedError;
@@ -2142,6 +2351,7 @@ mixin _$ProxiesListSelectorState {
ProxyCardType get proxyCardType => throw _privateConstructorUsedError;
num get sortNum => throw _privateConstructorUsedError;
int get columns => throw _privateConstructorUsedError;
String get query => throw _privateConstructorUsedError;
/// Create a copy of ProxiesListSelectorState
/// with the given fields replaced by the non-null parameter values.
@@ -2162,7 +2372,8 @@ abstract class $ProxiesListSelectorStateCopyWith<$Res> {
ProxiesSortType proxiesSortType,
ProxyCardType proxyCardType,
num sortNum,
int columns});
int columns,
String query});
}
/// @nodoc
@@ -2187,6 +2398,7 @@ class _$ProxiesListSelectorStateCopyWithImpl<$Res,
Object? proxyCardType = null,
Object? sortNum = null,
Object? columns = null,
Object? query = null,
}) {
return _then(_value.copyWith(
groupNames: null == groupNames
@@ -2213,6 +2425,10 @@ class _$ProxiesListSelectorStateCopyWithImpl<$Res,
? _value.columns
: columns // ignore: cast_nullable_to_non_nullable
as int,
query: null == query
? _value.query
: query // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}
@@ -2232,7 +2448,8 @@ abstract class _$$ProxiesListSelectorStateImplCopyWith<$Res>
ProxiesSortType proxiesSortType,
ProxyCardType proxyCardType,
num sortNum,
int columns});
int columns,
String query});
}
/// @nodoc
@@ -2256,6 +2473,7 @@ class __$$ProxiesListSelectorStateImplCopyWithImpl<$Res>
Object? proxyCardType = null,
Object? sortNum = null,
Object? columns = null,
Object? query = null,
}) {
return _then(_$ProxiesListSelectorStateImpl(
groupNames: null == groupNames
@@ -2282,6 +2500,10 @@ class __$$ProxiesListSelectorStateImplCopyWithImpl<$Res>
? _value.columns
: columns // ignore: cast_nullable_to_non_nullable
as int,
query: null == query
? _value.query
: query // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
@@ -2295,7 +2517,8 @@ class _$ProxiesListSelectorStateImpl implements _ProxiesListSelectorState {
required this.proxiesSortType,
required this.proxyCardType,
required this.sortNum,
required this.columns})
required this.columns,
required this.query})
: _groupNames = groupNames,
_currentUnfoldSet = currentUnfoldSet;
@@ -2323,10 +2546,12 @@ class _$ProxiesListSelectorStateImpl implements _ProxiesListSelectorState {
final num sortNum;
@override
final int columns;
@override
final String query;
@override
String toString() {
return 'ProxiesListSelectorState(groupNames: $groupNames, currentUnfoldSet: $currentUnfoldSet, proxiesSortType: $proxiesSortType, proxyCardType: $proxyCardType, sortNum: $sortNum, columns: $columns)';
return 'ProxiesListSelectorState(groupNames: $groupNames, currentUnfoldSet: $currentUnfoldSet, proxiesSortType: $proxiesSortType, proxyCardType: $proxyCardType, sortNum: $sortNum, columns: $columns, query: $query)';
}
@override
@@ -2343,7 +2568,8 @@ class _$ProxiesListSelectorStateImpl implements _ProxiesListSelectorState {
(identical(other.proxyCardType, proxyCardType) ||
other.proxyCardType == proxyCardType) &&
(identical(other.sortNum, sortNum) || other.sortNum == sortNum) &&
(identical(other.columns, columns) || other.columns == columns));
(identical(other.columns, columns) || other.columns == columns) &&
(identical(other.query, query) || other.query == query));
}
@override
@@ -2354,7 +2580,8 @@ class _$ProxiesListSelectorStateImpl implements _ProxiesListSelectorState {
proxiesSortType,
proxyCardType,
sortNum,
columns);
columns,
query);
/// Create a copy of ProxiesListSelectorState
/// with the given fields replaced by the non-null parameter values.
@@ -2373,7 +2600,8 @@ abstract class _ProxiesListSelectorState implements ProxiesListSelectorState {
required final ProxiesSortType proxiesSortType,
required final ProxyCardType proxyCardType,
required final num sortNum,
required final int columns}) = _$ProxiesListSelectorStateImpl;
required final int columns,
required final String query}) = _$ProxiesListSelectorStateImpl;
@override
List<String> get groupNames;
@@ -2387,6 +2615,8 @@ abstract class _ProxiesListSelectorState implements ProxiesListSelectorState {
num get sortNum;
@override
int get columns;
@override
String get query;
/// Create a copy of ProxiesListSelectorState
/// with the given fields replaced by the non-null parameter values.
@@ -4216,7 +4446,6 @@ abstract class _VpnState implements VpnState {
/// @nodoc
mixin _$ProfileOverrideStateModel {
ClashConfigSnippet? get snippet => throw _privateConstructorUsedError;
bool get isEdit => throw _privateConstructorUsedError;
Set<String> get selectedRules => throw _privateConstructorUsedError;
OverrideData? get overrideData => throw _privateConstructorUsedError;
@@ -4235,7 +4464,6 @@ abstract class $ProfileOverrideStateModelCopyWith<$Res> {
@useResult
$Res call(
{ClashConfigSnippet? snippet,
bool isEdit,
Set<String> selectedRules,
OverrideData? overrideData});
@@ -4260,7 +4488,6 @@ class _$ProfileOverrideStateModelCopyWithImpl<$Res,
@override
$Res call({
Object? snippet = freezed,
Object? isEdit = null,
Object? selectedRules = null,
Object? overrideData = freezed,
}) {
@@ -4269,10 +4496,6 @@ class _$ProfileOverrideStateModelCopyWithImpl<$Res,
? _value.snippet
: snippet // ignore: cast_nullable_to_non_nullable
as ClashConfigSnippet?,
isEdit: null == isEdit
? _value.isEdit
: isEdit // ignore: cast_nullable_to_non_nullable
as bool,
selectedRules: null == selectedRules
? _value.selectedRules
: selectedRules // ignore: cast_nullable_to_non_nullable
@@ -4324,7 +4547,6 @@ abstract class _$$ProfileOverrideStateModelImplCopyWith<$Res>
@useResult
$Res call(
{ClashConfigSnippet? snippet,
bool isEdit,
Set<String> selectedRules,
OverrideData? overrideData});
@@ -4350,7 +4572,6 @@ class __$$ProfileOverrideStateModelImplCopyWithImpl<$Res>
@override
$Res call({
Object? snippet = freezed,
Object? isEdit = null,
Object? selectedRules = null,
Object? overrideData = freezed,
}) {
@@ -4359,10 +4580,6 @@ class __$$ProfileOverrideStateModelImplCopyWithImpl<$Res>
? _value.snippet
: snippet // ignore: cast_nullable_to_non_nullable
as ClashConfigSnippet?,
isEdit: null == isEdit
? _value.isEdit
: isEdit // ignore: cast_nullable_to_non_nullable
as bool,
selectedRules: null == selectedRules
? _value._selectedRules
: selectedRules // ignore: cast_nullable_to_non_nullable
@@ -4380,15 +4597,12 @@ class __$$ProfileOverrideStateModelImplCopyWithImpl<$Res>
class _$ProfileOverrideStateModelImpl implements _ProfileOverrideStateModel {
const _$ProfileOverrideStateModelImpl(
{this.snippet,
required this.isEdit,
required final Set<String> selectedRules,
this.overrideData})
: _selectedRules = selectedRules;
@override
final ClashConfigSnippet? snippet;
@override
final bool isEdit;
final Set<String> _selectedRules;
@override
Set<String> get selectedRules {
@@ -4402,7 +4616,7 @@ class _$ProfileOverrideStateModelImpl implements _ProfileOverrideStateModel {
@override
String toString() {
return 'ProfileOverrideStateModel(snippet: $snippet, isEdit: $isEdit, selectedRules: $selectedRules, overrideData: $overrideData)';
return 'ProfileOverrideStateModel(snippet: $snippet, selectedRules: $selectedRules, overrideData: $overrideData)';
}
@override
@@ -4411,7 +4625,6 @@ class _$ProfileOverrideStateModelImpl implements _ProfileOverrideStateModel {
(other.runtimeType == runtimeType &&
other is _$ProfileOverrideStateModelImpl &&
(identical(other.snippet, snippet) || other.snippet == snippet) &&
(identical(other.isEdit, isEdit) || other.isEdit == isEdit) &&
const DeepCollectionEquality()
.equals(other._selectedRules, _selectedRules) &&
(identical(other.overrideData, overrideData) ||
@@ -4419,7 +4632,7 @@ class _$ProfileOverrideStateModelImpl implements _ProfileOverrideStateModel {
}
@override
int get hashCode => Object.hash(runtimeType, snippet, isEdit,
int get hashCode => Object.hash(runtimeType, snippet,
const DeepCollectionEquality().hash(_selectedRules), overrideData);
/// Create a copy of ProfileOverrideStateModel
@@ -4435,15 +4648,12 @@ class _$ProfileOverrideStateModelImpl implements _ProfileOverrideStateModel {
abstract class _ProfileOverrideStateModel implements ProfileOverrideStateModel {
const factory _ProfileOverrideStateModel(
{final ClashConfigSnippet? snippet,
required final bool isEdit,
required final Set<String> selectedRules,
final OverrideData? overrideData}) = _$ProfileOverrideStateModelImpl;
@override
ClashConfigSnippet? get snippet;
@override
bool get isEdit;
@override
Set<String> get selectedRules;
@override
OverrideData? get overrideData;

View File

@@ -11,7 +11,6 @@ import 'package:freezed_annotation/freezed_annotation.dart';
import 'clash_config.dart';
part 'generated/profile.freezed.dart';
part 'generated/profile.g.dart';
typedef SelectedMap = Map<String, String>;
@@ -150,12 +149,12 @@ extension ProfileExtension on Profile {
Future<bool> check() async {
final profilePath = await appPath.getProfilePath(id);
return await File(profilePath!).exists();
return await File(profilePath).exists();
}
Future<File> getFile() async {
final path = await appPath.getProfilePath(id);
final file = File(path!);
final file = File(path);
final isExists = await file.exists();
if (!isExists) {
await file.create(recursive: true);

View File

@@ -25,7 +25,7 @@ class VM3<A, B, C> with _$VM3<A, B, C> {
}
@freezed
class VM4<A, B, C,D> with _$VM4<A, B, C,D> {
class VM4<A, B, C, D> with _$VM4<A, B, C, D> {
const factory VM4({
required A a,
required B b,
@@ -34,6 +34,16 @@ class VM4<A, B, C,D> with _$VM4<A, B, C,D> {
}) = _VM4;
}
@freezed
class VM5<A, B, C, D, E> with _$VM5<A, B, C, D, E> {
const factory VM5({
required A a,
required B b,
required C c,
required D d,
required E e,
}) = _VM5;
}
@freezed
class StartButtonSelectorState with _$StartButtonSelectorState {
@@ -125,6 +135,7 @@ class ProxiesListSelectorState with _$ProxiesListSelectorState {
required ProxyCardType proxyCardType,
required num sortNum,
required int columns,
required String query,
}) = _ProxiesListSelectorState;
}
@@ -260,7 +271,6 @@ class VpnState with _$VpnState {
class ProfileOverrideStateModel with _$ProfileOverrideStateModel {
const factory ProfileOverrideStateModel({
ClashConfigSnippet? snippet,
required bool isEdit,
required Set<String> selectedRules,
OverrideData? overrideData,
}) = _ProfileOverrideStateModel;