improve tor ui
This commit is contained in:
+3
-1
@@ -801,7 +801,9 @@ class NavigationMenuButton extends HookConsumerWidget {
|
|||||||
child: const Text('Tor™ Proxy'),
|
child: const Text('Tor™ Proxy'),
|
||||||
builder: (context, ref, child) {
|
builder: (context, ref, child) {
|
||||||
final torConnected = ref.watch(
|
final torConnected = ref.watch(
|
||||||
torProxyServiceProvider.select((value) => value.value != null),
|
torProxyServiceProvider.select(
|
||||||
|
(value) => value.value?.isRunning == true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return Badge(
|
return Badge(
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ class TorNotification extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
ref.listen(torProxyServiceProvider, (previous, next) {
|
ref.listen(torProxyServiceProvider, (previous, next) {
|
||||||
if (!next.isLoading) {
|
if (next.hasValue & next.requireValue.isRunning &&
|
||||||
|
next.requireValue.bootstrapProgress == 100) {
|
||||||
ref.read(overlayControllerProvider.notifier).dismiss();
|
ref.read(overlayControllerProvider.notifier).dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -38,11 +39,14 @@ class TorNotification extends HookConsumerWidget {
|
|||||||
child: ColoredBox(
|
child: ColoredBox(
|
||||||
color: AppColors.torPurple,
|
color: AppColors.torPurple,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 56,
|
height: 56 + 12,
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Row(
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
children: [
|
children: [
|
||||||
AnimateGradientShader(
|
AnimateGradientShader(
|
||||||
duration: const Duration(milliseconds: 500),
|
duration: const Duration(milliseconds: 500),
|
||||||
@@ -74,6 +78,23 @@ class TorNotification extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Consumer(
|
||||||
|
builder: (context, ref, child) {
|
||||||
|
final bootstrapProgress = ref.watch(
|
||||||
|
torProxyServiceProvider.select(
|
||||||
|
(value) => value.value?.bootstrapProgress ?? 0,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
return LinearProgressIndicator(
|
||||||
|
backgroundColor: AppColors.torBackgroundGrey,
|
||||||
|
color: AppColors.torActiveGreen,
|
||||||
|
value: bootstrapProgress / 100,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user