fix formatting

This commit is contained in:
Fabian Freund
2026-07-30 15:00:26 +02:00
parent 74c9d9c81b
commit fcfde0dc3b
20 changed files with 4517 additions and 3084 deletions
@@ -58,7 +58,7 @@ final class PersistedBoolProvider
}
}
String _$persistedBoolHash() => r'97fd7ed82dfde444fddf4475a3982be00f5f197a';
String _$persistedBoolHash() => r'b73ab03b1a9a81c27174393484b77e107be9cf50';
final class PersistedBoolFamily extends $Family
with
@@ -843,7 +843,7 @@ final class PinnedAddonIdsProvider
}
}
String _$pinnedAddonIdsHash() => r'4f46cd69d4817e6e19e4d04f4fdcf83d5e2efb8c';
String _$pinnedAddonIdsHash() => r'93a3e6944156569eb6eca2bb934c8e94e64484ad';
abstract class _$PinnedAddonIds extends $Notifier<Set<String>> {
Set<String> build();
@@ -45,7 +45,7 @@ final class BookmarkListUiStateNotifierProvider
}
String _$bookmarkListUiStateNotifierHash() =>
r'13f01daba9d1591c700e956428f0e0e8cb2bfe92';
r'ec34d3b9263463574de71dce9ab349668862c598';
@JsonPersist()
abstract class _$BookmarkListUiStateNotifierBase
@@ -42,7 +42,7 @@ final class BookmarkSearchResultsProvider
}
String _$bookmarkSearchResultsHash() =>
r'49ebd21a137bc09bbd67b692aacb2554b8364564';
r'1708ae3df94113ab370086af38f9cc150d46d3c5';
abstract class _$BookmarkSearchResults extends $Notifier<List<BookmarkEntry>> {
List<BookmarkEntry> build();
@@ -42,7 +42,7 @@ final class BookmarksRepositoryProvider
}
String _$bookmarksRepositoryHash() =>
r'bf95d30f21773e931b12fd85d03d072d88d5b715';
r'20f005705d6235289f252bd9b17eb5f2227287ac';
abstract class _$BookmarksRepository extends $Notifier<int> {
int build();
@@ -42,7 +42,7 @@ final class TabsViewModeControllerProvider
}
String _$tabsViewModeControllerHash() =>
r'e013b174218fcad81981f7d939cf161c3b002adc';
r'f1da070a3cd00dbdc75f36120e202fa4f822fd5b';
abstract class _$TabsViewModeController extends $Notifier<TabsViewMode> {
TabsViewMode build();
@@ -97,7 +97,7 @@ final class TabViewFilterControllerProvider
}
String _$tabViewFilterControllerHash() =>
r'6f5d42761765c0135bf40953c574c17d141ffab2';
r'bbed4900c337629061550b6595d0fa0e0d52362d';
@JsonPersist()
abstract class _$TabViewFilterControllerBase
@@ -44,7 +44,7 @@ final class HistoryVisitsFilterProvider
}
String _$historyVisitsFilterHash() =>
r'4c1530cfd2d94b1cdbb04fbe2df8037cb211a668';
r'dca9d17bcaa5c5db2757edf59a8a23e2aebe8c99';
@JsonPersist()
abstract class _$HistoryVisitsFilterBase
@@ -101,7 +101,7 @@ final class HistoryDownloadsFilterProvider
}
String _$historyDownloadsFilterHash() =>
r'b44de5aced7dadba361fddf69b8462ff92252a99';
r'30514069187520cf003759ba3f406a0adf9c5620';
@JsonPersist()
abstract class _$HistoryDownloadsFilterBase
@@ -94,7 +94,7 @@ final class SearchModuleOrderProvider
}
}
String _$searchModuleOrderHash() => r'fde46e0a0998152340801cb323335a2f4a0f3557';
String _$searchModuleOrderHash() => r'153cebf32e0bf7b42c4eaaa113b0ca5f36851b5f';
final class SearchModuleOrderFamily extends $Family
with
@@ -41,7 +41,7 @@ final class SelectedContainerProvider
}
}
String _$selectedContainerHash() => r'3c9ab093bce7cd3b84e0318095b1ada25bdf8a65';
String _$selectedContainerHash() => r'29ca2ed41d5f9029bdd3345334717f3ca062db0d';
abstract class _$SelectedContainer extends $Notifier<String?> {
String? build();
@@ -45,7 +45,7 @@ final class WebSearchSettingsControllerProvider
}
String _$webSearchSettingsControllerHash() =>
r'f21a6203fdb8b21c28b0ddd23f1b48768673138e';
r'969a3998abc34280b34de2b4789645a4d68c0c77';
@JsonPersist()
abstract class _$WebSearchSettingsControllerBase
@@ -224,7 +224,7 @@ final class SmallWebSessionControllerProvider
}
String _$smallWebSessionControllerHash() =>
r'ee57d24b33b5a7dffe668fe3ddd2b77d84f58eae';
r'd80b9c002bf28a024373b0a6ee036bddff4fe8e0';
abstract class _$SmallWebSessionController
extends $Notifier<AsyncValue<SmallWebSessionState>> {
@@ -42,7 +42,7 @@ final class BackupDirectoryUriProvider
}
String _$backupDirectoryUriHash() =>
r'4e5f4e7bde90b2a92c559afe8774ed5ee503277d';
r'966118c9ec159615de5f37527fa8da4ca1e713d1';
abstract class _$BackupDirectoryUri extends $Notifier<Uri?> {
Uri? build();
@@ -214,8 +214,10 @@ class EngineSettingsRepository extends _$EngineSettingsRepository {
DriftSqlType.bool,
db.typeMapping,
),
'forceUserScalableContent': settings['forceUserScalableContent']
?.readAs(DriftSqlType.bool, db.typeMapping),
'forceUserScalableContent': settings['forceUserScalableContent']?.readAs(
DriftSqlType.bool,
db.typeMapping,
),
// Process Isolation Settings
'fissionEnabled': settings['fissionEnabled']?.readAs(
DriftSqlType.bool,
File diff suppressed because it is too large Load Diff
@@ -3100,7 +3100,10 @@ abstract class GeckoAppLinksApi {
/// is alive, consume it (double-resolve is a no-op), then perform side effects
/// after releasing the store lock (§2.6).
@async
AppLinkResolutionResult resolvePendingAppLink(int requestId, AppLinkDecision decision);
AppLinkResolutionResult resolvePendingAppLink(
int requestId,
AppLinkDecision decision,
);
/// Resolve [url] to an external-app target.
///
@@ -34,8 +34,11 @@ Object? _extractReplyValueOrThrow(
return replyList.firstOrNull;
}
List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
List<Object?> wrapResponse({
Object? result,
PlatformException? error,
bool empty = false,
}) {
if (empty) {
return <Object?>[];
}
@@ -44,6 +47,7 @@ List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty
}
return <Object?>[error.code, error.message, error.details];
}
bool _deepEquals(Object? a, Object? b) {
if (identical(a, b)) {
return true;
@@ -56,8 +60,9 @@ bool _deepEquals(Object? a, Object? b) {
}
if (a is List && b is List) {
return a.length == b.length &&
a.indexed
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
a.indexed.every(
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
);
}
if (a is Map && b is Map) {
if (a.length != b.length) {
@@ -106,7 +111,6 @@ int _deepHash(Object? value) {
return value.hashCode;
}
enum SingboxProxyProfileType {
socks,
http,
@@ -125,13 +129,7 @@ enum SingboxProxyProfileType {
customOutbound,
}
enum SingboxProxyRuntimeStatus {
stopped,
starting,
running,
stopping,
error,
}
enum SingboxProxyRuntimeStatus { stopped, starting, running, stopping, error }
class SingboxProxyProfile {
SingboxProxyProfile({
@@ -157,17 +155,12 @@ class SingboxProxyProfile {
String? secretJson;
List<Object?> _toList() {
return <Object?>[
id,
name,
type,
configJson,
secretJson,
];
return <Object?>[id, name, type, configJson, secretJson];
}
Object encode() {
return _toList(); }
return _toList();
}
static SingboxProxyProfile decode(Object result) {
result as List<Object?>;
@@ -189,7 +182,11 @@ class SingboxProxyProfile {
if (identical(this, other)) {
return true;
}
return _deepEquals(id, other.id) && _deepEquals(name, other.name) && _deepEquals(type, other.type) && _deepEquals(configJson, other.configJson) && _deepEquals(secretJson, other.secretJson);
return _deepEquals(id, other.id) &&
_deepEquals(name, other.name) &&
_deepEquals(type, other.type) &&
_deepEquals(configJson, other.configJson) &&
_deepEquals(secretJson, other.secretJson);
}
@override
@@ -239,7 +236,8 @@ class SingboxProxyRuntimeOptions {
}
Object encode() {
return _toList(); }
return _toList();
}
static SingboxProxyRuntimeOptions decode(Object result) {
result as List<Object?>;
@@ -254,13 +252,17 @@ class SingboxProxyRuntimeOptions {
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! SingboxProxyRuntimeOptions || other.runtimeType != runtimeType) {
if (other is! SingboxProxyRuntimeOptions ||
other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(preferredBasePort, other.preferredBasePort) && _deepEquals(blockUnmatchedTraffic, other.blockUnmatchedTraffic) && _deepEquals(dnsConfig, other.dnsConfig) && _deepEquals(bootstrapDohUrl, other.bootstrapDohUrl);
return _deepEquals(preferredBasePort, other.preferredBasePort) &&
_deepEquals(blockUnmatchedTraffic, other.blockUnmatchedTraffic) &&
_deepEquals(dnsConfig, other.dnsConfig) &&
_deepEquals(bootstrapDohUrl, other.bootstrapDohUrl);
}
@override
@@ -331,7 +333,8 @@ class SingboxProxyDnsServerConfig {
}
Object encode() {
return _toList(); }
return _toList();
}
static SingboxProxyDnsServerConfig decode(Object result) {
result as List<Object?>;
@@ -349,13 +352,20 @@ class SingboxProxyDnsServerConfig {
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! SingboxProxyDnsServerConfig || other.runtimeType != runtimeType) {
if (other is! SingboxProxyDnsServerConfig ||
other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(tag, other.tag) && _deepEquals(address, other.address) && _deepEquals(detourTag, other.detourTag) && _deepEquals(matchDomainSuffixes, other.matchDomainSuffixes) && _deepEquals(matchGeosites, other.matchGeosites) && _deepEquals(matchOutbounds, other.matchOutbounds) && _deepEquals(matchInbounds, other.matchInbounds);
return _deepEquals(tag, other.tag) &&
_deepEquals(address, other.address) &&
_deepEquals(detourTag, other.detourTag) &&
_deepEquals(matchDomainSuffixes, other.matchDomainSuffixes) &&
_deepEquals(matchGeosites, other.matchGeosites) &&
_deepEquals(matchOutbounds, other.matchOutbounds) &&
_deepEquals(matchInbounds, other.matchInbounds);
}
@override
@@ -385,20 +395,18 @@ class SingboxProxyDnsConfig {
String domainStrategy;
List<Object?> _toList() {
return <Object?>[
servers,
finalServerTag,
domainStrategy,
];
return <Object?>[servers, finalServerTag, domainStrategy];
}
Object encode() {
return _toList(); }
return _toList();
}
static SingboxProxyDnsConfig decode(Object result) {
result as List<Object?>;
return SingboxProxyDnsConfig(
servers: (result[0]! as List<Object?>).cast<SingboxProxyDnsServerConfig>(),
servers: (result[0]! as List<Object?>)
.cast<SingboxProxyDnsServerConfig>(),
finalServerTag: result[1] as String?,
domainStrategy: result[2]! as String,
);
@@ -413,7 +421,9 @@ class SingboxProxyDnsConfig {
if (identical(this, other)) {
return true;
}
return _deepEquals(servers, other.servers) && _deepEquals(finalServerTag, other.finalServerTag) && _deepEquals(domainStrategy, other.domainStrategy);
return _deepEquals(servers, other.servers) &&
_deepEquals(finalServerTag, other.finalServerTag) &&
_deepEquals(domainStrategy, other.domainStrategy);
}
@override
@@ -446,17 +456,12 @@ class SingboxProxyRuntimeEndpoint {
String password;
List<Object?> _toList() {
return <Object?>[
profileId,
host,
port,
username,
password,
];
return <Object?>[profileId, host, port, username, password];
}
Object encode() {
return _toList(); }
return _toList();
}
static SingboxProxyRuntimeEndpoint decode(Object result) {
result as List<Object?>;
@@ -472,13 +477,18 @@ class SingboxProxyRuntimeEndpoint {
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! SingboxProxyRuntimeEndpoint || other.runtimeType != runtimeType) {
if (other is! SingboxProxyRuntimeEndpoint ||
other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(profileId, other.profileId) && _deepEquals(host, other.host) && _deepEquals(port, other.port) && _deepEquals(username, other.username) && _deepEquals(password, other.password);
return _deepEquals(profileId, other.profileId) &&
_deepEquals(host, other.host) &&
_deepEquals(port, other.port) &&
_deepEquals(username, other.username) &&
_deepEquals(password, other.password);
}
@override
@@ -505,21 +515,19 @@ class SingboxProxyRuntimeState {
String? message;
List<Object?> _toList() {
return <Object?>[
status,
endpoints,
message,
];
return <Object?>[status, endpoints, message];
}
Object encode() {
return _toList(); }
return _toList();
}
static SingboxProxyRuntimeState decode(Object result) {
result as List<Object?>;
return SingboxProxyRuntimeState(
status: result[0]! as SingboxProxyRuntimeStatus,
endpoints: (result[1]! as List<Object?>).cast<SingboxProxyRuntimeEndpoint>(),
endpoints: (result[1]! as List<Object?>)
.cast<SingboxProxyRuntimeEndpoint>(),
message: result[2] as String?,
);
}
@@ -527,13 +535,16 @@ class SingboxProxyRuntimeState {
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! SingboxProxyRuntimeState || other.runtimeType != runtimeType) {
if (other is! SingboxProxyRuntimeState ||
other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(status, other.status) && _deepEquals(endpoints, other.endpoints) && _deepEquals(message, other.message);
return _deepEquals(status, other.status) &&
_deepEquals(endpoints, other.endpoints) &&
_deepEquals(message, other.message);
}
@override
@@ -547,43 +558,41 @@ class SingboxProxyRuntimeState {
}
class SingboxProxyConfigResult {
SingboxProxyConfigResult({
required this.configJson,
required this.endpoints,
});
SingboxProxyConfigResult({required this.configJson, required this.endpoints});
String configJson;
List<SingboxProxyRuntimeEndpoint> endpoints;
List<Object?> _toList() {
return <Object?>[
configJson,
endpoints,
];
return <Object?>[configJson, endpoints];
}
Object encode() {
return _toList(); }
return _toList();
}
static SingboxProxyConfigResult decode(Object result) {
result as List<Object?>;
return SingboxProxyConfigResult(
configJson: result[0]! as String,
endpoints: (result[1]! as List<Object?>).cast<SingboxProxyRuntimeEndpoint>(),
endpoints: (result[1]! as List<Object?>)
.cast<SingboxProxyRuntimeEndpoint>(),
);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! SingboxProxyConfigResult || other.runtimeType != runtimeType) {
if (other is! SingboxProxyConfigResult ||
other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(configJson, other.configJson) && _deepEquals(endpoints, other.endpoints);
return _deepEquals(configJson, other.configJson) &&
_deepEquals(endpoints, other.endpoints);
}
@override
@@ -613,16 +622,12 @@ class SingboxProxyLogMessage {
String? profileId;
List<Object?> _toList() {
return <Object?>[
level,
message,
timestamp,
profileId,
];
return <Object?>[level, message, timestamp, profileId];
}
Object encode() {
return _toList(); }
return _toList();
}
static SingboxProxyLogMessage decode(Object result) {
result as List<Object?>;
@@ -643,7 +648,10 @@ class SingboxProxyLogMessage {
if (identical(this, other)) {
return true;
}
return _deepEquals(level, other.level) && _deepEquals(message, other.message) && _deepEquals(timestamp, other.timestamp) && _deepEquals(profileId, other.profileId);
return _deepEquals(level, other.level) &&
_deepEquals(message, other.message) &&
_deepEquals(timestamp, other.timestamp) &&
_deepEquals(profileId, other.profileId);
}
@override
@@ -656,7 +664,6 @@ class SingboxProxyLogMessage {
}
}
class _PigeonCodec extends StandardMessageCodec {
const _PigeonCodec();
@override
@@ -734,9 +741,13 @@ class SingboxProxyApi {
/// Constructor for [SingboxProxyApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
SingboxProxyApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
: pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
SingboxProxyApi({
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) : pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
@@ -744,82 +755,97 @@ class SingboxProxyApi {
final String pigeonVar_messageChannelSuffix;
Future<String?> validateProfile(SingboxProxyProfile profile) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.validateProfile$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.validateProfile$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[profile]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[profile],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
return pigeonVar_replyValue as String?;
}
Future<SingboxProxyConfigResult> buildConfig(List<SingboxProxyProfile> profiles, SingboxProxyRuntimeOptions options) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.buildConfig$pigeonVar_messageChannelSuffix';
Future<SingboxProxyConfigResult> buildConfig(
List<SingboxProxyProfile> profiles,
SingboxProxyRuntimeOptions options,
) async {
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.buildConfig$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[profiles, options]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[profiles, options],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: false,
)
;
);
return pigeonVar_replyValue! as SingboxProxyConfigResult;
}
Future<SingboxProxyRuntimeState> start(List<SingboxProxyProfile> profiles, SingboxProxyRuntimeOptions options) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.start$pigeonVar_messageChannelSuffix';
Future<SingboxProxyRuntimeState> start(
List<SingboxProxyProfile> profiles,
SingboxProxyRuntimeOptions options,
) async {
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.start$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[profiles, options]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[profiles, options],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: false,
)
;
);
return pigeonVar_replyValue! as SingboxProxyRuntimeState;
}
Future<void> stop(List<String> profileIds) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.stop$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.stop$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[profileIds]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[profileIds],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
_extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
}
Future<void> stopAll() async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.stopAll$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.stopAll$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
@@ -832,12 +858,12 @@ class SingboxProxyApi {
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
}
Future<SingboxProxyRuntimeState> getState() async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.getState$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.getState$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
@@ -850,8 +876,7 @@ class SingboxProxyApi {
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: false,
)
;
);
return pigeonVar_replyValue! as SingboxProxyRuntimeState;
}
}
@@ -863,46 +888,62 @@ abstract class SingboxProxyEventsApi {
void onLogMessage(SingboxProxyLogMessage message);
static void setUp(SingboxProxyEventsApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) {
messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
static void setUp(
SingboxProxyEventsApi? api, {
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) {
messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
{
final pigeonVar_channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyEventsApi.onStateChanged$messageChannelSuffix', pigeonChannelCodec,
binaryMessenger: binaryMessenger);
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyEventsApi.onStateChanged$messageChannelSuffix',
pigeonChannelCodec,
binaryMessenger: binaryMessenger,
);
if (api == null) {
pigeonVar_channel.setMessageHandler(null);
} else {
pigeonVar_channel.setMessageHandler((Object? message) async {
final List<Object?> args = message! as List<Object?>;
final SingboxProxyRuntimeState arg_state = args[0]! as SingboxProxyRuntimeState;
final SingboxProxyRuntimeState arg_state =
args[0]! as SingboxProxyRuntimeState;
try {
api.onStateChanged(arg_state);
return wrapResponse(empty: true);
} on PlatformException catch (e) {
return wrapResponse(error: e);
} catch (e) {
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
return wrapResponse(
error: PlatformException(code: 'error', message: e.toString()),
);
}
});
}
}
{
final pigeonVar_channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyEventsApi.onLogMessage$messageChannelSuffix', pigeonChannelCodec,
binaryMessenger: binaryMessenger);
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyEventsApi.onLogMessage$messageChannelSuffix',
pigeonChannelCodec,
binaryMessenger: binaryMessenger,
);
if (api == null) {
pigeonVar_channel.setMessageHandler(null);
} else {
pigeonVar_channel.setMessageHandler((Object? message) async {
final List<Object?> args = message! as List<Object?>;
final SingboxProxyLogMessage arg_message = args[0]! as SingboxProxyLogMessage;
final SingboxProxyLogMessage arg_message =
args[0]! as SingboxProxyLogMessage;
try {
api.onLogMessage(arg_message);
return wrapResponse(empty: true);
} on PlatformException catch (e) {
return wrapResponse(error: e);
} catch (e) {
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
return wrapResponse(
error: PlatformException(code: 'error', message: e.toString()),
);
}
});
}
+95 -50
View File
@@ -34,8 +34,11 @@ Object? _extractReplyValueOrThrow(
return replyList.firstOrNull;
}
List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
List<Object?> wrapResponse({
Object? result,
PlatformException? error,
bool empty = false,
}) {
if (empty) {
return <Object?>[];
}
@@ -44,6 +47,7 @@ List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty
}
return <Object?>[error.code, error.message, error.details];
}
bool _deepEquals(Object? a, Object? b) {
if (identical(a, b)) {
return true;
@@ -56,8 +60,9 @@ bool _deepEquals(Object? a, Object? b) {
}
if (a is List && b is List) {
return a.length == b.length &&
a.indexed
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
a.indexed.every(
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
);
}
if (a is Map && b is Map) {
if (a.length != b.length) {
@@ -106,23 +111,29 @@ int _deepHash(Object? value) {
return value.hashCode;
}
/// Transport types for Tor connections
enum TransportType {
/// Direct Tor connection (no bridges)
none,
/// obfs4 pluggable transport
obfs4,
/// Snowflake pluggable transport (default broker)
snowflake,
/// Snowflake via AMP cache
snowflakeAmp,
/// Meek pluggable transport
meek,
/// Meek via Azure CDN
meekAzure,
/// WebTunnel pluggable transport
webtunnel,
/// Custom bridge lines (passthrough)
custom,
}
@@ -163,7 +174,8 @@ class TorConfiguration {
}
Object encode() {
return _toList(); }
return _toList();
}
static TorConfiguration decode(Object result) {
result as List<Object?>;
@@ -185,7 +197,11 @@ class TorConfiguration {
if (identical(this, other)) {
return true;
}
return _deepEquals(transport, other.transport) && _deepEquals(bridgeLines, other.bridgeLines) && _deepEquals(entryNodeCountries, other.entryNodeCountries) && _deepEquals(exitNodeCountries, other.exitNodeCountries) && _deepEquals(strictNodes, other.strictNodes);
return _deepEquals(transport, other.transport) &&
_deepEquals(bridgeLines, other.bridgeLines) &&
_deepEquals(entryNodeCountries, other.entryNodeCountries) &&
_deepEquals(exitNodeCountries, other.exitNodeCountries) &&
_deepEquals(strictNodes, other.strictNodes);
}
@override
@@ -234,7 +250,8 @@ class TorStatus {
}
Object encode() {
return _toList(); }
return _toList();
}
static TorStatus decode(Object result) {
result as List<Object?>;
@@ -256,7 +273,11 @@ class TorStatus {
if (identical(this, other)) {
return true;
}
return _deepEquals(isRunning, other.isRunning) && _deepEquals(socksPort, other.socksPort) && _deepEquals(bootstrapProgress, other.bootstrapProgress) && _deepEquals(currentCircuit, other.currentCircuit) && _deepEquals(exitNodeCountry, other.exitNodeCountry);
return _deepEquals(isRunning, other.isRunning) &&
_deepEquals(socksPort, other.socksPort) &&
_deepEquals(bootstrapProgress, other.bootstrapProgress) &&
_deepEquals(currentCircuit, other.currentCircuit) &&
_deepEquals(exitNodeCountry, other.exitNodeCountry);
}
@override
@@ -287,15 +308,12 @@ class TorLogMessage {
int timestamp;
List<Object?> _toList() {
return <Object?>[
severity,
message,
timestamp,
];
return <Object?>[severity, message, timestamp];
}
Object encode() {
return _toList(); }
return _toList();
}
static TorLogMessage decode(Object result) {
result as List<Object?>;
@@ -315,7 +333,9 @@ class TorLogMessage {
if (identical(this, other)) {
return true;
}
return _deepEquals(severity, other.severity) && _deepEquals(message, other.message) && _deepEquals(timestamp, other.timestamp);
return _deepEquals(severity, other.severity) &&
_deepEquals(message, other.message) &&
_deepEquals(timestamp, other.timestamp);
}
@override
@@ -328,7 +348,6 @@ class TorLogMessage {
}
}
class _PigeonCodec extends StandardMessageCodec {
const _PigeonCodec();
@override
@@ -378,7 +397,9 @@ class TorApi {
/// BinaryMessenger will be used which routes to the host platform.
TorApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
: pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
@@ -388,27 +409,30 @@ class TorApi {
/// Start Tor with the given configuration
/// Returns a Future to avoid blocking the main thread
Future<int> startTor(TorConfiguration config) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.TorApi.startTor$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_tor.TorApi.startTor$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[config]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[config],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: false,
)
;
);
return pigeonVar_replyValue! as int;
}
/// Stop Tor
Future<void> stopTor() async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.TorApi.stopTor$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_tor.TorApi.stopTor$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
@@ -421,13 +445,13 @@ class TorApi {
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
}
/// Get current status
Future<TorStatus> getStatus() async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.TorApi.getStatus$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_tor.TorApi.getStatus$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
@@ -440,14 +464,14 @@ class TorApi {
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: false,
)
;
);
return pigeonVar_replyValue! as TorStatus;
}
/// Request a new Tor identity (new circuit)
Future<void> requestNewIdentity() async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.TorApi.requestNewIdentity$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_tor.TorApi.requestNewIdentity$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
@@ -460,8 +484,7 @@ class TorApi {
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
}
}
@@ -475,12 +498,20 @@ abstract class TorLogApi {
/// Called when status changes
void onStatusChanged(TorStatus status);
static void setUp(TorLogApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) {
messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
static void setUp(
TorLogApi? api, {
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) {
messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
{
final pigeonVar_channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.flutter_tor.TorLogApi.onLogMessage$messageChannelSuffix', pigeonChannelCodec,
binaryMessenger: binaryMessenger);
'dev.flutter.pigeon.flutter_tor.TorLogApi.onLogMessage$messageChannelSuffix',
pigeonChannelCodec,
binaryMessenger: binaryMessenger,
);
if (api == null) {
pigeonVar_channel.setMessageHandler(null);
} else {
@@ -493,15 +524,19 @@ abstract class TorLogApi {
} on PlatformException catch (e) {
return wrapResponse(error: e);
} catch (e) {
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
return wrapResponse(
error: PlatformException(code: 'error', message: e.toString()),
);
}
});
}
}
{
final pigeonVar_channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.flutter_tor.TorLogApi.onStatusChanged$messageChannelSuffix', pigeonChannelCodec,
binaryMessenger: binaryMessenger);
'dev.flutter.pigeon.flutter_tor.TorLogApi.onStatusChanged$messageChannelSuffix',
pigeonChannelCodec,
binaryMessenger: binaryMessenger,
);
if (api == null) {
pigeonVar_channel.setMessageHandler(null);
} else {
@@ -514,7 +549,9 @@ abstract class TorLogApi {
} on PlatformException catch (e) {
return wrapResponse(error: e);
} catch (e) {
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
return wrapResponse(
error: PlatformException(code: 'error', message: e.toString()),
);
}
});
}
@@ -526,9 +563,13 @@ class IPtProxyController {
/// Constructor for [IPtProxyController]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
IPtProxyController({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
: pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
IPtProxyController({
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) : pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
@@ -536,39 +577,43 @@ class IPtProxyController {
final String pigeonVar_messageChannelSuffix;
Future<int> start(TransportType proxyType, String proxy) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.IPtProxyController.start$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_tor.IPtProxyController.start$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[proxyType, proxy]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[proxyType, proxy],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: false,
)
;
);
return pigeonVar_replyValue! as int;
}
Future<void> stop(TransportType proxyType) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.IPtProxyController.stop$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.flutter_tor.IPtProxyController.stop$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[proxyType]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[proxyType],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
_extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
}
}
@@ -46,8 +46,9 @@ bool _deepEquals(Object? a, Object? b) {
}
if (a is List && b is List) {
return a.length == b.length &&
a.indexed
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
a.indexed.every(
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
);
}
if (a is Map && b is Map) {
if (a.length != b.length) {
@@ -96,26 +97,20 @@ int _deepHash(Object? value) {
return value.hashCode;
}
class LocalizedResult {
LocalizedResult({
required this.languageName,
this.countryName,
});
LocalizedResult({required this.languageName, this.countryName});
String languageName;
String? countryName;
List<Object?> _toList() {
return <Object?>[
languageName,
countryName,
];
return <Object?>[languageName, countryName];
}
Object encode() {
return _toList(); }
return _toList();
}
static LocalizedResult decode(Object result) {
result as List<Object?>;
@@ -134,7 +129,8 @@ class LocalizedResult {
if (identical(this, other)) {
return true;
}
return _deepEquals(languageName, other.languageName) && _deepEquals(countryName, other.countryName);
return _deepEquals(languageName, other.languageName) &&
_deepEquals(countryName, other.countryName);
}
@override
@@ -147,7 +143,6 @@ class LocalizedResult {
}
}
class _PigeonCodec extends StandardMessageCodec {
const _PigeonCodec();
@override
@@ -178,31 +173,40 @@ class LocaleResolver {
/// Constructor for [LocaleResolver]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
LocaleResolver({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
: pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
LocaleResolver({
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) : pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
final String pigeonVar_messageChannelSuffix;
Future<LocalizedResult> resolve(String languageTag, String targetLangouageTag) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.locale_resolver.LocaleResolver.resolve$pigeonVar_messageChannelSuffix';
Future<LocalizedResult> resolve(
String languageTag,
String targetLangouageTag,
) async {
final pigeonVar_channelName =
'dev.flutter.pigeon.locale_resolver.LocaleResolver.resolve$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[languageTag, targetLangouageTag]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[languageTag, targetLangouageTag],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: false,
)
;
);
return pigeonVar_replyValue! as LocalizedResult;
}
}
@@ -34,8 +34,11 @@ Object? _extractReplyValueOrThrow(
return replyList.firstOrNull;
}
List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
List<Object?> wrapResponse({
Object? result,
PlatformException? error,
bool empty = false,
}) {
if (empty) {
return <Object?>[];
}
@@ -44,6 +47,7 @@ List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty
}
return <Object?>[error.code, error.message, error.details];
}
bool _deepEquals(Object? a, Object? b) {
if (identical(a, b)) {
return true;
@@ -56,8 +60,9 @@ bool _deepEquals(Object? a, Object? b) {
}
if (a is List && b is List) {
return a.length == b.length &&
a.indexed
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
a.indexed.every(
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
);
}
if (a is Map && b is Map) {
if (a.length != b.length) {
@@ -106,7 +111,6 @@ int _deepHash(Object? value) {
return value.hashCode;
}
class Intent {
Intent({
this.fromPackageName,
@@ -141,7 +145,8 @@ class Intent {
}
Object encode() {
return _toList(); }
return _toList();
}
static Intent decode(Object result) {
result as List<Object?>;
@@ -164,7 +169,12 @@ class Intent {
if (identical(this, other)) {
return true;
}
return _deepEquals(fromPackageName, other.fromPackageName) && _deepEquals(action, other.action) && _deepEquals(data, other.data) && _deepEquals(categories, other.categories) && _deepEquals(mimeType, other.mimeType) && _deepEquals(extra, other.extra);
return _deepEquals(fromPackageName, other.fromPackageName) &&
_deepEquals(action, other.action) &&
_deepEquals(data, other.data) &&
_deepEquals(categories, other.categories) &&
_deepEquals(mimeType, other.mimeType) &&
_deepEquals(extra, other.extra);
}
@override
@@ -177,7 +187,6 @@ class Intent {
}
}
class _PigeonCodec extends StandardMessageCodec {
const _PigeonCodec();
@override
@@ -208,9 +217,13 @@ class IntentHost {
/// Constructor for [IntentHost]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
IntentHost({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
: pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
IntentHost({
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) : pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
@@ -222,7 +235,8 @@ class IntentHost {
/// IntentEvents.setUp() was called (cold-start deep links).
/// Returns null if no launch intent is pending.
Future<Intent?> getInitialIntent() async {
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentHost.getInitialIntent$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.simple_intent_receiver.IntentHost.getInitialIntent$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
@@ -235,8 +249,7 @@ class IntentHost {
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
return pigeonVar_replyValue as Intent?;
}
}
@@ -246,12 +259,20 @@ abstract class IntentEvents {
void onIntentReceived(int sequence, Intent intent);
static void setUp(IntentEvents? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) {
messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
static void setUp(
IntentEvents? api, {
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) {
messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
{
final pigeonVar_channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.simple_intent_receiver.IntentEvents.onIntentReceived$messageChannelSuffix', pigeonChannelCodec,
binaryMessenger: binaryMessenger);
'dev.flutter.pigeon.simple_intent_receiver.IntentEvents.onIntentReceived$messageChannelSuffix',
pigeonChannelCodec,
binaryMessenger: binaryMessenger,
);
if (api == null) {
pigeonVar_channel.setMessageHandler(null);
} else {
@@ -265,7 +286,9 @@ abstract class IntentEvents {
} on PlatformException catch (e) {
return wrapResponse(error: e);
} catch (e) {
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
return wrapResponse(
error: PlatformException(code: 'error', message: e.toString()),
);
}
});
}
@@ -277,9 +300,13 @@ class IntentGatekeeperHostApi {
/// Constructor for [IntentGatekeeperHostApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
IntentGatekeeperHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
: pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
IntentGatekeeperHostApi({
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) : pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
@@ -289,21 +316,23 @@ class IntentGatekeeperHostApi {
/// Replicates the blocked-packages policy to the native side so the
/// [IntentReceiverActivity] can reject intents without launching Flutter.
Future<void> setConfig(bool enabled, List<String> blockedPackages) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.setConfig$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.setConfig$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[enabled, blockedPackages]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[enabled, blockedPackages],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
_extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
}
/// Replicates whether the Custom Tabs feature is enabled to the native side.
@@ -311,42 +340,46 @@ class IntentGatekeeperHostApi {
/// share-with-URL intents to the main browser instead of launching the
/// stripped-down custom-tab activity. Defaults to enabled on the native side.
Future<void> setCustomTabsEnabled(bool enabled) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.setCustomTabsEnabled$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.setCustomTabsEnabled$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[enabled]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[enabled],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
_extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
}
/// Resolves a package name to its user-visible application label via
/// [PackageManager]. Returns `null` if the package is not installed or the
/// label cannot be resolved.
Future<String?> resolvePackageLabel(String packageName) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.resolvePackageLabel$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.resolvePackageLabel$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[packageName]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[packageName],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
return pigeonVar_replyValue as String?;
}
@@ -356,7 +389,8 @@ class IntentGatekeeperHostApi {
/// [ackPendingAlwaysAllows] after Flutter settings were updated
/// successfully.
Future<List<String>> getPendingAlwaysAllows() async {
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.getPendingAlwaysAllows$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.getPendingAlwaysAllows$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
@@ -369,28 +403,29 @@ class IntentGatekeeperHostApi {
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: false,
)
;
);
return (pigeonVar_replyValue! as List<Object?>).cast<String>();
}
/// Removes the given packages from the pending "Always allow" set after
/// Flutter has successfully persisted them into its own policy store.
Future<void> ackPendingAlwaysAllows(List<String> packageNames) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.ackPendingAlwaysAllows$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.ackPendingAlwaysAllows$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[packageNames]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[packageNames],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
_extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: true,
)
;
);
}
}
@@ -34,8 +34,11 @@ Object? _extractReplyValueOrThrow(
return replyList.firstOrNull;
}
List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
List<Object?> wrapResponse({
Object? result,
PlatformException? error,
bool empty = false,
}) {
if (empty) {
return <Object?>[];
}
@@ -45,7 +48,6 @@ List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty
return <Object?>[error.code, error.message, error.details];
}
class _PigeonCodec extends StandardMessageCodec {
const _PigeonCodec();
@override
@@ -72,9 +74,13 @@ class SpeechToTextApi {
/// Constructor for [SpeechToTextApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
SpeechToTextApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
: pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
SpeechToTextApi({
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) : pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
@@ -89,21 +95,23 @@ class SpeechToTextApi {
/// The [locale] parameter specifies the language locale for recognition
/// (e.g., 'en-US', 'de-DE'). If null, uses the device default.
Future<bool> showDialog({String? locale}) async {
final pigeonVar_channelName = 'dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextApi.showDialog$pigeonVar_messageChannelSuffix';
final pigeonVar_channelName =
'dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextApi.showDialog$pigeonVar_messageChannelSuffix';
final pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[locale]);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
<Object?>[locale],
);
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
pigeonVar_replyList,
pigeonVar_channelName,
isNullValid: false,
)
;
);
return pigeonVar_replyValue! as bool;
}
}
@@ -118,12 +126,20 @@ abstract class SpeechToTextEvents {
/// recognition failed or was cancelled.
void onTextReceived(String text);
static void setUp(SpeechToTextEvents? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) {
messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
static void setUp(
SpeechToTextEvents? api, {
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) {
messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
{
final pigeonVar_channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextEvents.onTextReceived$messageChannelSuffix', pigeonChannelCodec,
binaryMessenger: binaryMessenger);
'dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextEvents.onTextReceived$messageChannelSuffix',
pigeonChannelCodec,
binaryMessenger: binaryMessenger,
);
if (api == null) {
pigeonVar_channel.setMessageHandler(null);
} else {
@@ -136,7 +152,9 @@ abstract class SpeechToTextEvents {
} on PlatformException catch (e) {
return wrapResponse(error: e);
} catch (e) {
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
return wrapResponse(
error: PlatformException(code: 'error', message: e.toString()),
);
}
});
}