upgrade flutter
This commit is contained in:
@@ -271,6 +271,10 @@
|
|||||||
android:name="io.flutter.embedding.android.EnableImpeller"
|
android:name="io.flutter.embedding.android.EnableImpeller"
|
||||||
android:value="false" />
|
android:value="false" />
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="io.flutter.embedding.android.EnableHcpp"
|
||||||
|
android:value="true" />
|
||||||
|
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
<meta-data
|
<meta-data
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
|
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
# This builtInKotlin flag was added automatically by Flutter migrator
|
||||||
|
android.builtInKotlin=false
|
||||||
|
# This newDsl flag was added automatically by Flutter migrator
|
||||||
|
android.newDsl=false
|
||||||
|
|||||||
@@ -21,28 +21,54 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:drift/drift.dart';
|
import 'package:drift/drift.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
final Map<String, IconData> _mdiIconsByName = Map.unmodifiable({
|
||||||
|
for (final iconData in MdiIcons.values)
|
||||||
|
if (iconData.mdiMetadata case final metadata?) metadata.name: iconData,
|
||||||
|
});
|
||||||
|
|
||||||
|
final Map<int, IconData> _mdiIconsByCodePoint = Map.unmodifiable({
|
||||||
|
for (final iconData in MdiIcons.values) iconData.codePoint: iconData,
|
||||||
|
});
|
||||||
|
|
||||||
class IconDataJsonConverter
|
class IconDataJsonConverter
|
||||||
implements JsonConverter<IconData, Map<String, dynamic>> {
|
implements JsonConverter<IconData, Map<String, dynamic>> {
|
||||||
const IconDataJsonConverter();
|
const IconDataJsonConverter();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
IconData fromJson(Map<String, dynamic> json) {
|
IconData fromJson(Map<String, dynamic> json) {
|
||||||
return IconData(
|
if (json['name'] case final String name) {
|
||||||
json['codePoint'] as int,
|
final iconData = _mdiIconsByName[name];
|
||||||
fontFamily: json['fontFamily'] as String?,
|
if (iconData != null) {
|
||||||
fontPackage: json['fontPackage'] as String?,
|
return iconData;
|
||||||
);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final codePoint = json['codePoint'];
|
||||||
|
if (codePoint is int) {
|
||||||
|
final iconData = _mdiIconsByCodePoint[codePoint];
|
||||||
|
if (iconData != null) {
|
||||||
|
return iconData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw FormatException('Unknown MDI icon data: $json');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Map<String, dynamic> toJson(IconData iconData) {
|
Map<String, dynamic> toJson(IconData iconData) {
|
||||||
return <String, dynamic>{
|
final metadata = iconData.mdiMetadata;
|
||||||
'codePoint': iconData.codePoint,
|
if (metadata == null) {
|
||||||
'fontFamily': iconData.fontFamily,
|
throw ArgumentError.value(
|
||||||
'fontPackage': iconData.fontPackage,
|
iconData,
|
||||||
};
|
'iconData',
|
||||||
|
'Icon is not an MDI icon',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return <String, dynamic>{'name': metadata.name};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,11 +83,6 @@ class IconDataTypeConverter implements TypeConverter<IconData, String> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String toSql(IconData value) {
|
String toSql(IconData value) {
|
||||||
assert(
|
|
||||||
value.fontFamily != null,
|
|
||||||
'Font family must be provided to identify icon',
|
|
||||||
);
|
|
||||||
|
|
||||||
return jsonEncode(const IconDataJsonConverter().toJson(value));
|
return jsonEncode(const IconDataJsonConverter().toJson(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import 'package:drift/drift.dart';
|
|||||||
import 'package:drift/native.dart';
|
import 'package:drift/native.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
|
|
||||||
import 'package:weblibre/core/database_registry.dart';
|
import 'package:weblibre/core/database_registry.dart';
|
||||||
import 'package:weblibre/core/filesystem.dart';
|
import 'package:weblibre/core/filesystem.dart';
|
||||||
import 'package:weblibre/features/bangs/data/database/database.dart';
|
import 'package:weblibre/features/bangs/data/database/database.dart';
|
||||||
@@ -33,14 +32,9 @@ part 'providers.g.dart';
|
|||||||
@Riverpod(keepAlive: true)
|
@Riverpod(keepAlive: true)
|
||||||
BangDatabase bangDatabase(Ref ref) {
|
BangDatabase bangDatabase(Ref ref) {
|
||||||
final db = BangDatabase(
|
final db = BangDatabase(
|
||||||
LazyDatabase(() async {
|
LazyDatabase(() {
|
||||||
final file = File(p.join(filesystem.profileDatabasesDir.path, 'bang.db'));
|
final file = File(p.join(filesystem.profileDatabasesDir.path, 'bang.db'));
|
||||||
|
|
||||||
// Also work around limitations on old Android versions
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NativeDatabase.createInBackground(file);
|
return NativeDatabase.createInBackground(file);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ final class BangDatabaseProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$bangDatabaseHash() => r'0369d508def140a32c08c0551cefed57b1ca4b26';
|
String _$bangDatabaseHash() => r'89fc1c6fe4100d32a50314ac8ab98af2eba96cfd';
|
||||||
|
|||||||
+1
-5
@@ -56,11 +56,7 @@ TabViewReorderResult? buildTabViewReorderResult({
|
|||||||
final reordered = visibleItems.toList();
|
final reordered = visibleItems.toList();
|
||||||
final movingItem = reordered.removeAt(oldIndex);
|
final movingItem = reordered.removeAt(oldIndex);
|
||||||
|
|
||||||
var insertIndex = newIndex;
|
final insertIndex = newIndex.clamp(0, reordered.length);
|
||||||
if (insertIndex > oldIndex) {
|
|
||||||
insertIndex -= 1;
|
|
||||||
}
|
|
||||||
insertIndex = insertIndex.clamp(0, reordered.length);
|
|
||||||
reordered.insert(insertIndex, movingItem);
|
reordered.insert(insertIndex, movingItem);
|
||||||
|
|
||||||
if (!hierarchical) {
|
if (!hierarchical) {
|
||||||
|
|||||||
+1
-1
@@ -432,7 +432,7 @@ class _TabListView extends HookConsumerWidget {
|
|||||||
onReorderStart: (index) {
|
onReorderStart: (index) {
|
||||||
ref.read(willAcceptDropProvider.notifier).clear();
|
ref.read(willAcceptDropProvider.notifier).clear();
|
||||||
},
|
},
|
||||||
onReorder: (oldIndex, newIndex) async {
|
onReorderItem: (oldIndex, newIndex) async {
|
||||||
//Suggestions are at the end and not reorderable, so skip
|
//Suggestions are at the end and not reorderable, so skip
|
||||||
if (oldIndex >= primaryRows.length) {
|
if (oldIndex >= primaryRows.length) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
+1
-2
@@ -77,8 +77,7 @@ class SearchModuleOrder extends _$SearchModuleOrder {
|
|||||||
void reorder(int oldIndex, int newIndex) {
|
void reorder(int oldIndex, int newIndex) {
|
||||||
final list = [...state];
|
final list = [...state];
|
||||||
final item = list.removeAt(oldIndex);
|
final item = list.removeAt(oldIndex);
|
||||||
final insertIndex = newIndex > oldIndex ? newIndex - 1 : newIndex;
|
list.insert(newIndex, item);
|
||||||
list.insert(insertIndex, item);
|
|
||||||
state = list;
|
state = list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -93,7 +93,7 @@ final class SearchModuleOrderProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$searchModuleOrderHash() => r'245c933174b1808b2cb27c4c375fac4edd12d727';
|
String _$searchModuleOrderHash() => r'fde46e0a0998152340801cb323335a2f4a0f3557';
|
||||||
|
|
||||||
final class SearchModuleOrderFamily extends $Family
|
final class SearchModuleOrderFamily extends $Family
|
||||||
with
|
with
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ class SearchModuleReorderView extends ConsumerWidget {
|
|||||||
),
|
),
|
||||||
SliverReorderableList(
|
SliverReorderableList(
|
||||||
itemCount: entries.length,
|
itemCount: entries.length,
|
||||||
onReorder: (oldIndex, newIndex) {
|
onReorderItem: (oldIndex, newIndex) {
|
||||||
ref
|
ref
|
||||||
.read(searchModuleOrderProvider(group).notifier)
|
.read(searchModuleOrderProvider(group).notifier)
|
||||||
.reorder(oldIndex, newIndex);
|
.reorder(oldIndex, newIndex);
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import 'package:drift/drift.dart';
|
|||||||
import 'package:drift/native.dart';
|
import 'package:drift/native.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
|
|
||||||
import 'package:weblibre/core/database_registry.dart';
|
import 'package:weblibre/core/database_registry.dart';
|
||||||
import 'package:weblibre/core/filesystem.dart';
|
import 'package:weblibre/core/filesystem.dart';
|
||||||
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
|
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
|
||||||
@@ -35,14 +34,9 @@ part 'providers.g.dart';
|
|||||||
@Riverpod(keepAlive: true)
|
@Riverpod(keepAlive: true)
|
||||||
TabDatabase tabDatabase(Ref ref) {
|
TabDatabase tabDatabase(Ref ref) {
|
||||||
final db = TabDatabase(
|
final db = TabDatabase(
|
||||||
LazyDatabase(() async {
|
LazyDatabase(() {
|
||||||
final file = File(p.join(filesystem.profileDatabasesDir.path, 'tab.db'));
|
final file = File(p.join(filesystem.profileDatabasesDir.path, 'tab.db'));
|
||||||
|
|
||||||
// Also work around limitations on old Android versions
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NativeDatabase.createInBackground(
|
return NativeDatabase.createInBackground(
|
||||||
file,
|
file,
|
||||||
setup: (database) {
|
setup: (database) {
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ final class TabDatabaseProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$tabDatabaseHash() => r'983f15b87d8d8bdd52b45d79fe78a1cb4b241f6e';
|
String _$tabDatabaseHash() => r'f850fbe52b2c68c801040c89cf48cadc04a9a6cc';
|
||||||
|
|||||||
+1
-5
@@ -216,11 +216,7 @@ class ContainerRepository extends _$ContainerRepository {
|
|||||||
) async {
|
) async {
|
||||||
if (containers.isEmpty || oldIndex == newIndex) return;
|
if (containers.isEmpty || oldIndex == newIndex) return;
|
||||||
|
|
||||||
var targetIndex = newIndex;
|
final targetIndex = newIndex.clamp(0, containers.length - 1);
|
||||||
if (targetIndex > oldIndex) {
|
|
||||||
targetIndex -= 1;
|
|
||||||
}
|
|
||||||
targetIndex = targetIndex.clamp(0, containers.length - 1);
|
|
||||||
if (targetIndex == oldIndex) return;
|
if (targetIndex == oldIndex) return;
|
||||||
|
|
||||||
final movingContainer = containers[oldIndex];
|
final movingContainer = containers[oldIndex];
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ final class ContainerRepositoryProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
String _$containerRepositoryHash() =>
|
String _$containerRepositoryHash() =>
|
||||||
r'8db0f2a08ee5a67123f9c110ef7edf4c574992c4';
|
r'14c77b4f3ed21d9511d5bf507db013b02a122595';
|
||||||
|
|
||||||
abstract class _$ContainerRepository extends $Notifier<void> {
|
abstract class _$ContainerRepository extends $Notifier<void> {
|
||||||
void build();
|
void build();
|
||||||
|
|||||||
+1
-1
@@ -85,7 +85,7 @@ class ContainerListScreen extends HookConsumerWidget {
|
|||||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 96),
|
padding: const EdgeInsets.fromLTRB(16, 8, 16, 96),
|
||||||
sliver: SliverReorderableList(
|
sliver: SliverReorderableList(
|
||||||
itemCount: containers.length,
|
itemCount: containers.length,
|
||||||
onReorder: (oldIndex, newIndex) {
|
onReorderItem: (oldIndex, newIndex) {
|
||||||
unawaited(
|
unawaited(
|
||||||
repository.reorderContainer(containers, oldIndex, newIndex),
|
repository.reorderContainer(containers, oldIndex, newIndex),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import 'package:drift/drift.dart';
|
|||||||
import 'package:drift/native.dart';
|
import 'package:drift/native.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
|
|
||||||
import 'package:weblibre/core/database_registry.dart';
|
import 'package:weblibre/core/database_registry.dart';
|
||||||
import 'package:weblibre/core/filesystem.dart';
|
import 'package:weblibre/core/filesystem.dart';
|
||||||
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
|
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
|
||||||
@@ -34,15 +33,11 @@ part 'providers.g.dart';
|
|||||||
@Riverpod(keepAlive: true)
|
@Riverpod(keepAlive: true)
|
||||||
TopSiteDatabase topSiteDatabase(Ref ref) {
|
TopSiteDatabase topSiteDatabase(Ref ref) {
|
||||||
final db = TopSiteDatabase(
|
final db = TopSiteDatabase(
|
||||||
LazyDatabase(() async {
|
LazyDatabase(() {
|
||||||
final file = File(
|
final file = File(
|
||||||
p.join(filesystem.profileDatabasesDir.path, 'top_site.db'),
|
p.join(filesystem.profileDatabasesDir.path, 'top_site.db'),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NativeDatabase.createInBackground(
|
return NativeDatabase.createInBackground(
|
||||||
file,
|
file,
|
||||||
setup: (database) {
|
setup: (database) {
|
||||||
|
|||||||
@@ -49,4 +49,4 @@ final class TopSiteDatabaseProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$topSiteDatabaseHash() => r'a5afe9a807174ae3382931612b25f959efccdded';
|
String _$topSiteDatabaseHash() => r'1bba4ea77ccd1e5f32717ac9875796216db77706';
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Future<bool> ensureProxyStartedForContainer(
|
|||||||
BuildContext context,
|
BuildContext context,
|
||||||
WidgetRef ref,
|
WidgetRef ref,
|
||||||
ContainerData container,
|
ContainerData container,
|
||||||
) async {
|
) {
|
||||||
return ensureProxyStartedForConnection(
|
return ensureProxyStartedForConnection(
|
||||||
context,
|
context,
|
||||||
ref,
|
ref,
|
||||||
@@ -117,6 +117,9 @@ Future<bool> _maybeStartSingboxProxy(
|
|||||||
ref,
|
ref,
|
||||||
proxyConnectionId,
|
proxyConnectionId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!context.mounted) return false;
|
||||||
|
|
||||||
final shouldStart = await showDialog<bool>(
|
final shouldStart = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import 'package:drift/native.dart';
|
|||||||
import 'package:flutter/services.dart' show rootBundle;
|
import 'package:flutter/services.dart' show rootBundle;
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
|
|
||||||
import 'package:weblibre/core/database_registry.dart';
|
import 'package:weblibre/core/database_registry.dart';
|
||||||
import 'package:weblibre/core/filesystem.dart';
|
import 'package:weblibre/core/filesystem.dart';
|
||||||
import 'package:weblibre/features/quotes/data/database/database.dart';
|
import 'package:weblibre/features/quotes/data/database/database.dart';
|
||||||
@@ -51,10 +50,6 @@ QuotesDatabase quotesDatabase(Ref ref) {
|
|||||||
flush: true,
|
flush: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NativeDatabase.createInBackground(file);
|
return NativeDatabase.createInBackground(file);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ final class QuotesDatabaseProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$quotesDatabaseHash() => r'14491e3de1a188138b329776e1f4d83101b2ba13';
|
String _$quotesDatabaseHash() => r'4f30fb578102516febbd6c56ca53051dd34e84bb';
|
||||||
|
|||||||
+3
-7
@@ -120,7 +120,7 @@ class ContextualToolbarSettingsScreen extends HookConsumerWidget {
|
|||||||
else
|
else
|
||||||
SliverReorderableList(
|
SliverReorderableList(
|
||||||
itemCount: visibleConfigs.length,
|
itemCount: visibleConfigs.length,
|
||||||
onReorder: (oldIndex, newIndex) => _onReorder(
|
onReorderItem: (oldIndex, newIndex) => _onReorder(
|
||||||
visibleConfigs,
|
visibleConfigs,
|
||||||
oldIndex,
|
oldIndex,
|
||||||
newIndex,
|
newIndex,
|
||||||
@@ -158,7 +158,7 @@ class ContextualToolbarSettingsScreen extends HookConsumerWidget {
|
|||||||
else
|
else
|
||||||
SliverReorderableList(
|
SliverReorderableList(
|
||||||
itemCount: hiddenConfigs.length,
|
itemCount: hiddenConfigs.length,
|
||||||
onReorder: (oldIndex, newIndex) => _onReorder(
|
onReorderItem: (oldIndex, newIndex) => _onReorder(
|
||||||
hiddenConfigs,
|
hiddenConfigs,
|
||||||
oldIndex,
|
oldIndex,
|
||||||
newIndex,
|
newIndex,
|
||||||
@@ -185,11 +185,7 @@ class ContextualToolbarSettingsScreen extends HookConsumerWidget {
|
|||||||
int oldIndex,
|
int oldIndex,
|
||||||
int newIndex,
|
int newIndex,
|
||||||
) {
|
) {
|
||||||
var targetIndex = newIndex;
|
final targetIndex = newIndex.clamp(0, configs.length - 1);
|
||||||
if (targetIndex > oldIndex) {
|
|
||||||
targetIndex -= 1;
|
|
||||||
}
|
|
||||||
targetIndex = targetIndex.clamp(0, configs.length - 1);
|
|
||||||
return (movedId: configs[oldIndex].buttonId, targetIndex: targetIndex);
|
return (movedId: configs[oldIndex].buttonId, targetIndex: targetIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import 'package:drift/native.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
|
|
||||||
import 'package:weblibre/core/database_registry.dart';
|
import 'package:weblibre/core/database_registry.dart';
|
||||||
import 'package:weblibre/core/filesystem.dart';
|
import 'package:weblibre/core/filesystem.dart';
|
||||||
import 'package:weblibre/features/small_web/data/database/database.dart';
|
import 'package:weblibre/features/small_web/data/database/database.dart';
|
||||||
@@ -36,15 +35,11 @@ part 'providers.g.dart';
|
|||||||
@Riverpod(keepAlive: true)
|
@Riverpod(keepAlive: true)
|
||||||
SmallWebDatabase smallWebDatabase(Ref ref) {
|
SmallWebDatabase smallWebDatabase(Ref ref) {
|
||||||
final db = SmallWebDatabase(
|
final db = SmallWebDatabase(
|
||||||
LazyDatabase(() async {
|
LazyDatabase(() {
|
||||||
final file = File(
|
final file = File(
|
||||||
p.join(filesystem.profileDatabasesDir.path, 'small_web.db'),
|
p.join(filesystem.profileDatabasesDir.path, 'small_web.db'),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NativeDatabase.createInBackground(file);
|
return NativeDatabase.createInBackground(file);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ final class SmallWebDatabaseProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$smallWebDatabaseHash() => r'e199e8c1261e8152110fb99f883fed1e550ffdc6';
|
String _$smallWebDatabaseHash() => r'4c514677f7944612515ccadfe8ad7ec3a9075f3f';
|
||||||
|
|
||||||
@ProviderFor(kagiCategories)
|
@ProviderFor(kagiCategories)
|
||||||
final kagiCategoriesProvider = KagiCategoriesProvider._();
|
final kagiCategoriesProvider = KagiCategoriesProvider._();
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import 'package:drift/native.dart';
|
|||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:riverpod/experimental/persist.dart';
|
import 'package:riverpod/experimental/persist.dart';
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
|
|
||||||
import 'package:weblibre/core/database_registry.dart';
|
import 'package:weblibre/core/database_registry.dart';
|
||||||
import 'package:weblibre/core/filesystem.dart';
|
import 'package:weblibre/core/filesystem.dart';
|
||||||
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
|
import 'package:weblibre/data/database/functions/lexo_rank_functions.dart';
|
||||||
@@ -36,14 +35,9 @@ part 'providers.g.dart';
|
|||||||
@Riverpod(keepAlive: true)
|
@Riverpod(keepAlive: true)
|
||||||
UserDatabase userDatabase(Ref ref) {
|
UserDatabase userDatabase(Ref ref) {
|
||||||
final db = UserDatabase(
|
final db = UserDatabase(
|
||||||
LazyDatabase(() async {
|
LazyDatabase(() {
|
||||||
final file = File(p.join(filesystem.profileDatabasesDir.path, 'user.db'));
|
final file = File(p.join(filesystem.profileDatabasesDir.path, 'user.db'));
|
||||||
|
|
||||||
// Also work around limitations on old Android versions
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NativeDatabase.createInBackground(
|
return NativeDatabase.createInBackground(
|
||||||
file,
|
file,
|
||||||
setup: (database) {
|
setup: (database) {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ final class UserDatabaseProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$userDatabaseHash() => r'05386a087a53dedd5f51859f45eb93ecf449c3c4';
|
String _$userDatabaseHash() => r'6751fe70be0d590d529e99b44140076174122acc';
|
||||||
|
|
||||||
@ProviderFor(riverpodDatabaseStorage)
|
@ProviderFor(riverpodDatabaseStorage)
|
||||||
final riverpodDatabaseStorageProvider = RiverpodDatabaseStorageProvider._();
|
final riverpodDatabaseStorageProvider = RiverpodDatabaseStorageProvider._();
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import 'package:drift/drift.dart';
|
|||||||
import 'package:drift/native.dart';
|
import 'package:drift/native.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||||
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
|
|
||||||
import 'package:weblibre/core/database_registry.dart';
|
import 'package:weblibre/core/database_registry.dart';
|
||||||
import 'package:weblibre/core/filesystem.dart';
|
import 'package:weblibre/core/filesystem.dart';
|
||||||
import 'package:weblibre/features/web_feed/data/database/database.dart';
|
import 'package:weblibre/features/web_feed/data/database/database.dart';
|
||||||
@@ -33,14 +32,9 @@ part 'providers.g.dart';
|
|||||||
@Riverpod(keepAlive: true)
|
@Riverpod(keepAlive: true)
|
||||||
FeedDatabase feedDatabase(Ref ref) {
|
FeedDatabase feedDatabase(Ref ref) {
|
||||||
final db = FeedDatabase(
|
final db = FeedDatabase(
|
||||||
LazyDatabase(() async {
|
LazyDatabase(() {
|
||||||
final file = File(p.join(filesystem.profileDatabasesDir.path, 'feed.db'));
|
final file = File(p.join(filesystem.profileDatabasesDir.path, 'feed.db'));
|
||||||
|
|
||||||
// Also work around limitations on old Android versions
|
|
||||||
if (Platform.isAndroid) {
|
|
||||||
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
|
|
||||||
}
|
|
||||||
|
|
||||||
return NativeDatabase.createInBackground(file);
|
return NativeDatabase.createInBackground(file);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ final class FeedDatabaseProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String _$feedDatabaseHash() => r'1ecae87a3de5b2d43136fdb73411727b0b217621';
|
String _$feedDatabaseHash() => r'393798ca8a5c04a9a8fdb7e864552542024b9456';
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ dependencies:
|
|||||||
crypto: ^3.0.7
|
crypto: ^3.0.7
|
||||||
cryptography_flutter: ^2.3.4
|
cryptography_flutter: ^2.3.4
|
||||||
device_info_plus: ^13.1.0
|
device_info_plus: ^13.1.0
|
||||||
drift: ^2.31.0
|
drift: ^2.33.0
|
||||||
drift_dev: ^2.31.0
|
drift_dev: ^2.33.0
|
||||||
dynamic_color: ^1.8.1
|
dynamic_color: ^1.8.1
|
||||||
exceptions: ^0.6.1
|
exceptions: ^0.6.1
|
||||||
fading_scroll: ^0.9.1
|
fading_scroll: ^0.9.1
|
||||||
@@ -35,7 +35,7 @@ dependencies:
|
|||||||
flutter_mozilla_components:
|
flutter_mozilla_components:
|
||||||
path: ../../packages/flutter_mozilla_components
|
path: ../../packages/flutter_mozilla_components
|
||||||
flutter_reorderable_grid_view: ^5.6.0
|
flutter_reorderable_grid_view: ^5.6.0
|
||||||
flutter_secure_storage: ^10.2.0
|
flutter_secure_storage: ^10.3.0
|
||||||
flutter_singbox_proxy:
|
flutter_singbox_proxy:
|
||||||
path: ../../packages/flutter_singbox_proxy
|
path: ../../packages/flutter_singbox_proxy
|
||||||
flutter_slidable: ^4.0.3
|
flutter_slidable: ^4.0.3
|
||||||
@@ -50,7 +50,7 @@ dependencies:
|
|||||||
html: ^0.15.6
|
html: ^0.15.6
|
||||||
http: ^1.6.0
|
http: ^1.6.0
|
||||||
intl: ^0.20.2
|
intl: ^0.20.2
|
||||||
json_annotation: ^4.11.0
|
json_annotation: ^4.12.0
|
||||||
lexo_rank:
|
lexo_rank:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/FaFre/lexo_rank.git
|
url: https://github.com/FaFre/lexo_rank.git
|
||||||
@@ -104,8 +104,7 @@ dependencies:
|
|||||||
socks5_proxy: ^2.1.1
|
socks5_proxy: ^2.1.1
|
||||||
speech_to_text_dialog:
|
speech_to_text_dialog:
|
||||||
path: ../../packages/speech_to_text_dialog
|
path: ../../packages/speech_to_text_dialog
|
||||||
sqlite3: ^2.9.4
|
sqlite3: ^3.3.1
|
||||||
sqlite3_flutter_libs: "0.5.41"
|
|
||||||
supabase: ^2.10.6
|
supabase: ^2.10.6
|
||||||
synchronized: ^3.4.0+1
|
synchronized: ^3.4.0+1
|
||||||
text_scroll: ^0.2.1
|
text_scroll: ^0.2.1
|
||||||
@@ -125,10 +124,10 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
go_router_builder: ^4.3.0
|
go_router_builder: ^4.3.0
|
||||||
json_serializable: ^6.13.0
|
json_serializable: ^6.14.0
|
||||||
lint: ^2.8.0
|
lint: ^2.8.0
|
||||||
mockito: ^5.6.4
|
mockito: ^5.6.4
|
||||||
riverpod_generator: ^4.0.3
|
riverpod_generator: ^4.0.4-dev.1
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
|
|||||||
+27
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:weblibre/features/geckoview/features/tabs/data/models/container_data.dart';
|
import 'package:weblibre/features/geckoview/features/tabs/data/models/container_data.dart';
|
||||||
import 'package:weblibre/features/proxy/data/proxy_connection.dart';
|
import 'package:weblibre/features/proxy/data/proxy_connection.dart';
|
||||||
@@ -30,4 +31,30 @@ void main() {
|
|||||||
expect(tor.usesTorProxy, isTrue);
|
expect(tor.usesTorProxy, isTrue);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
group('ContainerMetadata icon serialization', () {
|
||||||
|
test('stores MDI icon names', () {
|
||||||
|
final metadata = ContainerMetadata.withDefaults(
|
||||||
|
iconData: MdiIcons.folderOutline,
|
||||||
|
);
|
||||||
|
|
||||||
|
final json = metadata.toJson();
|
||||||
|
final restored = ContainerMetadata.fromJson(json);
|
||||||
|
|
||||||
|
expect(json['iconData'], <String, dynamic>{'name': 'folder-outline'});
|
||||||
|
expect(restored.iconData, MdiIcons.folderOutline);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('restores legacy code point JSON as a const MDI icon', () {
|
||||||
|
final restored = ContainerMetadata.fromJson({
|
||||||
|
'iconData': <String, dynamic>{
|
||||||
|
'codePoint': MdiIcons.folderOutline.codePoint,
|
||||||
|
'fontFamily': MdiIcons.folderOutline.fontFamily,
|
||||||
|
'fontPackage': MdiIcons.folderOutline.fontPackage,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(identical(restored.iconData, MdiIcons.folderOutline), isTrue);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ class FlutterError (
|
|||||||
val code: String,
|
val code: String,
|
||||||
override val message: String? = null,
|
override val message: String? = null,
|
||||||
val details: Any? = null
|
val details: Any? = null
|
||||||
) : Throwable()
|
) : RuntimeException()
|
||||||
|
|
||||||
/** Indicates what location the tabs should be restored at */
|
/** Indicates what location the tabs should be restored at */
|
||||||
enum class RestoreLocation(val raw: Int) {
|
enum class RestoreLocation(val raw: Int) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
lint: ^2.8.0
|
lint: ^2.8.0
|
||||||
pigeon: ^26.3.2
|
pigeon: ^26.3.4
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ class FlutterError (
|
|||||||
val code: String,
|
val code: String,
|
||||||
override val message: String? = null,
|
override val message: String? = null,
|
||||||
val details: Any? = null
|
val details: Any? = null
|
||||||
) : Throwable()
|
) : RuntimeException()
|
||||||
|
|
||||||
enum class SingboxProxyProfileType(val raw: Int) {
|
enum class SingboxProxyProfileType(val raw: Int) {
|
||||||
SOCKS(0),
|
SOCKS(0),
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
// ignore_for_file: unused_import, unused_shown_name
|
// ignore_for_file: unused_import, unused_shown_name
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
@@ -34,11 +34,8 @@ Object? _extractReplyValueOrThrow(
|
|||||||
return replyList.firstOrNull;
|
return replyList.firstOrNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Object?> wrapResponse({
|
|
||||||
Object? result,
|
List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
|
||||||
PlatformException? error,
|
|
||||||
bool empty = false,
|
|
||||||
}) {
|
|
||||||
if (empty) {
|
if (empty) {
|
||||||
return <Object?>[];
|
return <Object?>[];
|
||||||
}
|
}
|
||||||
@@ -47,7 +44,6 @@ List<Object?> wrapResponse({
|
|||||||
}
|
}
|
||||||
return <Object?>[error.code, error.message, error.details];
|
return <Object?>[error.code, error.message, error.details];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _deepEquals(Object? a, Object? b) {
|
bool _deepEquals(Object? a, Object? b) {
|
||||||
if (identical(a, b)) {
|
if (identical(a, b)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -60,9 +56,8 @@ bool _deepEquals(Object? a, Object? b) {
|
|||||||
}
|
}
|
||||||
if (a is List && b is List) {
|
if (a is List && b is List) {
|
||||||
return a.length == b.length &&
|
return a.length == b.length &&
|
||||||
a.indexed.every(
|
a.indexed
|
||||||
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
|
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (a is Map && b is Map) {
|
if (a is Map && b is Map) {
|
||||||
if (a.length != b.length) {
|
if (a.length != b.length) {
|
||||||
@@ -111,6 +106,7 @@ int _deepHash(Object? value) {
|
|||||||
return value.hashCode;
|
return value.hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
enum SingboxProxyProfileType {
|
enum SingboxProxyProfileType {
|
||||||
socks,
|
socks,
|
||||||
http,
|
http,
|
||||||
@@ -129,7 +125,13 @@ enum SingboxProxyProfileType {
|
|||||||
customOutbound,
|
customOutbound,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SingboxProxyRuntimeStatus { stopped, starting, running, stopping, error }
|
enum SingboxProxyRuntimeStatus {
|
||||||
|
stopped,
|
||||||
|
starting,
|
||||||
|
running,
|
||||||
|
stopping,
|
||||||
|
error,
|
||||||
|
}
|
||||||
|
|
||||||
class SingboxProxyProfile {
|
class SingboxProxyProfile {
|
||||||
SingboxProxyProfile({
|
SingboxProxyProfile({
|
||||||
@@ -155,12 +157,17 @@ class SingboxProxyProfile {
|
|||||||
String? secretJson;
|
String? secretJson;
|
||||||
|
|
||||||
List<Object?> _toList() {
|
List<Object?> _toList() {
|
||||||
return <Object?>[id, name, type, configJson, secretJson];
|
return <Object?>[
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
type,
|
||||||
|
configJson,
|
||||||
|
secretJson,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static SingboxProxyProfile decode(Object result) {
|
static SingboxProxyProfile decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -182,11 +189,7 @@ class SingboxProxyProfile {
|
|||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(id, other.id) &&
|
return _deepEquals(id, other.id) && _deepEquals(name, other.name) && _deepEquals(type, other.type) && _deepEquals(configJson, other.configJson) && _deepEquals(secretJson, other.secretJson);
|
||||||
_deepEquals(name, other.name) &&
|
|
||||||
_deepEquals(type, other.type) &&
|
|
||||||
_deepEquals(configJson, other.configJson) &&
|
|
||||||
_deepEquals(secretJson, other.secretJson);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -231,8 +234,7 @@ class SingboxProxyRuntimeOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static SingboxProxyRuntimeOptions decode(Object result) {
|
static SingboxProxyRuntimeOptions decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -247,17 +249,13 @@ class SingboxProxyRuntimeOptions {
|
|||||||
@override
|
@override
|
||||||
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
if (other is! SingboxProxyRuntimeOptions ||
|
if (other is! SingboxProxyRuntimeOptions || other.runtimeType != runtimeType) {
|
||||||
other.runtimeType != runtimeType) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(preferredBasePort, other.preferredBasePort) &&
|
return _deepEquals(preferredBasePort, other.preferredBasePort) && _deepEquals(blockUnmatchedTraffic, other.blockUnmatchedTraffic) && _deepEquals(dnsConfig, other.dnsConfig) && _deepEquals(bootstrapDohUrl, other.bootstrapDohUrl);
|
||||||
_deepEquals(blockUnmatchedTraffic, other.blockUnmatchedTraffic) &&
|
|
||||||
_deepEquals(dnsConfig, other.dnsConfig) &&
|
|
||||||
_deepEquals(bootstrapDohUrl, other.bootstrapDohUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -323,8 +321,7 @@ class SingboxProxyDnsServerConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static SingboxProxyDnsServerConfig decode(Object result) {
|
static SingboxProxyDnsServerConfig decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -342,20 +339,13 @@ class SingboxProxyDnsServerConfig {
|
|||||||
@override
|
@override
|
||||||
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
if (other is! SingboxProxyDnsServerConfig ||
|
if (other is! SingboxProxyDnsServerConfig || other.runtimeType != runtimeType) {
|
||||||
other.runtimeType != runtimeType) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(tag, other.tag) &&
|
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);
|
||||||
_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
|
@override
|
||||||
@@ -380,18 +370,20 @@ class SingboxProxyDnsConfig {
|
|||||||
String domainStrategy;
|
String domainStrategy;
|
||||||
|
|
||||||
List<Object?> _toList() {
|
List<Object?> _toList() {
|
||||||
return <Object?>[servers, finalServerTag, domainStrategy];
|
return <Object?>[
|
||||||
|
servers,
|
||||||
|
finalServerTag,
|
||||||
|
domainStrategy,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static SingboxProxyDnsConfig decode(Object result) {
|
static SingboxProxyDnsConfig decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
return SingboxProxyDnsConfig(
|
return SingboxProxyDnsConfig(
|
||||||
servers: (result[0]! as List<Object?>)
|
servers: (result[0]! as List<Object?>).cast<SingboxProxyDnsServerConfig>(),
|
||||||
.cast<SingboxProxyDnsServerConfig>(),
|
|
||||||
finalServerTag: result[1] as String?,
|
finalServerTag: result[1] as String?,
|
||||||
domainStrategy: result[2]! as String,
|
domainStrategy: result[2]! as String,
|
||||||
);
|
);
|
||||||
@@ -406,9 +398,7 @@ class SingboxProxyDnsConfig {
|
|||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(servers, other.servers) &&
|
return _deepEquals(servers, other.servers) && _deepEquals(finalServerTag, other.finalServerTag) && _deepEquals(domainStrategy, other.domainStrategy);
|
||||||
_deepEquals(finalServerTag, other.finalServerTag) &&
|
|
||||||
_deepEquals(domainStrategy, other.domainStrategy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -436,12 +426,17 @@ class SingboxProxyRuntimeEndpoint {
|
|||||||
String password;
|
String password;
|
||||||
|
|
||||||
List<Object?> _toList() {
|
List<Object?> _toList() {
|
||||||
return <Object?>[profileId, host, port, username, password];
|
return <Object?>[
|
||||||
|
profileId,
|
||||||
|
host,
|
||||||
|
port,
|
||||||
|
username,
|
||||||
|
password,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static SingboxProxyRuntimeEndpoint decode(Object result) {
|
static SingboxProxyRuntimeEndpoint decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -457,18 +452,13 @@ class SingboxProxyRuntimeEndpoint {
|
|||||||
@override
|
@override
|
||||||
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
if (other is! SingboxProxyRuntimeEndpoint ||
|
if (other is! SingboxProxyRuntimeEndpoint || other.runtimeType != runtimeType) {
|
||||||
other.runtimeType != runtimeType) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(profileId, other.profileId) &&
|
return _deepEquals(profileId, other.profileId) && _deepEquals(host, other.host) && _deepEquals(port, other.port) && _deepEquals(username, other.username) && _deepEquals(password, other.password);
|
||||||
_deepEquals(host, other.host) &&
|
|
||||||
_deepEquals(port, other.port) &&
|
|
||||||
_deepEquals(username, other.username) &&
|
|
||||||
_deepEquals(password, other.password);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -490,19 +480,21 @@ class SingboxProxyRuntimeState {
|
|||||||
String? message;
|
String? message;
|
||||||
|
|
||||||
List<Object?> _toList() {
|
List<Object?> _toList() {
|
||||||
return <Object?>[status, endpoints, message];
|
return <Object?>[
|
||||||
|
status,
|
||||||
|
endpoints,
|
||||||
|
message,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static SingboxProxyRuntimeState decode(Object result) {
|
static SingboxProxyRuntimeState decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
return SingboxProxyRuntimeState(
|
return SingboxProxyRuntimeState(
|
||||||
status: result[0]! as SingboxProxyRuntimeStatus,
|
status: result[0]! as SingboxProxyRuntimeStatus,
|
||||||
endpoints: (result[1]! as List<Object?>)
|
endpoints: (result[1]! as List<Object?>).cast<SingboxProxyRuntimeEndpoint>(),
|
||||||
.cast<SingboxProxyRuntimeEndpoint>(),
|
|
||||||
message: result[2] as String?,
|
message: result[2] as String?,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -510,16 +502,13 @@ class SingboxProxyRuntimeState {
|
|||||||
@override
|
@override
|
||||||
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
if (other is! SingboxProxyRuntimeState ||
|
if (other is! SingboxProxyRuntimeState || other.runtimeType != runtimeType) {
|
||||||
other.runtimeType != runtimeType) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(status, other.status) &&
|
return _deepEquals(status, other.status) && _deepEquals(endpoints, other.endpoints) && _deepEquals(message, other.message);
|
||||||
_deepEquals(endpoints, other.endpoints) &&
|
|
||||||
_deepEquals(message, other.message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -528,41 +517,43 @@ class SingboxProxyRuntimeState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SingboxProxyConfigResult {
|
class SingboxProxyConfigResult {
|
||||||
SingboxProxyConfigResult({required this.configJson, required this.endpoints});
|
SingboxProxyConfigResult({
|
||||||
|
required this.configJson,
|
||||||
|
required this.endpoints,
|
||||||
|
});
|
||||||
|
|
||||||
String configJson;
|
String configJson;
|
||||||
|
|
||||||
List<SingboxProxyRuntimeEndpoint> endpoints;
|
List<SingboxProxyRuntimeEndpoint> endpoints;
|
||||||
|
|
||||||
List<Object?> _toList() {
|
List<Object?> _toList() {
|
||||||
return <Object?>[configJson, endpoints];
|
return <Object?>[
|
||||||
|
configJson,
|
||||||
|
endpoints,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static SingboxProxyConfigResult decode(Object result) {
|
static SingboxProxyConfigResult decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
return SingboxProxyConfigResult(
|
return SingboxProxyConfigResult(
|
||||||
configJson: result[0]! as String,
|
configJson: result[0]! as String,
|
||||||
endpoints: (result[1]! as List<Object?>)
|
endpoints: (result[1]! as List<Object?>).cast<SingboxProxyRuntimeEndpoint>(),
|
||||||
.cast<SingboxProxyRuntimeEndpoint>(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
// ignore: avoid_equals_and_hash_code_on_mutable_classes
|
||||||
bool operator ==(Object other) {
|
bool operator ==(Object other) {
|
||||||
if (other is! SingboxProxyConfigResult ||
|
if (other is! SingboxProxyConfigResult || other.runtimeType != runtimeType) {
|
||||||
other.runtimeType != runtimeType) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(configJson, other.configJson) &&
|
return _deepEquals(configJson, other.configJson) && _deepEquals(endpoints, other.endpoints);
|
||||||
_deepEquals(endpoints, other.endpoints);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -587,12 +578,16 @@ class SingboxProxyLogMessage {
|
|||||||
String? profileId;
|
String? profileId;
|
||||||
|
|
||||||
List<Object?> _toList() {
|
List<Object?> _toList() {
|
||||||
return <Object?>[level, message, timestamp, profileId];
|
return <Object?>[
|
||||||
|
level,
|
||||||
|
message,
|
||||||
|
timestamp,
|
||||||
|
profileId,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static SingboxProxyLogMessage decode(Object result) {
|
static SingboxProxyLogMessage decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -613,10 +608,7 @@ class SingboxProxyLogMessage {
|
|||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(level, other.level) &&
|
return _deepEquals(level, other.level) && _deepEquals(message, other.message) && _deepEquals(timestamp, other.timestamp) && _deepEquals(profileId, other.profileId);
|
||||||
_deepEquals(message, other.message) &&
|
|
||||||
_deepEquals(timestamp, other.timestamp) &&
|
|
||||||
_deepEquals(profileId, other.profileId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -624,6 +616,7 @@ class SingboxProxyLogMessage {
|
|||||||
int get hashCode => _deepHash(<Object?>[runtimeType, ..._toList()]);
|
int get hashCode => _deepHash(<Object?>[runtimeType, ..._toList()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class _PigeonCodec extends StandardMessageCodec {
|
class _PigeonCodec extends StandardMessageCodec {
|
||||||
const _PigeonCodec();
|
const _PigeonCodec();
|
||||||
@override
|
@override
|
||||||
@@ -701,13 +694,9 @@ class SingboxProxyApi {
|
|||||||
/// Constructor for [SingboxProxyApi]. The [binaryMessenger] named argument is
|
/// Constructor for [SingboxProxyApi]. The [binaryMessenger] named argument is
|
||||||
/// available for dependency injection. If it is left null, the default
|
/// available for dependency injection. If it is left null, the default
|
||||||
/// BinaryMessenger will be used which routes to the host platform.
|
/// BinaryMessenger will be used which routes to the host platform.
|
||||||
SingboxProxyApi({
|
SingboxProxyApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
||||||
BinaryMessenger? binaryMessenger,
|
: pigeonVar_binaryMessenger = binaryMessenger,
|
||||||
String messageChannelSuffix = '',
|
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
}) : pigeonVar_binaryMessenger = binaryMessenger,
|
|
||||||
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
final BinaryMessenger? pigeonVar_binaryMessenger;
|
final BinaryMessenger? pigeonVar_binaryMessenger;
|
||||||
|
|
||||||
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
||||||
@@ -715,97 +704,82 @@ class SingboxProxyApi {
|
|||||||
final String pigeonVar_messageChannelSuffix;
|
final String pigeonVar_messageChannelSuffix;
|
||||||
|
|
||||||
Future<String?> validateProfile(SingboxProxyProfile profile) async {
|
Future<String?> validateProfile(SingboxProxyProfile profile) async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.validateProfile$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.validateProfile$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[profile]);
|
||||||
<Object?>[profile],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue as String?;
|
return pigeonVar_replyValue as String?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<SingboxProxyConfigResult> buildConfig(
|
Future<SingboxProxyConfigResult> buildConfig(List<SingboxProxyProfile> profiles, SingboxProxyRuntimeOptions options) async {
|
||||||
List<SingboxProxyProfile> profiles,
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.buildConfig$pigeonVar_messageChannelSuffix';
|
||||||
SingboxProxyRuntimeOptions options,
|
|
||||||
) async {
|
|
||||||
final pigeonVar_channelName =
|
|
||||||
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.buildConfig$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[profiles, options]);
|
||||||
<Object?>[profiles, options],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: false,
|
isNullValid: false,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue! as SingboxProxyConfigResult;
|
return pigeonVar_replyValue! as SingboxProxyConfigResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<SingboxProxyRuntimeState> start(
|
Future<SingboxProxyRuntimeState> start(List<SingboxProxyProfile> profiles, SingboxProxyRuntimeOptions options) async {
|
||||||
List<SingboxProxyProfile> profiles,
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.start$pigeonVar_messageChannelSuffix';
|
||||||
SingboxProxyRuntimeOptions options,
|
|
||||||
) async {
|
|
||||||
final pigeonVar_channelName =
|
|
||||||
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.start$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[profiles, options]);
|
||||||
<Object?>[profiles, options],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: false,
|
isNullValid: false,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue! as SingboxProxyRuntimeState;
|
return pigeonVar_replyValue! as SingboxProxyRuntimeState;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> stop(List<String> profileIds) async {
|
Future<void> stop(List<String> profileIds) async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.stop$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.stop$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[profileIds]);
|
||||||
<Object?>[profileIds],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
_extractReplyValueOrThrow(
|
_extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> stopAll() async {
|
Future<void> stopAll() async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.stopAll$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.stopAll$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
@@ -818,12 +792,12 @@ class SingboxProxyApi {
|
|||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<SingboxProxyRuntimeState> getState() async {
|
Future<SingboxProxyRuntimeState> getState() async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.getState$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyApi.getState$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
@@ -836,7 +810,8 @@ class SingboxProxyApi {
|
|||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: false,
|
isNullValid: false,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue! as SingboxProxyRuntimeState;
|
return pigeonVar_replyValue! as SingboxProxyRuntimeState;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -848,62 +823,46 @@ abstract class SingboxProxyEventsApi {
|
|||||||
|
|
||||||
void onLogMessage(SingboxProxyLogMessage message);
|
void onLogMessage(SingboxProxyLogMessage message);
|
||||||
|
|
||||||
static void setUp(
|
static void setUp(SingboxProxyEventsApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) {
|
||||||
SingboxProxyEventsApi? api, {
|
messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
BinaryMessenger? binaryMessenger,
|
|
||||||
String messageChannelSuffix = '',
|
|
||||||
}) {
|
|
||||||
messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
{
|
{
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyEventsApi.onStateChanged$messageChannelSuffix',
|
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyEventsApi.onStateChanged$messageChannelSuffix', pigeonChannelCodec,
|
||||||
pigeonChannelCodec,
|
binaryMessenger: binaryMessenger);
|
||||||
binaryMessenger: binaryMessenger,
|
|
||||||
);
|
|
||||||
if (api == null) {
|
if (api == null) {
|
||||||
pigeonVar_channel.setMessageHandler(null);
|
pigeonVar_channel.setMessageHandler(null);
|
||||||
} else {
|
} else {
|
||||||
pigeonVar_channel.setMessageHandler((Object? message) async {
|
pigeonVar_channel.setMessageHandler((Object? message) async {
|
||||||
final List<Object?> args = message! as List<Object?>;
|
final List<Object?> args = message! as List<Object?>;
|
||||||
final SingboxProxyRuntimeState arg_state =
|
final SingboxProxyRuntimeState arg_state = args[0]! as SingboxProxyRuntimeState;
|
||||||
args[0]! as SingboxProxyRuntimeState;
|
|
||||||
try {
|
try {
|
||||||
api.onStateChanged(arg_state);
|
api.onStateChanged(arg_state);
|
||||||
return wrapResponse(empty: true);
|
return wrapResponse(empty: true);
|
||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (e) {
|
||||||
return wrapResponse(error: e);
|
return wrapResponse(error: e);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return wrapResponse(
|
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
|
||||||
error: PlatformException(code: 'error', message: e.toString()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyEventsApi.onLogMessage$messageChannelSuffix',
|
'dev.flutter.pigeon.flutter_singbox_proxy.SingboxProxyEventsApi.onLogMessage$messageChannelSuffix', pigeonChannelCodec,
|
||||||
pigeonChannelCodec,
|
binaryMessenger: binaryMessenger);
|
||||||
binaryMessenger: binaryMessenger,
|
|
||||||
);
|
|
||||||
if (api == null) {
|
if (api == null) {
|
||||||
pigeonVar_channel.setMessageHandler(null);
|
pigeonVar_channel.setMessageHandler(null);
|
||||||
} else {
|
} else {
|
||||||
pigeonVar_channel.setMessageHandler((Object? message) async {
|
pigeonVar_channel.setMessageHandler((Object? message) async {
|
||||||
final List<Object?> args = message! as List<Object?>;
|
final List<Object?> args = message! as List<Object?>;
|
||||||
final SingboxProxyLogMessage arg_message =
|
final SingboxProxyLogMessage arg_message = args[0]! as SingboxProxyLogMessage;
|
||||||
args[0]! as SingboxProxyLogMessage;
|
|
||||||
try {
|
try {
|
||||||
api.onLogMessage(arg_message);
|
api.onLogMessage(arg_message);
|
||||||
return wrapResponse(empty: true);
|
return wrapResponse(empty: true);
|
||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (e) {
|
||||||
return wrapResponse(error: e);
|
return wrapResponse(error: e);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return wrapResponse(
|
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
|
||||||
error: PlatformException(code: 'error', message: e.toString()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
lint: ^2.8.0
|
lint: ^2.8.0
|
||||||
pigeon: ^26.3.2
|
pigeon: ^26.3.4
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ class FlutterError (
|
|||||||
val code: String,
|
val code: String,
|
||||||
override val message: String? = null,
|
override val message: String? = null,
|
||||||
val details: Any? = null
|
val details: Any? = null
|
||||||
) : Throwable()
|
) : RuntimeException()
|
||||||
|
|
||||||
/** Transport types for Tor connections */
|
/** Transport types for Tor connections */
|
||||||
enum class TransportType(val raw: Int) {
|
enum class TransportType(val raw: Int) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
// ignore_for_file: unused_import, unused_shown_name
|
// ignore_for_file: unused_import, unused_shown_name
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
@@ -34,11 +34,8 @@ Object? _extractReplyValueOrThrow(
|
|||||||
return replyList.firstOrNull;
|
return replyList.firstOrNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Object?> wrapResponse({
|
|
||||||
Object? result,
|
List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
|
||||||
PlatformException? error,
|
|
||||||
bool empty = false,
|
|
||||||
}) {
|
|
||||||
if (empty) {
|
if (empty) {
|
||||||
return <Object?>[];
|
return <Object?>[];
|
||||||
}
|
}
|
||||||
@@ -47,7 +44,6 @@ List<Object?> wrapResponse({
|
|||||||
}
|
}
|
||||||
return <Object?>[error.code, error.message, error.details];
|
return <Object?>[error.code, error.message, error.details];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _deepEquals(Object? a, Object? b) {
|
bool _deepEquals(Object? a, Object? b) {
|
||||||
if (identical(a, b)) {
|
if (identical(a, b)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -60,9 +56,8 @@ bool _deepEquals(Object? a, Object? b) {
|
|||||||
}
|
}
|
||||||
if (a is List && b is List) {
|
if (a is List && b is List) {
|
||||||
return a.length == b.length &&
|
return a.length == b.length &&
|
||||||
a.indexed.every(
|
a.indexed
|
||||||
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
|
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (a is Map && b is Map) {
|
if (a is Map && b is Map) {
|
||||||
if (a.length != b.length) {
|
if (a.length != b.length) {
|
||||||
@@ -111,29 +106,23 @@ int _deepHash(Object? value) {
|
|||||||
return value.hashCode;
|
return value.hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Transport types for Tor connections
|
/// Transport types for Tor connections
|
||||||
enum TransportType {
|
enum TransportType {
|
||||||
/// Direct Tor connection (no bridges)
|
/// Direct Tor connection (no bridges)
|
||||||
none,
|
none,
|
||||||
|
|
||||||
/// obfs4 pluggable transport
|
/// obfs4 pluggable transport
|
||||||
obfs4,
|
obfs4,
|
||||||
|
|
||||||
/// Snowflake pluggable transport (default broker)
|
/// Snowflake pluggable transport (default broker)
|
||||||
snowflake,
|
snowflake,
|
||||||
|
|
||||||
/// Snowflake via AMP cache
|
/// Snowflake via AMP cache
|
||||||
snowflakeAmp,
|
snowflakeAmp,
|
||||||
|
|
||||||
/// Meek pluggable transport
|
/// Meek pluggable transport
|
||||||
meek,
|
meek,
|
||||||
|
|
||||||
/// Meek via Azure CDN
|
/// Meek via Azure CDN
|
||||||
meekAzure,
|
meekAzure,
|
||||||
|
|
||||||
/// WebTunnel pluggable transport
|
/// WebTunnel pluggable transport
|
||||||
webtunnel,
|
webtunnel,
|
||||||
|
|
||||||
/// Custom bridge lines (passthrough)
|
/// Custom bridge lines (passthrough)
|
||||||
custom,
|
custom,
|
||||||
}
|
}
|
||||||
@@ -174,8 +163,7 @@ class TorConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static TorConfiguration decode(Object result) {
|
static TorConfiguration decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -197,11 +185,7 @@ class TorConfiguration {
|
|||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(transport, other.transport) &&
|
return _deepEquals(transport, other.transport) && _deepEquals(bridgeLines, other.bridgeLines) && _deepEquals(entryNodeCountries, other.entryNodeCountries) && _deepEquals(exitNodeCountries, other.exitNodeCountries) && _deepEquals(strictNodes, other.strictNodes);
|
||||||
_deepEquals(bridgeLines, other.bridgeLines) &&
|
|
||||||
_deepEquals(entryNodeCountries, other.entryNodeCountries) &&
|
|
||||||
_deepEquals(exitNodeCountries, other.exitNodeCountries) &&
|
|
||||||
_deepEquals(strictNodes, other.strictNodes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -245,8 +229,7 @@ class TorStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static TorStatus decode(Object result) {
|
static TorStatus decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -268,11 +251,7 @@ class TorStatus {
|
|||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(isRunning, other.isRunning) &&
|
return _deepEquals(isRunning, other.isRunning) && _deepEquals(socksPort, other.socksPort) && _deepEquals(bootstrapProgress, other.bootstrapProgress) && _deepEquals(currentCircuit, other.currentCircuit) && _deepEquals(exitNodeCountry, other.exitNodeCountry);
|
||||||
_deepEquals(socksPort, other.socksPort) &&
|
|
||||||
_deepEquals(bootstrapProgress, other.bootstrapProgress) &&
|
|
||||||
_deepEquals(currentCircuit, other.currentCircuit) &&
|
|
||||||
_deepEquals(exitNodeCountry, other.exitNodeCountry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -298,12 +277,15 @@ class TorLogMessage {
|
|||||||
int timestamp;
|
int timestamp;
|
||||||
|
|
||||||
List<Object?> _toList() {
|
List<Object?> _toList() {
|
||||||
return <Object?>[severity, message, timestamp];
|
return <Object?>[
|
||||||
|
severity,
|
||||||
|
message,
|
||||||
|
timestamp,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static TorLogMessage decode(Object result) {
|
static TorLogMessage decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -323,9 +305,7 @@ class TorLogMessage {
|
|||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(severity, other.severity) &&
|
return _deepEquals(severity, other.severity) && _deepEquals(message, other.message) && _deepEquals(timestamp, other.timestamp);
|
||||||
_deepEquals(message, other.message) &&
|
|
||||||
_deepEquals(timestamp, other.timestamp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -333,6 +313,7 @@ class TorLogMessage {
|
|||||||
int get hashCode => _deepHash(<Object?>[runtimeType, ..._toList()]);
|
int get hashCode => _deepHash(<Object?>[runtimeType, ..._toList()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class _PigeonCodec extends StandardMessageCodec {
|
class _PigeonCodec extends StandardMessageCodec {
|
||||||
const _PigeonCodec();
|
const _PigeonCodec();
|
||||||
@override
|
@override
|
||||||
@@ -382,9 +363,7 @@ class TorApi {
|
|||||||
/// BinaryMessenger will be used which routes to the host platform.
|
/// BinaryMessenger will be used which routes to the host platform.
|
||||||
TorApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
TorApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
||||||
: pigeonVar_binaryMessenger = binaryMessenger,
|
: pigeonVar_binaryMessenger = binaryMessenger,
|
||||||
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
final BinaryMessenger? pigeonVar_binaryMessenger;
|
final BinaryMessenger? pigeonVar_binaryMessenger;
|
||||||
|
|
||||||
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
||||||
@@ -394,30 +373,27 @@ class TorApi {
|
|||||||
/// Start Tor with the given configuration
|
/// Start Tor with the given configuration
|
||||||
/// Returns a Future to avoid blocking the main thread
|
/// Returns a Future to avoid blocking the main thread
|
||||||
Future<int> startTor(TorConfiguration config) async {
|
Future<int> startTor(TorConfiguration config) async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.TorApi.startTor$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_tor.TorApi.startTor$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[config]);
|
||||||
<Object?>[config],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: false,
|
isNullValid: false,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue! as int;
|
return pigeonVar_replyValue! as int;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stop Tor
|
/// Stop Tor
|
||||||
Future<void> stopTor() async {
|
Future<void> stopTor() async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.TorApi.stopTor$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_tor.TorApi.stopTor$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
@@ -430,13 +406,13 @@ class TorApi {
|
|||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get current status
|
/// Get current status
|
||||||
Future<TorStatus> getStatus() async {
|
Future<TorStatus> getStatus() async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.TorApi.getStatus$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_tor.TorApi.getStatus$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
@@ -449,14 +425,14 @@ class TorApi {
|
|||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: false,
|
isNullValid: false,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue! as TorStatus;
|
return pigeonVar_replyValue! as TorStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request a new Tor identity (new circuit)
|
/// Request a new Tor identity (new circuit)
|
||||||
Future<void> requestNewIdentity() async {
|
Future<void> requestNewIdentity() async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.TorApi.requestNewIdentity$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_tor.TorApi.requestNewIdentity$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
@@ -469,7 +445,8 @@ class TorApi {
|
|||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,20 +460,12 @@ abstract class TorLogApi {
|
|||||||
/// Called when status changes
|
/// Called when status changes
|
||||||
void onStatusChanged(TorStatus status);
|
void onStatusChanged(TorStatus status);
|
||||||
|
|
||||||
static void setUp(
|
static void setUp(TorLogApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) {
|
||||||
TorLogApi? api, {
|
messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
BinaryMessenger? binaryMessenger,
|
|
||||||
String messageChannelSuffix = '',
|
|
||||||
}) {
|
|
||||||
messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
{
|
{
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
'dev.flutter.pigeon.flutter_tor.TorLogApi.onLogMessage$messageChannelSuffix',
|
'dev.flutter.pigeon.flutter_tor.TorLogApi.onLogMessage$messageChannelSuffix', pigeonChannelCodec,
|
||||||
pigeonChannelCodec,
|
binaryMessenger: binaryMessenger);
|
||||||
binaryMessenger: binaryMessenger,
|
|
||||||
);
|
|
||||||
if (api == null) {
|
if (api == null) {
|
||||||
pigeonVar_channel.setMessageHandler(null);
|
pigeonVar_channel.setMessageHandler(null);
|
||||||
} else {
|
} else {
|
||||||
@@ -509,19 +478,15 @@ abstract class TorLogApi {
|
|||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (e) {
|
||||||
return wrapResponse(error: e);
|
return wrapResponse(error: e);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return wrapResponse(
|
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
|
||||||
error: PlatformException(code: 'error', message: e.toString()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
'dev.flutter.pigeon.flutter_tor.TorLogApi.onStatusChanged$messageChannelSuffix',
|
'dev.flutter.pigeon.flutter_tor.TorLogApi.onStatusChanged$messageChannelSuffix', pigeonChannelCodec,
|
||||||
pigeonChannelCodec,
|
binaryMessenger: binaryMessenger);
|
||||||
binaryMessenger: binaryMessenger,
|
|
||||||
);
|
|
||||||
if (api == null) {
|
if (api == null) {
|
||||||
pigeonVar_channel.setMessageHandler(null);
|
pigeonVar_channel.setMessageHandler(null);
|
||||||
} else {
|
} else {
|
||||||
@@ -534,9 +499,7 @@ abstract class TorLogApi {
|
|||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (e) {
|
||||||
return wrapResponse(error: e);
|
return wrapResponse(error: e);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return wrapResponse(
|
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
|
||||||
error: PlatformException(code: 'error', message: e.toString()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -548,13 +511,9 @@ class IPtProxyController {
|
|||||||
/// Constructor for [IPtProxyController]. The [binaryMessenger] named argument is
|
/// Constructor for [IPtProxyController]. The [binaryMessenger] named argument is
|
||||||
/// available for dependency injection. If it is left null, the default
|
/// available for dependency injection. If it is left null, the default
|
||||||
/// BinaryMessenger will be used which routes to the host platform.
|
/// BinaryMessenger will be used which routes to the host platform.
|
||||||
IPtProxyController({
|
IPtProxyController({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
||||||
BinaryMessenger? binaryMessenger,
|
: pigeonVar_binaryMessenger = binaryMessenger,
|
||||||
String messageChannelSuffix = '',
|
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
}) : pigeonVar_binaryMessenger = binaryMessenger,
|
|
||||||
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
final BinaryMessenger? pigeonVar_binaryMessenger;
|
final BinaryMessenger? pigeonVar_binaryMessenger;
|
||||||
|
|
||||||
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
||||||
@@ -562,43 +521,39 @@ class IPtProxyController {
|
|||||||
final String pigeonVar_messageChannelSuffix;
|
final String pigeonVar_messageChannelSuffix;
|
||||||
|
|
||||||
Future<int> start(TransportType proxyType, String proxy) async {
|
Future<int> start(TransportType proxyType, String proxy) async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.IPtProxyController.start$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_tor.IPtProxyController.start$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[proxyType, proxy]);
|
||||||
<Object?>[proxyType, proxy],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: false,
|
isNullValid: false,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue! as int;
|
return pigeonVar_replyValue! as int;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> stop(TransportType proxyType) async {
|
Future<void> stop(TransportType proxyType) async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.flutter_tor.IPtProxyController.stop$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.flutter_tor.IPtProxyController.stop$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[proxyType]);
|
||||||
<Object?>[proxyType],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
_extractReplyValueOrThrow(
|
_extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
lint: ^2.8.0
|
lint: ^2.8.0
|
||||||
pigeon: ^26.3.2
|
pigeon: ^26.3.4
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ class FlutterError (
|
|||||||
val code: String,
|
val code: String,
|
||||||
override val message: String? = null,
|
override val message: String? = null,
|
||||||
val details: Any? = null
|
val details: Any? = null
|
||||||
) : Throwable()
|
) : RuntimeException()
|
||||||
|
|
||||||
/** Generated class from Pigeon that represents data sent in messages. */
|
/** Generated class from Pigeon that represents data sent in messages. */
|
||||||
data class LocalizedResult (
|
data class LocalizedResult (
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
// ignore_for_file: unused_import, unused_shown_name
|
// ignore_for_file: unused_import, unused_shown_name
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
@@ -46,9 +46,8 @@ bool _deepEquals(Object? a, Object? b) {
|
|||||||
}
|
}
|
||||||
if (a is List && b is List) {
|
if (a is List && b is List) {
|
||||||
return a.length == b.length &&
|
return a.length == b.length &&
|
||||||
a.indexed.every(
|
a.indexed
|
||||||
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
|
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (a is Map && b is Map) {
|
if (a is Map && b is Map) {
|
||||||
if (a.length != b.length) {
|
if (a.length != b.length) {
|
||||||
@@ -97,20 +96,26 @@ int _deepHash(Object? value) {
|
|||||||
return value.hashCode;
|
return value.hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class LocalizedResult {
|
class LocalizedResult {
|
||||||
LocalizedResult({required this.languageName, this.countryName});
|
LocalizedResult({
|
||||||
|
required this.languageName,
|
||||||
|
this.countryName,
|
||||||
|
});
|
||||||
|
|
||||||
String languageName;
|
String languageName;
|
||||||
|
|
||||||
String? countryName;
|
String? countryName;
|
||||||
|
|
||||||
List<Object?> _toList() {
|
List<Object?> _toList() {
|
||||||
return <Object?>[languageName, countryName];
|
return <Object?>[
|
||||||
|
languageName,
|
||||||
|
countryName,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static LocalizedResult decode(Object result) {
|
static LocalizedResult decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -129,8 +134,7 @@ class LocalizedResult {
|
|||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(languageName, other.languageName) &&
|
return _deepEquals(languageName, other.languageName) && _deepEquals(countryName, other.countryName);
|
||||||
_deepEquals(countryName, other.countryName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -138,6 +142,7 @@ class LocalizedResult {
|
|||||||
int get hashCode => _deepHash(<Object?>[runtimeType, ..._toList()]);
|
int get hashCode => _deepHash(<Object?>[runtimeType, ..._toList()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class _PigeonCodec extends StandardMessageCodec {
|
class _PigeonCodec extends StandardMessageCodec {
|
||||||
const _PigeonCodec();
|
const _PigeonCodec();
|
||||||
@override
|
@override
|
||||||
@@ -168,40 +173,31 @@ class LocaleResolver {
|
|||||||
/// Constructor for [LocaleResolver]. The [binaryMessenger] named argument is
|
/// Constructor for [LocaleResolver]. The [binaryMessenger] named argument is
|
||||||
/// available for dependency injection. If it is left null, the default
|
/// available for dependency injection. If it is left null, the default
|
||||||
/// BinaryMessenger will be used which routes to the host platform.
|
/// BinaryMessenger will be used which routes to the host platform.
|
||||||
LocaleResolver({
|
LocaleResolver({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
||||||
BinaryMessenger? binaryMessenger,
|
: pigeonVar_binaryMessenger = binaryMessenger,
|
||||||
String messageChannelSuffix = '',
|
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
}) : pigeonVar_binaryMessenger = binaryMessenger,
|
|
||||||
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
final BinaryMessenger? pigeonVar_binaryMessenger;
|
final BinaryMessenger? pigeonVar_binaryMessenger;
|
||||||
|
|
||||||
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
||||||
|
|
||||||
final String pigeonVar_messageChannelSuffix;
|
final String pigeonVar_messageChannelSuffix;
|
||||||
|
|
||||||
Future<LocalizedResult> resolve(
|
Future<LocalizedResult> resolve(String languageTag, String targetLangouageTag) async {
|
||||||
String languageTag,
|
final pigeonVar_channelName = 'dev.flutter.pigeon.locale_resolver.LocaleResolver.resolve$pigeonVar_messageChannelSuffix';
|
||||||
String targetLangouageTag,
|
|
||||||
) async {
|
|
||||||
final pigeonVar_channelName =
|
|
||||||
'dev.flutter.pigeon.locale_resolver.LocaleResolver.resolve$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[languageTag, targetLangouageTag]);
|
||||||
<Object?>[languageTag, targetLangouageTag],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: false,
|
isNullValid: false,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue! as LocalizedResult;
|
return pigeonVar_replyValue! as LocalizedResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
lint: ^2.8.0
|
lint: ^2.8.0
|
||||||
pigeon: ^26.3.2
|
pigeon: ^26.3.4
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ class FlutterError (
|
|||||||
val code: String,
|
val code: String,
|
||||||
override val message: String? = null,
|
override val message: String? = null,
|
||||||
val details: Any? = null
|
val details: Any? = null
|
||||||
) : Throwable()
|
) : RuntimeException()
|
||||||
|
|
||||||
/** Generated class from Pigeon that represents data sent in messages. */
|
/** Generated class from Pigeon that represents data sent in messages. */
|
||||||
data class Intent (
|
data class Intent (
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
// ignore_for_file: unused_import, unused_shown_name
|
// ignore_for_file: unused_import, unused_shown_name
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
@@ -34,11 +34,8 @@ Object? _extractReplyValueOrThrow(
|
|||||||
return replyList.firstOrNull;
|
return replyList.firstOrNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Object?> wrapResponse({
|
|
||||||
Object? result,
|
List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
|
||||||
PlatformException? error,
|
|
||||||
bool empty = false,
|
|
||||||
}) {
|
|
||||||
if (empty) {
|
if (empty) {
|
||||||
return <Object?>[];
|
return <Object?>[];
|
||||||
}
|
}
|
||||||
@@ -47,7 +44,6 @@ List<Object?> wrapResponse({
|
|||||||
}
|
}
|
||||||
return <Object?>[error.code, error.message, error.details];
|
return <Object?>[error.code, error.message, error.details];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _deepEquals(Object? a, Object? b) {
|
bool _deepEquals(Object? a, Object? b) {
|
||||||
if (identical(a, b)) {
|
if (identical(a, b)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -60,9 +56,8 @@ bool _deepEquals(Object? a, Object? b) {
|
|||||||
}
|
}
|
||||||
if (a is List && b is List) {
|
if (a is List && b is List) {
|
||||||
return a.length == b.length &&
|
return a.length == b.length &&
|
||||||
a.indexed.every(
|
a.indexed
|
||||||
((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]),
|
.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (a is Map && b is Map) {
|
if (a is Map && b is Map) {
|
||||||
if (a.length != b.length) {
|
if (a.length != b.length) {
|
||||||
@@ -111,6 +106,7 @@ int _deepHash(Object? value) {
|
|||||||
return value.hashCode;
|
return value.hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class Intent {
|
class Intent {
|
||||||
Intent({
|
Intent({
|
||||||
this.fromPackageName,
|
this.fromPackageName,
|
||||||
@@ -145,8 +141,7 @@ class Intent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Object encode() {
|
Object encode() {
|
||||||
return _toList();
|
return _toList(); }
|
||||||
}
|
|
||||||
|
|
||||||
static Intent decode(Object result) {
|
static Intent decode(Object result) {
|
||||||
result as List<Object?>;
|
result as List<Object?>;
|
||||||
@@ -169,12 +164,7 @@ class Intent {
|
|||||||
if (identical(this, other)) {
|
if (identical(this, other)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return _deepEquals(fromPackageName, other.fromPackageName) &&
|
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);
|
||||||
_deepEquals(action, other.action) &&
|
|
||||||
_deepEquals(data, other.data) &&
|
|
||||||
_deepEquals(categories, other.categories) &&
|
|
||||||
_deepEquals(mimeType, other.mimeType) &&
|
|
||||||
_deepEquals(extra, other.extra);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -182,6 +172,7 @@ class Intent {
|
|||||||
int get hashCode => _deepHash(<Object?>[runtimeType, ..._toList()]);
|
int get hashCode => _deepHash(<Object?>[runtimeType, ..._toList()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class _PigeonCodec extends StandardMessageCodec {
|
class _PigeonCodec extends StandardMessageCodec {
|
||||||
const _PigeonCodec();
|
const _PigeonCodec();
|
||||||
@override
|
@override
|
||||||
@@ -212,13 +203,9 @@ class IntentHost {
|
|||||||
/// Constructor for [IntentHost]. The [binaryMessenger] named argument is
|
/// Constructor for [IntentHost]. The [binaryMessenger] named argument is
|
||||||
/// available for dependency injection. If it is left null, the default
|
/// available for dependency injection. If it is left null, the default
|
||||||
/// BinaryMessenger will be used which routes to the host platform.
|
/// BinaryMessenger will be used which routes to the host platform.
|
||||||
IntentHost({
|
IntentHost({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
||||||
BinaryMessenger? binaryMessenger,
|
: pigeonVar_binaryMessenger = binaryMessenger,
|
||||||
String messageChannelSuffix = '',
|
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
}) : pigeonVar_binaryMessenger = binaryMessenger,
|
|
||||||
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
final BinaryMessenger? pigeonVar_binaryMessenger;
|
final BinaryMessenger? pigeonVar_binaryMessenger;
|
||||||
|
|
||||||
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
||||||
@@ -230,8 +217,7 @@ class IntentHost {
|
|||||||
/// IntentEvents.setUp() was called (cold-start deep links).
|
/// IntentEvents.setUp() was called (cold-start deep links).
|
||||||
/// Returns null if no launch intent is pending.
|
/// Returns null if no launch intent is pending.
|
||||||
Future<Intent?> getInitialIntent() async {
|
Future<Intent?> getInitialIntent() async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentHost.getInitialIntent$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.simple_intent_receiver.IntentHost.getInitialIntent$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
@@ -244,7 +230,8 @@ class IntentHost {
|
|||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue as Intent?;
|
return pigeonVar_replyValue as Intent?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,20 +241,12 @@ abstract class IntentEvents {
|
|||||||
|
|
||||||
void onIntentReceived(int sequence, Intent intent);
|
void onIntentReceived(int sequence, Intent intent);
|
||||||
|
|
||||||
static void setUp(
|
static void setUp(IntentEvents? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) {
|
||||||
IntentEvents? api, {
|
messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
BinaryMessenger? binaryMessenger,
|
|
||||||
String messageChannelSuffix = '',
|
|
||||||
}) {
|
|
||||||
messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
{
|
{
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
'dev.flutter.pigeon.simple_intent_receiver.IntentEvents.onIntentReceived$messageChannelSuffix',
|
'dev.flutter.pigeon.simple_intent_receiver.IntentEvents.onIntentReceived$messageChannelSuffix', pigeonChannelCodec,
|
||||||
pigeonChannelCodec,
|
binaryMessenger: binaryMessenger);
|
||||||
binaryMessenger: binaryMessenger,
|
|
||||||
);
|
|
||||||
if (api == null) {
|
if (api == null) {
|
||||||
pigeonVar_channel.setMessageHandler(null);
|
pigeonVar_channel.setMessageHandler(null);
|
||||||
} else {
|
} else {
|
||||||
@@ -281,9 +260,7 @@ abstract class IntentEvents {
|
|||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (e) {
|
||||||
return wrapResponse(error: e);
|
return wrapResponse(error: e);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return wrapResponse(
|
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
|
||||||
error: PlatformException(code: 'error', message: e.toString()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -295,13 +272,9 @@ class IntentGatekeeperHostApi {
|
|||||||
/// Constructor for [IntentGatekeeperHostApi]. The [binaryMessenger] named argument is
|
/// Constructor for [IntentGatekeeperHostApi]. The [binaryMessenger] named argument is
|
||||||
/// available for dependency injection. If it is left null, the default
|
/// available for dependency injection. If it is left null, the default
|
||||||
/// BinaryMessenger will be used which routes to the host platform.
|
/// BinaryMessenger will be used which routes to the host platform.
|
||||||
IntentGatekeeperHostApi({
|
IntentGatekeeperHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
||||||
BinaryMessenger? binaryMessenger,
|
: pigeonVar_binaryMessenger = binaryMessenger,
|
||||||
String messageChannelSuffix = '',
|
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
}) : pigeonVar_binaryMessenger = binaryMessenger,
|
|
||||||
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
final BinaryMessenger? pigeonVar_binaryMessenger;
|
final BinaryMessenger? pigeonVar_binaryMessenger;
|
||||||
|
|
||||||
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
||||||
@@ -311,46 +284,42 @@ class IntentGatekeeperHostApi {
|
|||||||
/// Replicates the blocked-packages policy to the native side so the
|
/// Replicates the blocked-packages policy to the native side so the
|
||||||
/// [IntentReceiverActivity] can reject intents without launching Flutter.
|
/// [IntentReceiverActivity] can reject intents without launching Flutter.
|
||||||
Future<void> setConfig(bool enabled, List<String> blockedPackages) async {
|
Future<void> setConfig(bool enabled, List<String> blockedPackages) async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.setConfig$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.setConfig$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[enabled, blockedPackages]);
|
||||||
<Object?>[enabled, blockedPackages],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
_extractReplyValueOrThrow(
|
_extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Resolves a package name to its user-visible application label via
|
/// Resolves a package name to its user-visible application label via
|
||||||
/// [PackageManager]. Returns `null` if the package is not installed or the
|
/// [PackageManager]. Returns `null` if the package is not installed or the
|
||||||
/// label cannot be resolved.
|
/// label cannot be resolved.
|
||||||
Future<String?> resolvePackageLabel(String packageName) async {
|
Future<String?> resolvePackageLabel(String packageName) async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.resolvePackageLabel$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.resolvePackageLabel$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[packageName]);
|
||||||
<Object?>[packageName],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue as String?;
|
return pigeonVar_replyValue as String?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,8 +329,7 @@ class IntentGatekeeperHostApi {
|
|||||||
/// [ackPendingAlwaysAllows] after Flutter settings were updated
|
/// [ackPendingAlwaysAllows] after Flutter settings were updated
|
||||||
/// successfully.
|
/// successfully.
|
||||||
Future<List<String>> getPendingAlwaysAllows() async {
|
Future<List<String>> getPendingAlwaysAllows() async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.getPendingAlwaysAllows$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.getPendingAlwaysAllows$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
@@ -374,29 +342,28 @@ class IntentGatekeeperHostApi {
|
|||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: false,
|
isNullValid: false,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return (pigeonVar_replyValue! as List<Object?>).cast<String>();
|
return (pigeonVar_replyValue! as List<Object?>).cast<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes the given packages from the pending "Always allow" set after
|
/// Removes the given packages from the pending "Always allow" set after
|
||||||
/// Flutter has successfully persisted them into its own policy store.
|
/// Flutter has successfully persisted them into its own policy store.
|
||||||
Future<void> ackPendingAlwaysAllows(List<String> packageNames) async {
|
Future<void> ackPendingAlwaysAllows(List<String> packageNames) async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.ackPendingAlwaysAllows$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.simple_intent_receiver.IntentGatekeeperHostApi.ackPendingAlwaysAllows$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[packageNames]);
|
||||||
<Object?>[packageNames],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
_extractReplyValueOrThrow(
|
_extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: true,
|
isNullValid: true,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
lint: ^2.8.0
|
lint: ^2.8.0
|
||||||
pigeon: ^26.3.2
|
pigeon: ^26.3.4
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class FlutterError (
|
|||||||
val code: String,
|
val code: String,
|
||||||
override val message: String? = null,
|
override val message: String? = null,
|
||||||
val details: Any? = null
|
val details: Any? = null
|
||||||
) : Throwable()
|
) : RuntimeException()
|
||||||
private open class SpeechToTextPigeonCodec : StandardMessageCodec() {
|
private open class SpeechToTextPigeonCodec : StandardMessageCodec() {
|
||||||
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
|
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
|
||||||
return super.readValueOfType(type, buffer)
|
return super.readValueOfType(type, buffer)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Autogenerated from Pigeon (v26.3.2), do not edit directly.
|
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
||||||
// See also: https://pub.dev/packages/pigeon
|
// See also: https://pub.dev/packages/pigeon
|
||||||
// ignore_for_file: unused_import, unused_shown_name
|
// ignore_for_file: unused_import, unused_shown_name
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
@@ -34,11 +34,8 @@ Object? _extractReplyValueOrThrow(
|
|||||||
return replyList.firstOrNull;
|
return replyList.firstOrNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Object?> wrapResponse({
|
|
||||||
Object? result,
|
List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
|
||||||
PlatformException? error,
|
|
||||||
bool empty = false,
|
|
||||||
}) {
|
|
||||||
if (empty) {
|
if (empty) {
|
||||||
return <Object?>[];
|
return <Object?>[];
|
||||||
}
|
}
|
||||||
@@ -48,6 +45,7 @@ List<Object?> wrapResponse({
|
|||||||
return <Object?>[error.code, error.message, error.details];
|
return <Object?>[error.code, error.message, error.details];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class _PigeonCodec extends StandardMessageCodec {
|
class _PigeonCodec extends StandardMessageCodec {
|
||||||
const _PigeonCodec();
|
const _PigeonCodec();
|
||||||
@override
|
@override
|
||||||
@@ -74,13 +72,9 @@ class SpeechToTextApi {
|
|||||||
/// Constructor for [SpeechToTextApi]. The [binaryMessenger] named argument is
|
/// Constructor for [SpeechToTextApi]. The [binaryMessenger] named argument is
|
||||||
/// available for dependency injection. If it is left null, the default
|
/// available for dependency injection. If it is left null, the default
|
||||||
/// BinaryMessenger will be used which routes to the host platform.
|
/// BinaryMessenger will be used which routes to the host platform.
|
||||||
SpeechToTextApi({
|
SpeechToTextApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
||||||
BinaryMessenger? binaryMessenger,
|
: pigeonVar_binaryMessenger = binaryMessenger,
|
||||||
String messageChannelSuffix = '',
|
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
}) : pigeonVar_binaryMessenger = binaryMessenger,
|
|
||||||
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
final BinaryMessenger? pigeonVar_binaryMessenger;
|
final BinaryMessenger? pigeonVar_binaryMessenger;
|
||||||
|
|
||||||
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
||||||
@@ -95,23 +89,21 @@ class SpeechToTextApi {
|
|||||||
/// The [locale] parameter specifies the language locale for recognition
|
/// The [locale] parameter specifies the language locale for recognition
|
||||||
/// (e.g., 'en-US', 'de-DE'). If null, uses the device default.
|
/// (e.g., 'en-US', 'de-DE'). If null, uses the device default.
|
||||||
Future<bool> showDialog({String? locale}) async {
|
Future<bool> showDialog({String? locale}) async {
|
||||||
final pigeonVar_channelName =
|
final pigeonVar_channelName = 'dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextApi.showDialog$pigeonVar_messageChannelSuffix';
|
||||||
'dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextApi.showDialog$pigeonVar_messageChannelSuffix';
|
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
pigeonChannelCodec,
|
pigeonChannelCodec,
|
||||||
binaryMessenger: pigeonVar_binaryMessenger,
|
binaryMessenger: pigeonVar_binaryMessenger,
|
||||||
);
|
);
|
||||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[locale]);
|
||||||
<Object?>[locale],
|
|
||||||
);
|
|
||||||
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
||||||
|
|
||||||
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
||||||
pigeonVar_replyList,
|
pigeonVar_replyList,
|
||||||
pigeonVar_channelName,
|
pigeonVar_channelName,
|
||||||
isNullValid: false,
|
isNullValid: false,
|
||||||
);
|
)
|
||||||
|
;
|
||||||
return pigeonVar_replyValue! as bool;
|
return pigeonVar_replyValue! as bool;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -126,20 +118,12 @@ abstract class SpeechToTextEvents {
|
|||||||
/// recognition failed or was cancelled.
|
/// recognition failed or was cancelled.
|
||||||
void onTextReceived(String text);
|
void onTextReceived(String text);
|
||||||
|
|
||||||
static void setUp(
|
static void setUp(SpeechToTextEvents? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) {
|
||||||
SpeechToTextEvents? api, {
|
messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
||||||
BinaryMessenger? binaryMessenger,
|
|
||||||
String messageChannelSuffix = '',
|
|
||||||
}) {
|
|
||||||
messageChannelSuffix = messageChannelSuffix.isNotEmpty
|
|
||||||
? '.$messageChannelSuffix'
|
|
||||||
: '';
|
|
||||||
{
|
{
|
||||||
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||||
'dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextEvents.onTextReceived$messageChannelSuffix',
|
'dev.flutter.pigeon.speech_to_text_dialog.SpeechToTextEvents.onTextReceived$messageChannelSuffix', pigeonChannelCodec,
|
||||||
pigeonChannelCodec,
|
binaryMessenger: binaryMessenger);
|
||||||
binaryMessenger: binaryMessenger,
|
|
||||||
);
|
|
||||||
if (api == null) {
|
if (api == null) {
|
||||||
pigeonVar_channel.setMessageHandler(null);
|
pigeonVar_channel.setMessageHandler(null);
|
||||||
} else {
|
} else {
|
||||||
@@ -152,9 +136,7 @@ abstract class SpeechToTextEvents {
|
|||||||
} on PlatformException catch (e) {
|
} on PlatformException catch (e) {
|
||||||
return wrapResponse(error: e);
|
return wrapResponse(error: e);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return wrapResponse(
|
return wrapResponse(error: PlatformException(code: 'error', message: e.toString()));
|
||||||
error: PlatformException(code: 'error', message: e.toString()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
lint: ^2.8.0
|
lint: ^2.8.0
|
||||||
pigeon: ^26.3.2
|
pigeon: ^26.3.4
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
plugin:
|
plugin:
|
||||||
|
|||||||
Reference in New Issue
Block a user