impelement geckoview intent handling via viewport api; fix lints and ui issues

This commit is contained in:
Fabian Freund
2026-01-13 11:03:26 +01:00
parent 5e446f1b92
commit 849823f5df
18 changed files with 960 additions and 33 deletions
+8 -9
View File
@@ -1,3 +1,5 @@
// ignore_for_file: avoid_print, deprecated_member_use
import 'dart:async';
import 'dart:convert';
import 'dart:io';
@@ -71,12 +73,12 @@ class _TorDemoPageState extends State<TorDemoPage> {
);
setState(() {
_isRunning = status.isRunning;
final newPort = status.socksPort?.toInt();
final newPort = status.socksPort;
if (newPort != _socksPort) {
print('DEBUG: Port changed from $_socksPort to $newPort');
}
_socksPort = newPort;
_bootstrapProgress = status.bootstrapProgress.toInt();
_bootstrapProgress = status.bootstrapProgress;
});
});
@@ -104,15 +106,15 @@ class _TorDemoPageState extends State<TorDemoPage> {
);
final socksPort = await _tor.start(config);
print('DEBUG startTor result: socksPort=${socksPort}');
print('DEBUG startTor result: socksPort=$socksPort');
setState(() {
_socksPort = socksPort.toInt();
_socksPort = socksPort;
print('DEBUG: Set _socksPort to $_socksPort from start result');
});
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Tor started on port ${socksPort}')),
SnackBar(content: Text('Tor started on port $socksPort')),
);
}
} catch (e) {
@@ -218,7 +220,7 @@ class _TorDemoPageState extends State<TorDemoPage> {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Your Tor IP: ${_currentIp}'),
content: Text('Your Tor IP: $_currentIp'),
backgroundColor: Colors.green,
duration: const Duration(seconds: 5),
),
@@ -438,13 +440,10 @@ class _TorDemoPageState extends State<TorDemoPage> {
switch (log.severity) {
case 'ERR':
color = Colors.red;
break;
case 'WARN':
color = Colors.orange;
break;
case 'NOTICE':
color = Colors.blue;
break;
default:
color = Colors.black;
}
+3 -19
View File
@@ -17,19 +17,9 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_tor:
# When depending on this package from a real application you should use:
# flutter_tor: ^x.y.z
# See https://dart.dev/tools/pub/dependencies#version-constraints
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
path: ../
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
# HTTP client for testing Tor connectivity
http: any
@@ -37,17 +27,11 @@ dependencies:
socks5_proxy: any
dev_dependencies:
integration_test:
sdk: flutter
flutter_lints: ^6.0.0
flutter_test:
sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^6.0.0
integration_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec