increase min sdk and apply new formatter
This commit is contained in:
@@ -24,13 +24,9 @@ class StartProxyController extends _$StartProxyController {
|
||||
if (result == true) {
|
||||
final connection = ref.read(torProxyServiceProvider.notifier).connect();
|
||||
|
||||
ref.read(overlayDialogControllerProvider.notifier).show(
|
||||
Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
child: TorNotification(),
|
||||
),
|
||||
);
|
||||
ref
|
||||
.read(overlayDialogControllerProvider.notifier)
|
||||
.show(Positioned(top: 0, left: 0, child: TorNotification()));
|
||||
|
||||
await connection;
|
||||
}
|
||||
|
||||
@@ -13,14 +13,15 @@ String _$startProxyControllerHash() =>
|
||||
@ProviderFor(StartProxyController)
|
||||
final startProxyControllerProvider =
|
||||
AutoDisposeNotifierProvider<StartProxyController, void>.internal(
|
||||
StartProxyController.new,
|
||||
name: r'startProxyControllerProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$startProxyControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
StartProxyController.new,
|
||||
name: r'startProxyControllerProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$startProxyControllerHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$StartProxyController = AutoDisposeNotifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
|
||||
@@ -12,9 +12,7 @@ class TorProxyScreen extends HookConsumerWidget {
|
||||
final torProxyPort = ref.watch(torProxyServiceProvider);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Tor Proxy'),
|
||||
),
|
||||
appBar: AppBar(title: const Text('Tor Proxy')),
|
||||
body: ColoredBox(
|
||||
color: const Color(0xFF7D4698),
|
||||
child: Column(
|
||||
@@ -23,36 +21,34 @@ class TorProxyScreen extends HookConsumerWidget {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
'assets/images/tor_white.svg',
|
||||
width: 200,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
SvgPicture.asset('assets/images/tor_white.svg', width: 200),
|
||||
const SizedBox(height: 16),
|
||||
ListTileTheme(
|
||||
iconColor: Colors.white,
|
||||
textColor: Colors.white,
|
||||
child: SwitchListTile.adaptive(
|
||||
inactiveThumbColor: Colors.white,
|
||||
activeColor: const Color(0xFF68B030),
|
||||
trackColor: WidgetStateProperty.resolveWith<Color?>(
|
||||
(Set<WidgetState> states) {
|
||||
trackColor: WidgetStateProperty.resolveWith<Color?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isEmpty) {
|
||||
return const Color(0xFF333A41);
|
||||
}
|
||||
return null; // Use the default color.
|
||||
}),
|
||||
trackOutlineColor:
|
||||
WidgetStateProperty.resolveWith<Color?>(
|
||||
(Set<WidgetState> states) {
|
||||
if (states.isEmpty) {
|
||||
return Colors.white;
|
||||
}
|
||||
return null; // Use the default color.
|
||||
}),
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>(
|
||||
(Set<WidgetState> states) {
|
||||
WidgetStateProperty.resolveWith<Color?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.isEmpty) {
|
||||
return Colors.white;
|
||||
}
|
||||
return null; // Use the default color.
|
||||
}),
|
||||
thumbIcon: WidgetStateProperty.resolveWith<Icon?>((
|
||||
Set<WidgetState> states,
|
||||
) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return const Icon(MdiIcons.axisArrowLock);
|
||||
}
|
||||
@@ -61,19 +57,20 @@ class TorProxyScreen extends HookConsumerWidget {
|
||||
value: torProxyPort.valueOrNull != null,
|
||||
title: const Text('Tor Proxy'),
|
||||
secondary: const Icon(MdiIcons.power),
|
||||
onChanged: torProxyPort.isLoading
|
||||
? null
|
||||
: (value) async {
|
||||
if (value) {
|
||||
await ref
|
||||
.read(torProxyServiceProvider.notifier)
|
||||
.connect();
|
||||
} else {
|
||||
await ref
|
||||
.read(torProxyServiceProvider.notifier)
|
||||
.disconnect();
|
||||
}
|
||||
},
|
||||
onChanged:
|
||||
torProxyPort.isLoading
|
||||
? null
|
||||
: (value) async {
|
||||
if (value) {
|
||||
await ref
|
||||
.read(torProxyServiceProvider.notifier)
|
||||
.connect();
|
||||
} else {
|
||||
await ref
|
||||
.read(torProxyServiceProvider.notifier)
|
||||
.disconnect();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -90,9 +87,7 @@ class TorProxyScreen extends HookConsumerWidget {
|
||||
backgroundColor: Color(0xFF333A41),
|
||||
color: Color(0xFF68B030),
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
'Establishing connection...',
|
||||
style: TextStyle(color: Colors.white),
|
||||
@@ -113,9 +108,7 @@ class TorProxyScreen extends HookConsumerWidget {
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
'Connected to the Tor Network',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium
|
||||
style: Theme.of(context).textTheme.titleMedium
|
||||
?.copyWith(color: const Color(0xFF68B030)),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -6,10 +6,7 @@ class TorDialog extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
icon: const Icon(
|
||||
TorIcons.onionAlt,
|
||||
color: Color(0xFF7D4698),
|
||||
),
|
||||
icon: const Icon(TorIcons.onionAlt, color: Color(0xFF7D4698)),
|
||||
title: const Text('Tor Proxy'),
|
||||
content: const Text(
|
||||
'This container requires a Tor proxy for secure connections, which is not currently running.',
|
||||
|
||||
@@ -8,14 +8,11 @@ import 'package:lensai/presentation/widgets/animate_gradient_shader.dart';
|
||||
class TorNotification extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
ref.listen(
|
||||
torProxyServiceProvider,
|
||||
(previous, next) {
|
||||
if (!next.isLoading) {
|
||||
ref.read(overlayDialogControllerProvider.notifier).dismiss();
|
||||
}
|
||||
},
|
||||
);
|
||||
ref.listen(torProxyServiceProvider, (previous, next) {
|
||||
if (!next.isLoading) {
|
||||
ref.read(overlayDialogControllerProvider.notifier).dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
return SafeArea(
|
||||
child: ColoredBox(
|
||||
@@ -41,10 +38,9 @@ class TorNotification extends HookConsumerWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Tor Proxy is connecting...',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.copyWith(color: Colors.white),
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.bodyMedium?.copyWith(color: Colors.white),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
@@ -53,10 +49,7 @@ class TorNotification extends HookConsumerWidget {
|
||||
.read(overlayDialogControllerProvider.notifier)
|
||||
.dismiss();
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.close,
|
||||
color: Colors.white,
|
||||
),
|
||||
icon: const Icon(Icons.close, color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user